Skip to content

Fix default fill for Dataset statistical regridding - #80

Open
Boulea7 wants to merge 1 commit into
xarray-contrib:mainfrom
Boulea7:fix/dataset-stat-default-fill
Open

Boulea7 wants to merge 1 commit into
xarray-contrib:mainfrom
Boulea7:fix/dataset-stat-default-fill

Conversation

@Boulea7

@Boulea7 Boulea7 commented Dec 2, 2026

Copy link
Copy Markdown

Summary

Fixes #79.

When an uncovered target cell needs the default fill, inspect each Dataset variable's dtype. This keeps the same padding as applying the operation to each DataArray. Signed and unsigned integers still warn when they need floating-point NaN padding. Timedelta results keep NaT, including when returned as a DataArray.

Testing

  • Reproduced the reported grid on version 0.4.2 and main. The patched Dataset matches the individual DataArray and explicit NaN controls.
  • The repository test and doctest suite passes 75 tests, with one optional xESMF skip and one existing expected failure.
  • Verified eager and Dask results, mixed dtypes, an explicit fill, and the integer warning. The built wheel also passes the reported example.
  • Formatting and lint for the changed files pass. Full-tree Ruff and mypy reproduce the same existing diagnostics on main.

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.

regrid.stat fails on a Dataset when the target grid extends beyond the source (AttributeError: 'Dataset' object has no attribute 'dtype')

1 participant