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 accessing uncached root group variable when using NetCDF4FileHandler in caching mode #1195

Merged

Conversation

gerritholl
Copy link
Collaborator

@gerritholl gerritholl commented May 8, 2020

In the NetCDF4FileHandler, when the file handler is being cached, accessing a non-cached variable in the root group was failing with a TypeError because None is being passed to os.fspath.
This PR adds a (regression) unit test for this problem and a fix so that the problem is avoided.

In the NetCDF4FileHandler, add a regression unit test for accessing root
group variables when the file handler is being cached.
@gerritholl gerritholl marked this pull request as draft May 8, 2020 13:28
Read uncached rout group variables when the file handle is being cached.
Closes pytroll#1195.
@gerritholl gerritholl marked this pull request as ready for review May 8, 2020 13:33
@gerritholl gerritholl changed the title bug accessing root group variable using NetCDF4FileHandler in caching mode Fix accessing uncached root group variable when using NetCDF4FileHandler in caching mode May 8, 2020
Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

LGTM

@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 89.622% when pulling 6c34b6c on gerritholl:fix-root-group-variable-cached-netcdf-utils into cf9aab4 on pytroll:master.

@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #1195 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1195   +/-   ##
=======================================
  Coverage   89.62%   89.62%           
=======================================
  Files         200      200           
  Lines       29550    29553    +3     
=======================================
+ Hits        26483    26486    +3     
  Misses       3067     3067           
Impacted Files Coverage Δ
satpy/readers/netcdf_utils.py 100.00% <100.00%> (ø)
satpy/tests/reader_tests/test_netcdf_utils.py 95.40% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf9aab4...6c34b6c. Read the comment docs.

@gerritholl gerritholl added this to Ready for review in PCW Spring 2020 May 8, 2020
@gerritholl gerritholl moved this from Ready for review to Ready to merge in PCW Spring 2020 May 8, 2020
@gerritholl gerritholl mentioned this pull request May 8, 2020
5 tasks
@djhoese djhoese self-assigned this May 12, 2020
@djhoese djhoese merged commit 6418174 into pytroll:master May 12, 2020
PCW Spring 2020 automation moved this from Ready to merge to Done May 12, 2020
@gerritholl gerritholl mentioned this pull request May 28, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants