Skip to content

56 replace DeisaArray wrapper by Xarray#58

Open
JAuriac wants to merge 6 commits intodeisa-project:mainfrom
JAuriac:56_Xarray
Open

56 replace DeisaArray wrapper by Xarray#58
JAuriac wants to merge 6 commits intodeisa-project:mainfrom
JAuriac:56_Xarray

Conversation

@JAuriac
Copy link
Copy Markdown
Collaborator

@JAuriac JAuriac commented May 6, 2026

Close #56

@JAuriac
Copy link
Copy Markdown
Collaborator Author

JAuriac commented May 6, 2026

We may want to consider "t" as an additional dimension rather than a metadata (which is how its handled currently)

@JAuriac
Copy link
Copy Markdown
Collaborator Author

JAuriac commented May 6, 2026

The last commit moved "t" from a metadata (through "attrs") to a dimension (through "coords"), while adding complexity and inconsistencies of access, so we may want to rollback

attrs["t"] returns an int, it is simple and explicit
coords["t"] requires a .item() to extract an int, and access patterns are inconsistent (arr.coords["t"].item() or arr[-1].coords["t"] or arr.coords["t"][-1].item()) depending on whether the array has been indexed first

The following is a comparison :

def window_callback(window: list[xr.DataArray]):
    window[-1].attrs["t"]
    window[-1].data
def window_callback(window: list[xr.DataArray]):
    windowWithT = xr.concat(window, dim="t")
    windowWithT.coords['t'][-1].item()
    windowWithT[-1].data

@JAuriac JAuriac requested a review from benoitmartin88 May 6, 2026 13:24
@JAuriac JAuriac marked this pull request as ready for review May 6, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace DeisaArray wrapper by Xarray

1 participant