BDMS 55: observation coverage & other updates#91
Merged
Conversation
the sample table is no longer queried when adding observations, so the simplified adder is now used
cannot have two foreign key constraints to the same (sample) table
Codecov Report❌ Patch coverage is
|
jirhiker
requested changes
Aug 21, 2025
|
|
||
| # geothermal | ||
| depth = mapped_column( | ||
| observation_depth = mapped_column( |
Member
There was a problem hiding this comment.
@jacob-a-brown, @ksmuczynski should this be part of the Sample model?
Contributor
Author
|
The latest update gets the |
Merged
jirhiker
approved these changes
Aug 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This PR addresses the following problem / context:
observationrouter should be fully covered with GET, GET by ID, POST, PATCH, and DELETE endpointsHow
Implementation summary - the following was changed / added / removed:
/observation/groundwater-level,/observation/geothermal,/observation/water-chemistryendpoints/observation/groundwater-level/{observation_id},/observation/geothermal/{observation_id},/observation/water-chemistry/{observation_id}endpointsobservation_iddoes not exist in the databaseobservation_idexists in the database but its observation class (e.g. water chemistry) does not correspond to the endpoint. the actual observation class of the record with that ID is specified in the error message/observation/ and/observation/{observation_id}`/observation/groundwater-level,/observation/geothermal,/observation/water-chemistryendpoints/observation/groundwater-level/{observation_id},/observation/geothermal/{observation_id},/observation/water-chemistry/{observation_id}endpointsobservation_iddoes not exist in the databaseobservation_idexists in the database but its observation class (e.g. water chemistry) does not correspond to the endpoint. the actual observation class of the record with that ID is specified in the error message/observation//{observation_id}Notes
Any special considerations, workarounds, or follow-up work to note?
observation_classes (e.g.groundwater level,water chemistry) are defined byobserved_property. This is pretty easy when there's only one property per class, likegroundwater level, but can become overwhelming and difficult to maintain when there are multiple properties per class, likewater chemistry. Maybe this will become a moot point when we make the views, and those can be used?deg Cto lexicon for geothermal observed property__table_args__andidfrom Observation model since the primary key is just theid, which is defined inAutoBaseMixindepth_to_waterfrom the model since that's encapsulated invalueandobserved_propertyGroundwaterLevelResponsecalculates depth to water below ground surface asvalue - measuring_point_heightdepth_to_water_bgsbe calledcalculated_depth_to_water_bgsfor clarity and to be explicit?