Skip to content

Add location and timeseries group example#160

Merged
msweier merged 15 commits intomainfrom
location_groups
Aug 5, 2025
Merged

Add location and timeseries group example#160
msweier merged 15 commits intomainfrom
location_groups

Conversation

@msweier
Copy link
Collaborator

@msweier msweier commented Jul 16, 2025

Adds location and timeseries group examples and tests.
Updates location group functions to add df to json function and allow cascade delete.
Bump version to 0.8.1

@msweier msweier marked this pull request as draft July 16, 2025 19:59
@msweier msweier marked this pull request as ready for review July 29, 2025 15:07
@msweier msweier requested a review from Enovotny July 29, 2025 15:08
print("Initializing CWMS API session for locations operations test...")


def test_store_location():
Copy link
Collaborator

Choose a reason for hiding this comment

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

instead of a test which is already taken care of in the locations test. can you try this code in the beginning. Treyson is using it for timeseries. It will do a spin up and tear down. feel free to put in your own location information... can also add timeseries for the timeseries group..

# Setup and teardown fixture for test location
@pytest.fixture(scope="module", autouse=True)
def setup_data():
    loc_id = "pytest_loc"
    location_data = {
        "name": loc_id,
        "latitude": 38.0,
        "longitude": -121.0,
        "public-name": "pytest location",
        "long-name": "Pytest Location for Timeseries Testing",
        "elevation": 10.0,
        "unit": "m",
    }

    # Store location before tests
    cwms.store_location(location_data)

    yield

    # Delete location after tests
    cwms.delete_location(loc_id)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good, I updated the ts and loc groups to use the module

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 5, 2025

@msweier msweier merged commit 5b29c4e into main Aug 5, 2025
9 checks passed
@msweier msweier deleted the location_groups branch August 5, 2025 18:17
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.

2 participants