Skip to content

Accept "values" as an unstructured grid dimension by default - #12

Merged
matschaer merged 2 commits into
mainfrom
feat/values-unstructured-dim
Nov 12, 2026
Merged

matschaer merged 2 commits into
mainfrom
feat/values-unstructured-dim

Conversation

@matschaer

@matschaer matschaer commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Adds values to the default unstructured grid dimension names (GRID_PROCESS__data_model__grid__unstructured_dim): ["cell", "points", "values"]. cfgrib and earthkit-data name the dimension of non-regular GRIB grids values (e.g. ICON open data), which until now had to be renamed before interpolation (as in example notebook 04: .rename_dims(values="cell")). values is last, so cell or points still win if a dataset has several of these dimensions.

No clash with the .values attribute of xarray objects. grid-process accesses dimensions by name only (ds[name], dicts, **{dim: ...}), never as attributes, and ds.values / da.values stay the xarray method and numpy property. Checked:

  • Synthetic data: all 13 methods of interp2poi and interp2grid give identical results with cell and values, both without a coordinate (as cfgrib gives it) and with an index coordinate.
  • Real data: ICON-CH2 T_2M from open data ({'values': 283876}, read with earthkit) gives identical results without renaming for:
    • interp2poi with nearest, idw and linear;
    • interp2grid with nearest and idw to LV95 at 1 km and 5 km.

No breaking change. The only risk: a regular grid that also has an unrelated dimension named values would be taken as unstructured (the unstructured names are checked before y/x). cfgrib does not produce this, and the environment variable still overrides the list.

Example notebook 04 no longer renames the ICON-CH2 dimension values to cell, and is rerun with a new IFS-HRES run (2026-11-12 06 UTC) and ICON-CH2 run (2026-11-11 18 UTC).

Related issue

None.


Checklist

  • Code is well documented and follows project conventions (linted, formatted)
  • CHANGELOG updated (if applicable)
  • License header is added to all new files (no new files)
  • For a new contributors, their name has been added to the AUTHORS file (not a new contributor)
  • No sensitive data or secrets are exposed
  • Unit tests added covering the new code (test_get_flat_dim: values detected without a coordinate; test_interp2poi: results with values identical to cell; 262 tests pass, ruff and mypy clean, pylint 10.00)

Mathieu Schaer and others added 2 commits November 12, 2026 15:10
cfgrib and earthkit-data name the dimension of non-regular GRIB grids
"values" (e.g. ICON open data), which had to be renamed before
interpolation. grid-process accesses dimensions by name only, so the
name does not clash with the .values attribute of xarray objects:
interp2poi and interp2grid give identical results on ICON-CH2 T_2M with
"values" or "cell".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ICON-CH2 dimension "values" given by earthkit-data is now one of the
default unstructured dimension names: no rename to "cell" needed. Rerun
with a new IFS-HRES and ICON-CH2 run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matschaer
matschaer merged commit 3e9baa8 into main Nov 12, 2026
3 checks passed
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.

1 participant