-
Notifications
You must be signed in to change notification settings - Fork 9
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
Subset by rows and pruning examples in docstring #338
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
milancurcic
changed the title
Subset by rows example in docstring
Subset by rows and pruning examples in docstring
Dec 8, 2023
That's clean! And close 2 issues with a docstring might be a record. haha |
Well, it's really thanks to your versatile design of |
I found a better way but we have to allow specifying dimensions in criteria. With the most recent commit, you can do: subset(ds, {"traj": rows}) because the dimension data are conveniently the row indices. |
That's nice!
is quick to get |
selipot
approved these changes
Dec 10, 2023
philippemiron
pushed a commit
to philippemiron/clouddrift
that referenced
this pull request
Dec 10, 2023
* Subset by rows * Add doctring example for pruning a dataset * Allow querying dimensions in subset * example edit --------- Co-authored-by: Shane Elipot <selipot@miami.edu>
selipot
added a commit
that referenced
this pull request
Dec 16, 2023
* sofar dataset * add test * Subset by rows and pruning examples in docstring (#338) * Subset by rows * Add doctring example for pruning a dataset * Allow querying dimensions in subset * example edit --------- Co-authored-by: Shane Elipot <selipot@miami.edu> * Fix #226 (#339) Co-authored-by: Philippe Miron <philippe.miron@dtn.com> * fix deprecation warnings in tests (#340) * fix deprecation warnings * remove complex warning * ds.sizes instead of ds.dims which will eventually return only tuple of dimensions * log zero in sphere * wrong exception --------- Co-authored-by: Philippe Miron <philippe.miron@dtn.com> * Ellipse functions (#334) * ellipse functions * remove comment * lint * typo in tests * extra return carriage * Update clouddrift/signal.py Co-authored-by: Milan Curcic <caomaco@gmail.com> * better tests * corrected tests * version bump * new tests * errstate ignore --------- Co-authored-by: Milan Curcic <caomaco@gmail.com> * Update datasets.py * change name --------- Co-authored-by: Philippe Miron <philippe.miron@dtn.com> Co-authored-by: Milan Curcic <caomaco@gmail.com> Co-authored-by: Shane Elipot <selipot@miami.edu>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Not a feature but examples in docstring.
Closes #196.
Closes #305.
After looking into how to do this more easily (see #305 for the problem), I found that it doesn't warrant new functionality, e.g.
rows
keyword parameter. We merely need to slice theid
array by the desired rows.