Repository navigation
Remove WindowedArray backend in favour of ChunkCachedArray - #3096
Draft
fluidnumericsJoe wants to merge 1 commit into
Draft
fluidnumericsJoe wants to merge 1 commit into
fluidnumericsJoe wants to merge 1 commit into
Conversation
Drop the WindowedArray rolling time-window cache and its plumbing: - delete parcels._core._windowed_array - remove ModelData.to_windowed_arrays and the field_data() indirection; Field.data now reads model.data directly - drop the WindowedArray branch from FieldSet.describe and the interpolator type hints FieldSet.to_windowed_arrays() is kept for one release as a deprecated alias: it emits a FutureWarning and forwards to to_chunk_cached_arrays(). max_levels is accepted but ignored. Tests: remove test_windowed_array.py, port its dask-vs-numpy advection parity tests (structured + unstructured, forward + backward) into test_backends.py for the Dask and ChunkCachedArray backends, and add a test for the deprecation stub. Docs: user guides now call to_chunk_cached_arrays(); the Windowed Arrays option is removed from the performance guide.
fluidnumericsJoe
commented
Dec 2, 2026
| for model in self.models: | ||
| model.to_windowed_arrays(max_levels=max_levels) | ||
| return self | ||
| warnings.warn( |
Contributor
Author
There was a problem hiding this comment.
@erikvansebille - I know we talked about potentially just removing this from the public API straight away. Thinking on this a bit and I think redirecting to .to_chunk_cached_arrays() with a warning for the next immediate release is ideal. This gives folks some time to adjust any of their code.
Member
There was a problem hiding this comment.
I agree, let's keep this as a warning. Perhaps you can add a typing_extensions.deprecated.
See also the last bullet point in https://docs.parcels-code.org/en/latest/development/index.html#code-guidelines
fluidnumericsJoe
commented
Dec 2, 2026
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Removes the
WindowedArraybackend.ChunkCachedArray(FieldSet.to_chunk_cached_arrays()) is now the recommended way to speed up dask-backed FieldSets.Source
parcels/_core/_windowed_array.py.ModelData.to_windowed_arrays()and thefield_data()indirection it needed;Field.datanow readsmodel.data[name]directly.WindowedArraybranch fromFieldSet.describe()and from the interpolator type hints.Deprecation
FieldSet.to_windowed_arrays()stays for one release as a deprecated alias. It emits aFutureWarningand callsto_chunk_cached_arrays(), so existing scripts keep a cached backend instead of silently falling back to plain dask.max_levelsis accepted but ignored.Tests
tests/test_windowed_array.py. Its dask-vs-NumPy advection parity tests (structured and unstructured grids, forward and backward in time) move totests/test_backends.py, where they now run for both theDaskandChunkCachedArraybackends.WindowedArrayfrom the backend parametrization intest_backends.pyand fromtest_fieldset_describe_backends.Docs
to_chunk_cached_arrays()instead ofto_windowed_arrays().Testing notes
test_fieldset_describe_backends, which fails on the plain-Dask time interval (expects 2000-01-12, gets 2000-01-27). It fails the same way on unmodifiedmain, so it looks like a stale tutorial-data cache on my machine; CI will confirm.tests/test_convert.pywas not run locally (xromsmissing).Checklist
mainfor normal development,v3-supportfor v3 support)AI Disclosure
[This is Claude Code on behalf of Joe Schoonover]
🤖 Generated with Claude Code