Switch to WMO Instruments#3390
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3390 +/- ##
========================================
Coverage 96.30% 96.31%
========================================
Files 466 468 +2
Lines 59090 59264 +174
========================================
+ Hits 56908 57081 +173
- Misses 2182 2183 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Would it make sense to move those instrument helper methods to a dedicated module |
|
I added the "backwards-incompatibility" label on this PR. Let me know if that isn't accurate. You should rebase this PR on |
djhoese
left a comment
There was a problem hiding this comment.
Looks pretty good. I had a couple questions inline. I think my biggest long term fear after seeing these changes is handling the "sensor" in the enhancement decision tree.
…atpy into wmo-instruments-part1
|
I also moved the instrument helpers to their own module. |
The Plan
This is the first of a series of PRs for switching to WMO instrument names (
AVHRR/1) in user facing places, namely dataset attributes andscene.sensor_names. The internal representation (avhrr-1) remains the same.Furthermore, we agreed to deprecate
sensor: str|set[str]in favor ofinstruments: set[str]. For backwards compatibility, a config switch will be added to get the legacysensorattribute back.instruments.sensorin favor ofinstruments2.1 Enhancements: WMO Instruments Part 2.1: Enhancements sfinkens/satpy#2
2.2 File Handlers: WMO Instruments Part 2.2: File Handlers sfinkens/satpy#3
sensortoinstrumentin all method names and docstrings.I hope this way the changes are less painful to review. PRs 2-4 are relative to this PR, which will be merged into main eventually.
Changes in this PR
satpy._instrumentsmodule containingStrEnumwith all WMO instrument names. Members behave like strings, even in setssensorandinstrumentsare supported, with a deprecation warning forsensor.sensorattribute inscene.__getitem__if it doesn't exist. To be removed in v1.0.instruments_keythat controls which attribute Satpy is using. This is mostly for postponing the file handler changes to the second PR. Current default issensor, will be changed toinstrumentsonce all file handlers provide aninstrumentsattribute, and then removed.Breaking Changes
None so far. For v1.0 we would have to remove compatibility methods and deprecation warnings wrapped in
8< v1.0. Then Satpy wouldn't support thesensorattribute anymore.Notes
It would be nice to have a custom Attributes class with getters and setters for the instrument, but xarray converts it back to plain dicts internally.
AUTHORS.mdif not there already