Open
Conversation
…ensors for instruments
…ated validations for each instrument
…igher level for scalability
… kernels from the argo vertical movement kernel to enable easier scalability
…operty shorthands
…ensors for instruments
…ated validations for each instrument
…igher level for scalability
… kernels from the argo vertical movement kernel to enable easier scalability
…operty shorthands
…p into refactor-sensors
for more information, see https://pre-commit.ci
…p into refactor-sensors
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.
Overview
This PR centralises/abstracts instrument sensor/variable sampling logic so that each instrument declares which sensors it carries (e.g.
TEMPERATURE,SALINITY,VELOCITY). Users can configure which sensors are active for each instrument in the expedition YAML.This helps pave the way for easy addition of BGC sensors to the Argo float in a future PR (#234), and consolidation of CTD + CTD_BGC into a single instrument (#260) with a combined sensor allowlist. Also makes it straightforward to add new sensors to any instrument in the future (e.g., #312, #313), and streamlines them process for developers to add new instruments (i.e. #237)
Major changes
sensors.pyininstruments/defines theSensorTypeclass and per-instrument allowlists (so that there is control over which sensors each instrument supports and users cannot configure unsupported sensors).SensorConfigpydantic model andsensorsfield in every instrument config inexpedition.py.SensorRegistryinutils.pythat maps eachSensorTypeto its FieldSet key, Copernicus variable name, category (phys/bgc), and Parcels particle variable name(s).cycle_phasefor Argo Floats.API change
As mentioned above, the instruments config section of the expedition YAML now has a
sensorslist field, where users specify which sensors are active. For example, below the CTD is configured to sampleTEMPERATUREandSALINITY:sensorslist is omitted, it default to all valid sensors for that instrument.Additional change
Follow-up PRs
planCLI tool will need updating to account for sensor configuration options. Currently not broken but doesn't give option to configure sensors. (New issue to be opened)CTDandCTD_BGCto one instrument #260)Tests