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

Docstring examples #7881

Merged
merged 35 commits into from
Jul 4, 2023
Merged

Docstring examples #7881

merged 35 commits into from
Jul 4, 2023

Conversation

harshitha1201
Copy link
Contributor

@harshitha1201 harshitha1201 commented May 29, 2023

Added docstring examples to some string methods (#6793)

[ ]Closes #xxxx
[ ]Tests added
[ ]User visible changes (including notable bug fixes) are documented in whats-new.rst
[ ]New functions/methods are listed in api.rst

xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
}
)

argmin_indices = dataset.argmin(dim='student')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can add text explaining this

Can also feed the resulting indexes back in to .isel (that's why this argmin method exists)

Might be good to think of other example datasets for which you would be really interested in the index.

Copy link
Member

@TomNicholas TomNicholas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @harshitha1201 - some changes needed here still before we can merge this.

xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
xarray/core/dataset.py Outdated Show resolved Hide resolved
Co-authored-by: Tom Nicholas <thomas.nicholas@columbia.edu>
Copy link
Member

@TomNicholas TomNicholas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you @harshitha1201 !

The two final (easy) things to do are:

  1. Merge recent changes from main into this branch (you can do that locally or by clicking the button on this PR),
  2. Add a short note to doc/whats-new.rst describing what you changed. Just something like "Added examples to docstrings of Dataset.isel, Dataset.argmin..., by Harshitha Diddidge". You should copy the format of other entries in the whatsnew file, including the number of this pull request. Also you can format the names of the methods you changes like this :py:meth:`Dataset.isel`

@dcherian
Copy link
Contributor

dcherian commented Jul 5, 2023

Thanks @harshitha1201 Nice work!

@harshitha1201 harshitha1201 deleted the add-examples branch July 6, 2023 14:57
dcherian added a commit to dcherian/xarray that referenced this pull request Jul 16, 2023
* main:
  Remove hue_style from plot1d docstring (pydata#7925)
  Add new what's new section (pydata#7986)
  Release summary for v2023.07.0 (pydata#7979)
  Improve explanation in example "Working with Multidimensional Coordinates" (pydata#7984)
  Fix typo in zarr.py (pydata#7983)
  Examples added to docstrings  (pydata#7936)
  [pre-commit.ci] pre-commit autoupdate (pydata#7973)
  Skip broken tests on python 3.11 and windows (pydata#7972)
  Use another repository for upstream testing (pydata#7970)
  Move absolute path finder from open_mfdataset to own function (pydata#7968)
  ensure no forward slashes in names for HDF5-based backends (pydata#7953)
  Chunked array docs (pydata#7951)
  [pre-commit.ci] pre-commit autoupdate (pydata#7959)
  manually unshallow the repository on RTD (pydata#7961)
  Update minimum version of typing extensions in pre-commit (pydata#7960)
  Docstring examples (pydata#7881)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants