satpy icon indicating copy to clipboard operation
satpy copied to clipboard

Make WavelengthRange importable from satpy.dataset

Open sfinkens opened this issue 3 years ago • 6 comments

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.

sfinkens avatar Jun 07 '21 07:06 sfinkens

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.

codecov[bot] avatar Jun 07 '21 07:06 codecov[bot]

Coverage Status

Coverage remained the same at 94.894% when pulling 58cfa4f978382e22c5d6a2e239dd770b4f07e5b9 on sfinkens:fix-wavelength-range-import into c34aebcd0276e89f231a1cdb3f7a5fef3dfb4b55 on pytroll:main.

coveralls avatar Jun 07 '21 07:06 coveralls

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?

djhoese avatar Jun 07 '21 15:06 djhoese

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:

sfinkens avatar Jun 08 '21 11:06 sfinkens

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?

djhoese avatar Jun 08 '21 11:06 djhoese

@mraspaud Any opinion? Otherwise I would revert the changes and update the documentation

sfinkens avatar Dec 12 '21 07:12 sfinkens

Where are we here? I suppose we should not also include FrequencyRange etc from readers/pmw_channels_definitions.py!?

adybbroe avatar Nov 15 '22 20:11 adybbroe

I'm good with that change, but in what context would that be useful for a user?

mraspaud avatar Nov 16 '22 06:11 mraspaud

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

sfinkens avatar Dec 05 '22 16:12 sfinkens