-
Notifications
You must be signed in to change notification settings - Fork 107
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
Read arguments #444
Read arguments #444
Conversation
Co-authored-by: Wei Ji <[email protected]>
👈 Launch a binder notebook on this branch for commit 612662e I will automatically update this comment whenever this PR is modified 👈 Launch a binder notebook on this branch for commit c16a003 👈 Launch a binder notebook on this branch for commit 7648078 👈 Launch a binder notebook on this branch for commit 4cfbfdb 👈 Launch a binder notebook on this branch for commit 203f3ad 👈 Launch a binder notebook on this branch for commit 10d1591 👈 Launch a binder notebook on this branch for commit 6f5bead 👈 Launch a binder notebook on this branch for commit 035ee5a 👈 Launch a binder notebook on this branch for commit 903c351 👈 Launch a binder notebook on this branch for commit d842bde 👈 Launch a binder notebook on this branch for commit 5e06de9 👈 Launch a binder notebook on this branch for commit 9ca29f1 👈 Launch a binder notebook on this branch for commit e8e35ad 👈 Launch a binder notebook on this branch for commit 4bcc518 👈 Launch a binder notebook on this branch for commit b2c2735 👈 Launch a binder notebook on this branch for commit 6b953f9 👈 Launch a binder notebook on this branch for commit 45704a4 👈 Launch a binder notebook on this branch for commit 2bf2808 👈 Launch a binder notebook on this branch for commit 1242881 👈 Launch a binder notebook on this branch for commit 5f8589a |
Ok @JessicaS11 and/or @weiji14, this PR is ready for comments. I am still working on 1) updating docstrings and 2) writing a few tests, but in the meantime I'm interested in initial feedback. Specifically, I left 3 questions in the Thanks! |
You make a compelling argument, and if we provide a few good glob examples (or links to them) in the notebook then we are hopefully showing users what they'd need to know. I think then I would be okay with deprecating the user-input product argument.
Correct! So if we're adding cloud support specifically in a next step, then we can bookmark adding this there.
See comment above - this would be an example glob use case I'd want to include.
Deprecated = discouraged in my book. Wondering if we should put a projected deprecation date in the message (or at the very least add a comment for ourselves on the date and last version to use the keyword) so that we can set a standard for actually removing deprecated things from the code. |
Thanks for the comments @JessicaS11!
I did some quick reading about depreciation recommendations. What you mention here, of informing users of in what version the feature will be depreciated, is considered best practice. To the "how long should you wait to depreciate" question, I noticed that people seem to mark time not by number of months but by versions. One SO comment summarized "Major version releases are a good time to remove deprecated methods. Minor releases should typically not contain breaking changes." Other common themes included communicating with users, ex. in warnings (I think icepyx does this well) or blog posts. Have you considered a major release to v1.0.0 at some point? Either the integration of cloud reading or the Argo project that you're working on (or both) seem like big changes that could perhaps prompt a major release. The big changes you made to authentication could also be part of what gets announced. The major version change could then be a good time to remove many features that have been maintained only for backward compatibility. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Ok, this PR is ready for review! Since the last comment I updated the documentation and also added Looking forward to a review! |
@@ -63,9 +63,8 @@ | |||
"metadata": {}, |
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.
Suggestion:
glob will not by default search all of the subdirectories for matching filepaths, but it has the ability to do so. If you would like to search recursively, you can achieve this by:
- passing the
recursive=True
argument intoglob_kwargs
(shown below) - use
/**/
in the filepath to match any level of nested folders (not shown below) - using glob directly to create a list of filepaths (shown below)
Reply via ReviewNB
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 streamlined this explanation, like your comment suggests. Let me know if it still isn't clear!
All comments addressed. I'm looking for a 👍🏻 about how the glob docs section was phrased. Then we are just waiting to see what happens with the visualization errors caused by the OpenAltimetry API (cc @JessicaS11). |
Looks great, @rwegener2. I'll hold off on approving until #454 is fixed so there's not an accidental merge, but this is good to go! |
@all-contributors |
I've put up a pull request to add @rwegener2! 🎉 I've put up a pull request to add @jpswinski! 🎉 I've put up a pull request to add @whyjz! 🎉 |
* add filelist and product properties to Read object * deprecate filename_pattern and product class Read inputs * transition to data_source input as a string (including glob string) or list * update tutorial with changes and user guidance for using glob --------- Co-authored-by: Jessica Scheick <[email protected]>
* add filelist and product properties to Read object * deprecate filename_pattern and product class Read inputs * transition to data_source input as a string (including glob string) or list * update tutorial with changes and user guidance for using glob --------- Co-authored-by: Jessica Scheick <[email protected]>
This reverts commit bae2d89.
What was Done
This PR changes the input parameters for the Read module in two ways:
filepath_pattern
anddata_source
arguments into a single parameter (maintained the namedata_source
).product
argument from the user. It will still be optional, both for the purposes of deprecation, and also to be used in the event that a user provides a list of files that do not all contain the same product.The options for the new version of the
data_source
parameter are:Unsupported options for
data_source
are:How It was Done
The majority of the changes are all in the
__init__
method. The overall flow of the method is now:data_source
input parameter isOther notable changes:
Depreciation comments
product
It complicates the logic quite a bit to continue to allow the user to provide a
product
argument. I do think we should maintain it for the moment because it allows for backwards compatibility, but in the future it would be a lot simpler if the user were just required to provide a path to files of only a single product type. We give them lots of options for flexibility via glob strings.Notes & Questions
Query
object as adata_source
parameter type. It seems like this only makes sense for the cloud reading, since the Query object returns the paths of cloud data. Is this correct, or am I missing something?glob
module on their own with therecursive=True
argument.product
argument is discouraged, but I'm open to hearing other opinions on this. (See note above in Depreciation Comment. I'm arguing from a dev perspective, but I may not be doing a complete job of seeing the user side. So, well, teamwork 🙂)Todo