fix: Add code to get_usgs_CDA to allow converting smaller interval data to store as 15 minute data.#228
Conversation
… the standalone getUSGS_CDA to the cwms-cli version.
|
For the failed code check, I shared https://github.com/HydrologicEngineeringCenter/cwms-cli/blob/main/CONTRIBUTING.md with @tsressin to see how formatting is done locally. |
This reverts commit 20cc807.
There was a problem hiding this comment.
This looks to resolve the issue you had with poetry trying to run locally. Good!
| @@ -0,0 +1,28 @@ | |||
| repos: | |||
There was a problem hiding this comment.
This .pre-cmmit-file.cong.yaml.org is a copy of the original and probably was included by accident.
| hooks: | ||
| - id: black | ||
| name: black | ||
| entry: poetry run black |
There was a problem hiding this comment.
Do we want a separate PR if the yaml needs to be changed?
There was a problem hiding this comment.
I would say so, I had started one to fix the issue with the formatting library versions being different based on version of python running.
I.e. your local vs CI versions
But this was also blocking the local tests from running.
Should we pick this out into its own PR? @msweier
There was a problem hiding this comment.
I had to change the yaml in order to pass the commit checks, otherwise it could not find poetry.
I don't know if this is an everybody problem or just a me problem.
| office = row["office-id"] | ||
| values["quality-code"] = 0 | ||
|
|
||
| # 15 minute conversion to allow storing smaller interval data (eg. 5 minute) as 15 minute data |
There was a problem hiding this comment.
Did this site start as 15 minute and went to 5 minute? Another thought is to use an irregular timeseries ~15Minute which would let you keep them in the same timeseries and preserving all the data. But if you want to subsample to 15 minutes, this works too!
There was a problem hiding this comment.
There are some sites that went from 15 to 5 and some that have always been 5. For my purposes, 5 minutes is overkill and no need to fill up the database unnecessarily. So, I have always only stored 15 minute data for these sites. Previous versions of getusgs (non-cda and cda) allowed for this, but it was somehow missed in the cwms-cli version of getusgs. I just want to maintain my existing processing.
I copied the relevant code from the standalone getusgs_CDA (which already had a fix for this issue) into the cwms-cli version of getusgs_CDA.
Closes #103