Skip to content

Add Endpoint for Turbine Changes and Tests #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

krowvin
Copy link
Collaborator

@krowvin krowvin commented Feb 11, 2025

This PR is for

It adds the endpoints seen here for turbine-changes:
https://cwms-data.usace.army.mil/cwms-data/swagger-ui.html

Patch is the only endpoint I did not add.

Why I marked this as a draft

I am uncertain of the function names.

I tried to keep them similar to cwmsjs seen here:

While not a cwms-python issue, these names are generated this way and are.. descriptive despite being long.

I'm open to change on these to enforce the cwms-python naming if we have preference.

Tests

Added json resources and ran various pytests

Copy link
Collaborator

@Enovotny Enovotny left a comment

Choose a reason for hiding this comment

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

It would also be helpful, and it doesn't have to be part of this pull request, to add an example notebook similar to the ratings one under the examples folder. To show how each of these "regi" endpoints work. Can include some of the other endpoints as well for locks, ect. This would also allow you to test the endpoints against cwbi-test to make sure they are working correctly and using the correct urls/parameters. If you are unable to do that maybe we can fund someone at SWT, SWF, or another district to put that together.

@krowvin krowvin marked this pull request as ready for review February 13, 2025 18:05
@krowvin krowvin requested a review from Enovotny February 20, 2025 21:41
@krowvin krowvin linked an issue Feb 20, 2025 that may be closed by this pull request
@Enovotny
Copy link
Collaborator

looks like 2 test failed.

=========================== short test summary info ============================
FAILED tests/turbines/turbines_test.py::test_store_project_turbine_changes - requests_mock.exceptions.NoMockAddress: No mock address: POST https://mockwebserver.cwms.gov/projects/SWT/KEYS/turbine-changes?override-protection=False
FAILED tests/turbines/turbines_test.py::test_delete_project_turbine_changes - requests_mock.exceptions.NoMockAddress: No mock address: DELETE https://mockwebserver.cwms.gov/projects/SWT/KEYS/turbine-changes?begin=2024-01-01T00%3A00%3A00&end=2024-12-31T00%3A00%3A00&override-protection=False
================== 2 failed, 105 passed, 4 warnings in 1.72s ===================
Error: Process completed with exit code 1.

@krowvin krowvin merged commit 108399c into HydrologicEngineeringCenter:main Feb 25, 2025
6 checks passed
@krowvin krowvin deleted the endpoint/turbine-changes branch February 25, 2025 03:39
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.

Add Turbine Changes endpoints
2 participants