Switch to WMO Instruments#3390
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3390 +/- ##
==========================================
+ Coverage 96.33% 96.35% +0.01%
==========================================
Files 467 470 +3
Lines 59138 59391 +253
==========================================
+ Hits 56973 57226 +253
Misses 2165 2165
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 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
mraspaud
left a comment
There was a problem hiding this comment.
Wow, that's a big one! But very clean, I like it!
My only concern is instument vs sensor, not in the naming, but rather that it could be confusing, but I understand that it makes things more distinct. So nothing to change there.
|
@martin You mean that there's both Ok so I'm going to merge PRs sfinkens#2 and sfinkens#3 into this one and continue with renaming enhancement/composite files so that they match the WMO name. |
|
How will you handle backwards compatibility with old filenames? Or search for both? |
|
My idea was to create a link from the old filename to the new filename |
|
But what will users do before they have time to transition? |
|
Transition their custom YAMLs I mean |
Hmm, good point. I didn't think of that. Then I'll have so search for both the old and the new name. |
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
3.1 Rename files: WMO Instruments Part 3.1: Rename enhancement and composite YAML files sfinkens/satpy#5
3.2 Rename
sensor_nameproperty toinstruments: WMO Instruments Part 3.2: Cosmetics sfinkens/satpy#6sensortoinstrumentin 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.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