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

Enhance Cube slicing docs #5735

Merged
merged 23 commits into from
Apr 16, 2024
Merged

Conversation

hsteptoe
Copy link
Contributor

@hsteptoe hsteptoe commented Feb 7, 2024

🚀 Pull Request

Description

Some relatively minor enhancements to the docs for the cube.slices() and cube.slices_over().

  • Made some of the wording clearer
  • Modified examples to use iris-sample-data
  • Added example of using dimension indices for slicing.

Consult Iris pull request check list

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.77%. Comparing base (7c313ff) to head (13abd1a).
Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5735   +/-   ##
=======================================
  Coverage   89.76%   89.77%           
=======================================
  Files          93       93           
  Lines       22982    22995   +13     
  Branches     5006     5011    +5     
=======================================
+ Hits        20630    20643   +13     
  Misses       1622     1622           
  Partials      730      730           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hsteptoe
Copy link
Contributor Author

hsteptoe commented Feb 9, 2024

N.B. I've aimed for judicious use of # doctest: SKIP directive to deal with cases where example output would be too long to be useful, or where I seem to get stuck in a linter-modified-test-fail loop with cube printing

@hsteptoe hsteptoe marked this pull request as ready for review February 9, 2024 17:52
@CLAassistant
Copy link

CLAassistant commented Apr 4, 2024

CLA assistant check
All committers have signed the CLA.

@trexfeathers trexfeathers self-requested a review April 4, 2024 13:24
@trexfeathers trexfeathers self-assigned this Apr 4, 2024
Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

Thanks @hsteptoe, and sorry for the delay.

This is a really valuable addition for an area that I personally regularly forget - examples are gold!

I felt it was important to get the doctests working, to make sure the code continues working in perpetuity. I was able to test and iterate the formatting locally using this handy command (run within an Iris development environment, within the /docs/src directory):

sphinx-build -b doctest -d _build/doctrees   . _build/doctest generated/api/iris.cube.rst

The suggestions work, and pass the pre-commit checks.

docs/src/whatsnew/latest.rst Outdated Show resolved Hide resolved
docs/src/whatsnew/latest.rst Outdated Show resolved Hide resolved
lib/iris/cube.py Outdated Show resolved Hide resolved
lib/iris/cube.py Outdated Show resolved Hide resolved
lib/iris/cube.py Outdated Show resolved Hide resolved
lib/iris/cube.py Outdated Show resolved Hide resolved
lib/iris/cube.py Outdated Show resolved Hide resolved
lib/iris/cube.py Outdated Show resolved Hide resolved
lib/iris/cube.py Outdated Show resolved Hide resolved
lib/iris/cube.py Show resolved Hide resolved
lib/iris/cube.py Outdated Show resolved Hide resolved
@trexfeathers trexfeathers merged commit 6cc7c3d into SciTools:main Apr 16, 2024
21 checks passed
@trexfeathers
Copy link
Contributor

Brilliant, thanks again!

tkknight added a commit to tkknight/iris that referenced this pull request Apr 18, 2024
* upstream/main:
  Enhance Cube slicing docs (SciTools#5735)
  Bump scitools/workflows from 2024.04.0 to 2024.04.1 (SciTools#5914)
  [pre-commit.ci] pre-commit autoupdate (SciTools#5913)
  Revert "Updated environment lockfiles (SciTools#5911)" (SciTools#5912)
  Shapefile user guide typos (SciTools#5759)
  Updated environment lockfiles (SciTools#5911)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏁 Done
Development

Successfully merging this pull request may close these issues.

3 participants