Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 documentation, kwargs for Reader #2236
Add documentation, kwargs for Reader #2236
Changes from 1 commit
ff257c2
1b242a7
7f316a1
607efa4
b4e6d9b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to make this change as well? Now
Reader
is a function rather than a class.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think Reader being an alias for BasicReader / FionaReader is ideal. Using a function avoids this and also adds the docstring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it isn't ideal. But, I personally would prefer that to a function that looks like a class, I won't block on it, but I also won't approve it either.
Another way of doing this would have been to create a
class Reader
that stores an instance ofself._reader = FionaReader() if _HAS_FIONA else BasicReader()
and then dispatches out the methods to whateverself._reader
it contains, but that seems like more work than is necessary as well unless we start getting more readers.Also, I think you can add a docstring right below the
Reader
definition like we do for the configuration dictionary:cartopy/lib/cartopy/__init__.py
Lines 23 to 31 in 96ee0a3
but maybe to get that to work you'd need to put it all on one line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip on adding a docstring to the existing Reader line! I like that solution, which has now been made.