Skip to content

Add step to Cube rolling windows - #7232

Closed
Kkkakania wants to merge 1 commit into
SciTools:mainfrom
Kkkakania:agent/rolling-window-step
Closed

Add step to Cube rolling windows#7232
Kkkakania wants to merge 1 commit into
SciTools:mainfrom
Kkkakania:agent/rolling-window-step

Conversation

@Kkkakania

Copy link
Copy Markdown

Description

Adds a step argument to Cube.rolling_window, matching the strided-window support already provided by iris.util.rolling_window. The default remains step=1, so existing calls keep their current behavior.

The step is applied consistently to cube shape selection, data windows, and numeric/string coordinates. Invalid non-positive steps now raise the same clear error as the utility function.

Fixes #7217.

Checklist

  • Included a What's New entry
  • Incorporated type hints in changed code
  • Added tests for data, dataless cubes, coordinates, and validation
  • Checked that no benchmark update is needed
  • Updated the public method docstring
  • Checked that no dependency update is needed

Validation

  • pytest lib/iris/tests/unit/cube/test_Cube.py -q (496 passed, 34 skipped)
  • pytest lib/iris/tests/test_analysis.py::TestRollingWindow -q (9 passed)
  • pre-commit run --files lib/iris/cube.py lib/iris/tests/unit/cube/test_Cube.py changelog/7232.feature.rst

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@trexfeathers

Copy link
Copy Markdown
Contributor

Sorry @Kkkakania, this clashes with the fix proposed by the original requester (#7236), so I'm unable to merge it. Although judging by your contributions graph, and the pending CLA signature, I'm guessing you don't need us to bolster your GitHub CV.

Thanks for getting in touch!

@Kkkakania

Copy link
Copy Markdown
Author

Understood, thanks for letting me know. Closing this in favor of #7236 makes sense.

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.

Add step argument to Cube.rolling_window

3 participants