-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[docs] add Dataset.assign_coords example (#6336) #6558
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8434785
[docs] add Dataset.assign_coords example (#6336)
3aa2ebb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] dc533c8
[docs] amend Dataset.assign_coords example (#6336)
357f4cc
[docs] amend Dataset.assign_coords example (#6336)
5eaa9c6
[docs] amend Dataset.assign_coords example (#6336)
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
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.
We've generally tried to not use
np.random
, both because of the seed issue, and because it can be difficult for people to track the numbers through the example. What do you think about replacing it withnp.arange(12).reshape(2,2,3)
? Or something similar.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 suggestions @max-sixty. I borrowed my example from the top-level
xarray.Dataset
examples, but your idea makes good sense. I'm quite new toxarray
and wanted to keep my example similar to others already in the docs. Happy to submit another change if you think that will improve things.Also thanks for pointing our https://github.com/max-sixty/pytest-accept. I'll take a look!
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.
Yes, we've been gradually going through the examples and changing them, but doc PRs are rarer than code (and so very much appreciated!), and we still have quite a few left over on
random
.If you're up for making the change that would be great. If you don't think you'll get to it, this is still a good improvement. Thanks @gregbehm !
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.
@max-sixty, I think working through the docs and adding examples will be a great way for me to learn
xarray
, so I'll put the change on my to-do list and try to get to it soon.One more noob question: how do we connect this PR with the issue that prompted it, #6336 so that can get closed?
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.
That would be great!
It used to be that saying "closes #6336" worked, but I've seen that not work at times. Often someone will just manually close it after merging...
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.
this does work, but only if you use exactly that spelling in markdown. Unfortunately, github displays urls to issues / PRs the same way, hence the confusion.
If it did work, "closes" will become some kind of help link (not sure what the official name is), and on the right you see a linked issue (section "development"). In general, I think you just have to make sure the issue is linked in that section for it to work.