Skip to content

fix: Add code to get_usgs_CDA to allow converting smaller interval data to store as 15 minute data.#228

Open
tsressin wants to merge 7 commits into
HydrologicEngineeringCenter:mainfrom
tsressin:usgs_5_to_15
Open

fix: Add code to get_usgs_CDA to allow converting smaller interval data to store as 15 minute data.#228
tsressin wants to merge 7 commits into
HydrologicEngineeringCenter:mainfrom
tsressin:usgs_5_to_15

Conversation

@tsressin

@tsressin tsressin commented Jul 6, 2026

Copy link
Copy Markdown

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

@tsressin tsressin requested a review from Enovotny as a code owner July 6, 2026 13:28
@krowvin krowvin changed the title Add code to get_usgs_CDA to allow converting smaller interval data to store as 15 minute data. fix: Add code to get_usgs_CDA to allow converting smaller interval data to store as 15 minute data. Jul 6, 2026
@krowvin

krowvin commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

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.

@tsressin tsressin requested a review from krowvin as a code owner July 6, 2026 14:54
@krowvin krowvin requested a review from msweier July 6, 2026 15:11
Comment thread .pre-commit-config.yaml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to resolve the issue you had with poetry trying to run locally. Good!

@@ -0,0 +1,28 @@
repos:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This .pre-cmmit-file.cong.yaml.org is a copy of the original and probably was included by accident.

Comment thread .pre-commit-config.yaml
hooks:
- id: black
name: black
entry: poetry run black

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want a separate PR if the yaml needs to be changed?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get USGS Timeseries not storing 15 minute data when original data is 5 minute.

3 participants