Skip to content

Add step to Cube rolling windows - #7232

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Add step argument to Cube.rolling_window

2 participants