Skip to content

Load no-time vars as numpy arrays in to_windowed_arrays#2752

Open
erikvansebille wants to merge 4 commits into
Parcels-code:mainfrom
erikvansebille:fix-2751-windowed-arrays
Open

Load no-time vars as numpy arrays in to_windowed_arrays#2752
erikvansebille wants to merge 4 commits into
Parcels-code:mainfrom
erikvansebille:fix-2751-windowed-arrays

Conversation

@erikvansebille

@erikvansebille erikvansebille commented Jul 14, 2026

Copy link
Copy Markdown
Member

Description

This PR fixes #2751, by calling a .compute() on variables that have a mockT dimension (i.e. no time), thereby speeding up the fieldset.to_windowed_arrays() method.

It also loads lon and lat explicitly, which are not dimensions but variables in a curvilinear grid.

Finally, it adds information about rhetorical backend (Numpy, Dask or WindowedArray) to each field in fieldset.describe()

Checklist

AI Disclosure

None

To show which fields are WindowedArrays, which are Dask and which are NumPy
Comment thread tests/test_fieldset.py
| V_wind | Field | 1 | XLinear(...) |
| UV_wind | VectorField | 1 | XLinear_Velocity(...) |
| constant_field | Field | 2 | XConstantField(...) |
| Name | Type | Grid number | Interp method / value | Backend |

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@VeckoTheGecko, what do you think of the name of this extra column? Is "Backend" indeed the best term to use?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think 'Parcels backend' would be better as to not conflate with xarrays use of the word

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

fieldset.to_windowed_arrays is slow on CROCO tutorial - not loading time-invariant variables

2 participants