Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Scene modifying user-provided reader_kwargs #2335

Merged
merged 2 commits into from
Dec 21, 2022

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Dec 21, 2022

While working with the MultiScene I noticed that only the first Scene creation was working and failing on the second because reader_kwargs passed by me were being modified by the Scene. This is the simplest fix I could think of for fixing this.

  • Closes #xxxx
  • Tests added
  • Fully documented

@codecov
Copy link

codecov bot commented Dec 21, 2022

Codecov Report

Merging #2335 (1d8a03a) into main (cfe4fa9) will increase coverage by 0.00%.
The diff coverage is 59.25%.

@@           Coverage Diff           @@
##             main    #2335   +/-   ##
=======================================
  Coverage   94.58%   94.59%           
=======================================
  Files         314      314           
  Lines       47518    47526    +8     
=======================================
+ Hits        44943    44955   +12     
+ Misses       2575     2571    -4     
Flag Coverage Δ
behaviourtests 4.50% <3.70%> (-0.01%) ⬇️
unittests 95.21% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
satpy/utils.py 24.92% <8.33%> (-0.15%) ⬇️
satpy/tests/test_scene.py 99.50% <100.00%> (+<0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@coveralls
Copy link

coveralls commented Dec 21, 2022

Coverage Status

Coverage increased (+0.009%) to 95.17% when pulling 1d8a03a on djhoese:bugfix-mod-reader-kwargs into cfe4fa9 on pytroll:main.

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codecov seems to think the fix isn't covered by the modified tests.

@djhoese
Copy link
Member Author

djhoese commented Dec 21, 2022

I never liked codecov anyway 😉

If I click on the link I get this:

image

But then if I expand utils.py it looks like it isn't being covered:

image

@djhoese
Copy link
Member Author

djhoese commented Dec 21, 2022

I don't know exactly what codecov's problem is. Everything is tested now and when you click on the codecov Details it shows that things are covered...I think.

As discussed on slack with @pnuu, this PR now also clarifies/fixes the case where storage_options are defined at the "global" reader_kwargs level and the per-reader level (use global as defaults, overwrite with reader-specific).

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants