satpy
satpy copied to clipboard
Make WavelengthRange importable from satpy.dataset
This PR makes the satpy.dataset.dataid.WavelengthRange class from importable from satpy.dataset. The satpy internals docs suggest that, but currently the import doesn't work.
Codecov Report
Merging #1719 (58cfa4f) into main (c34aebc) will not change coverage. The diff coverage is
100.00%.
@@ Coverage Diff @@
## main #1719 +/- ##
=======================================
Coverage 94.30% 94.30%
=======================================
Files 306 306
Lines 46043 46043
=======================================
Hits 43421 43421
Misses 2622 2622
| Flag | Coverage Δ | |
|---|---|---|
| behaviourtests | 4.62% <100.00%> (ø) |
|
| unittests | 94.94% <100.00%> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| satpy/dataset/__init__.py | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Coverage remained the same at 94.894% when pulling 58cfa4f978382e22c5d6a2e239dd770b4f07e5b9 on sfinkens:fix-wavelength-range-import into c34aebcd0276e89f231a1cdb3f7a5fef3dfb4b55 on pytroll:main.
My guess is this was a find/replace error when I was moving these modules around when refactoring. Interested why you decided to change the imports rather than change the documentation in the satpy internals?
In fact I first changed the documentation, but then I saw that ModifierTuple is already available in satpy.dataset, so I thought maybe that's how it's supposed to be :smile:
So I think I tried to only put stuff in the __init__ that a user might need to use, at least from what I thought they would need. So a ModifierTuple would be needed if you were making a DataQuery I think, but now that I think about it I think a normal tuple works fine. I guess I don't care that strongly either way, but WavelengthRange is used in YAML files already. They don't need to be updated, but I wanted to point out that it is used there.
@mraspaud any opinion?
@mraspaud Any opinion? Otherwise I would revert the changes and update the documentation
Where are we here?
I suppose we should not also include FrequencyRange etc from readers/pmw_channels_definitions.py!?
I'm good with that change, but in what context would that be useful for a user?
There's no context :smile: I just wanted to make the example in the documentation work. So maybe I should just update the example
from satpy.dataset.dataid import WavelengthRange