Skip to content

refactor(edr): step 1: update current tests to describe changes that will occur to EDR (BDMS-1542 & BDMS-1500) - #1051

Open
jacob-a-brown wants to merge 2 commits into
stagingfrom
BDMS-1542-feat-ocotillo-implement-test-for-die-timeseries-summary-water-levels
Open

jacob-a-brown wants to merge 2 commits into
stagingfrom
BDMS-1542-feat-ocotillo-implement-test-for-die-timeseries-summary-water-levels

Conversation

@jacob-a-brown

@jacob-a-brown jacob-a-brown commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

This work will be done in a series of stacked PRs and therefore I expect these tests to fail until all of the subsequent PRs get approved and merged into this one. Some of the tests may need to change depending on implementation, but this is what I foresee needing updates.

Why

This PR addresses the following problem / context:

  • the ogc_waterlevels view is going to change from a mix of manual and continuous measurements to ogc_manual_waterlevels and consist solely of manual measurements
  • EDR collections will now be constructed to enable to enable multiple ranges per collection. These different ranges, or parameters, can come from different rows in same column (as in there are multiple analytes in the chemistry table that report a value) or from different columns in the same row (e.g. observation_value / observation_parameter_name and qualifier_value / qualifier_parameter_name).
  • WaterEDRProvider wasn't an appropriately descriptive class name since time series at a point won't necessarily be water-based

How

Implementation summary: the following was changed / added / removed:

I updated the current tests to describe how the codebase is going to change. Future work will address new aspects of the changes and data contract, such as the shape of the data.

tests/features/edr-water-data.feature & tests/features/steps/edr_water_data.py

  • Updates here were made to address manual water levels only. Transducer data will be addressed in future work.

tests/test_edr_provider.py

  • Updated WaterEDRProvider to the more general PointSeriesEDRProvider since that class can and will eventually be used for other point series data, such as air temperature at a meteorological station or heat flow data

tests/test_migration_view_parity.py

  • The old tests were hardcoded to different alembic versions. This made it so that if a view is torn down and a one different is rebuilt in a future version, such as ogc_waterlevels -> ogc_manual_waterlevels, then the newer one won't be tested. This now tests against the database to ensure that internal and public views are made as needed.

tests/test_ogc_field_descriptions.py

  • To allow parameters to come from multiple columns, or for there to be multiple parameters in one column, the EDR_COLLECTIONS dictionary now needs to have a parameter_columns key that evaluates to a list of dictionaries of the name_column, value_column, and units_column (if applicable). This is what will tell the EDR Provider which columns to look in for the different parameter names, values, and units.
    • Work will have to be done in the provider to get all of the lists to be equal length and have the nth element correspond to the nth datetime. This isn't an issue if parameter names don't differ from row-to-row, like water levels, but will need to be considered for water chemistry data where parameter names will differ.
  • Added an independent_axis field to the provider definition (an EDR_COLLECTIONS dictionary) so that different collections can have different independent axes. This will enable us to use the same PointSeriesEDRProvider for both time series and depth/height series. It seems like EDRs can be multi-dimensional, such as time and depth, but we don't have that data at the moment and it seems out of the scope of this work. I anticipate the independent_axis key in the EDR dictionary to kind of be like this (though won't be sure until it's implemented):
"independent_axis": {
    "name": "t",
    "system": {"type": "TemporalRS", "calendar": "Gregorian"}
}

then for height/depth

"independent_axis": {
    "name": "z",
    "system": {"type": "International foot", "id": "https://www.nist.gov/system/files/documents/2024/01/14/NIST%20HB%2044%202024%20Appendix%20C%20General%20Tables%20of%20Units%20of%20Measurement.pdf"}
}

and that information be used to populate the CoverageJSON.

Author Checklist

  • Changes are limited to the intended scope.
  • Tests were added or updated where appropriate.
  • Relevant tests and lint checks pass.
  • No secrets, credentials, or sensitive data were publicly exposed.
  • Documentation was updated where necessary.

Reviewer Checklist

  • Use checkboxes here

Notes

Any special considerations, known limitations, risks, workarounds, or follow-up work to note?

  • I made a mistake with my git history and accidentally removed the test in test_ogc.py in this branch. That test, however, has not disappeared. I just created a new testing suite specific to manual waterlevels and it has moved there. That test will be present in the next PR in this stack.

@jacob-a-brown jacob-a-brown changed the title tests(edr): update current tests to describe changes that will occur to EDR (BDMS)-1542 refactor(edr): step 1: update current tests to describe changes that will occur to EDR (BDMS)-1542 Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

No coverage data was produced.

@jacob-a-brown jacob-a-brown changed the title refactor(edr): step 1: update current tests to describe changes that will occur to EDR (BDMS)-1542 refactor(edr): step 1: update current tests to describe changes that will occur to EDR (BDMS-1542 & BDMS-1500) Nov 12, 2026
@jacob-a-brown
jacob-a-brown force-pushed the BDMS-1542-feat-ocotillo-implement-test-for-die-timeseries-summary-water-levels branch from a2780da to 29979fe Compare November 13, 2026 16:20

This branch has not been deployed

No deployments
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.

1 participant