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

Add missing_ok option to find_files_and_readers #1165

Merged
merged 2 commits into from May 18, 2020

Conversation

gerritholl
Copy link
Collaborator

@gerritholl gerritholl commented Apr 27, 2020

Add an optional keyword argument missing_ok to
satpy.readers.find_files_and_readers. It defaults to False (the current
behaviour), but if set to True, getting zero results is no longer
considered an error but will result in an empty dictionary instead.

Add an optional keyword argument notfound_ok to
satpy.readers.find_files_and_readers.  It defaults to False (the current
behaviour), but if set to True, getting zero results is no longer
considered an error but will result in an empty dictionary instead.
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.

I wonder if missing_ok would be more inline with stdlib python: https://docs.python.org/3/library/pathlib.html#pathlib.Path.unlink

Although I thought this keyword argument was used more in the standard library, I can't find a lot of use for it. There is the exists_ok of mkdirs that I'm more familiar with.

@coveralls
Copy link

coveralls commented Apr 27, 2020

Coverage Status

Coverage increased (+0.0004%) to 89.606% when pulling b3c6348 on gerritholl:find-files-nexist-ok into 65cd83f on pytroll:master.

@codecov
Copy link

codecov bot commented Apr 27, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1165   +/-   ##
=======================================
  Coverage   89.60%   89.60%           
=======================================
  Files         200      200           
  Lines       29487    29488    +1     
=======================================
+ Hits        26422    26423    +1     
  Misses       3065     3065           
Impacted Files Coverage Δ
satpy/readers/__init__.py 95.09% <100.00%> (ø)
satpy/tests/test_readers.py 98.97% <100.00%> (+<0.01%) ⬆️

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 65cd83f...b3c6348. Read the comment docs.

To be consistent with pathlib.Path.unlink, rename the ``notfound_ok``
keyword argument introduced in the previous commit by ``missing_ok``.
@gerritholl gerritholl changed the title Add notfound_ok option to find_files_and_readers Add missing_ok option to find_files_and_readers Apr 29, 2020
@gerritholl gerritholl added this to Ready for review in PCW Spring 2020 May 5, 2020
@mraspaud mraspaud merged commit 378cdfd into pytroll:master May 18, 2020
PCW Spring 2020 automation moved this from Ready for review to Done May 18, 2020
@gerritholl gerritholl deleted the find-files-nexist-ok branch May 18, 2020 15:59
@mraspaud mraspaud added component:scene enhancement code enhancements, features, improvements labels Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:scene enhancement code enhancements, features, improvements
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants