What's New¶
v0.10.0 (unreleased)¶
New Features¶
Bug Fixes¶
-
Grid.get_metric(and the operations built on it, e.g.Grid.integrateandGrid.average) no longer emits spurious "Metric ... being interpolated ..."UserWarnings when an exact-position metric combination exists but is not the first candidate tried. The search now looks for an exact-position match across all candidate combinations before falling back to interpolation, and warns at most once. The returned metric is unchanged (#758). By Henri Drake. -
Axisnow raises aValueErrorimmediately if the same dimension name is assigned to more than one position (e.g.{'center': 'x', 'outer': 'x'}), rather than silently accepting the invalid configuration (#634). By Mike German.
Breaking Changes¶
- Removed the
periodicargument ofxgcm.Grid. Boundary behavior is now controlled exclusively by theboundaryargument. Migrate as follows:periodic=True→boundary="periodic";periodic=False→boundary="fill"(the previous implicit mapping); and the per-axis list formperiodic=["X"]→ a per-axis dict, e.g.boundary={"X": "periodic", "Y": "fill"}. Passingperiodic=now raises an informativeValueErrornaming the replacement.
The default boundary semantics have also changed: previously a Grid
constructed without any boundary specification defaulted to periodic along
every axis (silently wrapping), which was the root of several boundary-condition
bugs. Now, an axis with no boundary specified applies no boundary condition:
operations that require padding along such an axis raise an informative error
instead of silently wrapping. Pass boundary="periodic" to recover the old
wrap-around behavior. This makes the default explicitly non-periodic and fixes
cases where a declared non-periodic axis could still wrap.
(#746;
closes #195,
#509,
#604,
#624,
#625)
By Henri Drake.
Supersedes earlier work by Julius Busecke in
#626.
-
Removed the deprecated
keep_coordskeyword argument from grid operations (Grid.interp,Grid.diff,Grid.min,Grid.max,Grid.cumsum, etc.) and fromapply_as_grid_ufunc. The behavior is now always that formerly given bykeep_coords=True: coordinates compatible with the output (including non-dimension coordinates) are preserved. Note that this silently changes the default output ofGrid.interp,Grid.diff,Grid.min,Grid.max,Grid.cumsum,Grid.derivative, andGrid.cumint, which previously dropped non-dimension coordinates from the result and now retains them. Passingkeep_coords=now raises aValueError(#382, #745). By Henri Drake. -
Axisis no longer importable from the top-levelxgcmnamespace, making effective the removal announced in v0.9.0; internal use continues viaxgcm.axis.Axis(#405, #557, #743). By Henri Drake.
Internal Changes¶
-
Advertise Python 3.12 and 3.13 support by adding their
Programming Language :: Pythontrove classifiers, and drop the unusedfuturedependency (the package was never imported; only the stdlibfrom __future__is used) (#744). By Henri Drake. -
Migrate development workflow to Pixi (#691) By Nick Hodgskin.
-
Improve xgcm import speed by lazy-loading the transform module, reducing import time from 3.4s to 0.8s (#697) By Nick Hodgskin.
Documentation¶
-
Reword the "Metrics" note in
grid_ufuncs.mdto a stable, non-promissory statement: metrics are not automatically supplied to grid ufuncs, so pass any needed metric explicitly as an input (#744). By Henri Drake. -
Migrate documentation to mkdocs (#691) By Nick Hodgskin.
-
Document which environment runs the documentation notebooks (
transform.ipynb,grid_metrics.ipynb). The existingdocspixi environment now bundles Jupyter Lab and can be launched withpixi run notebooks, and the notebooks and contributor guide note the required dependencies (#667). -
xgcm now follows Intended Effort Versioning (EffVer); the policy is documented in the contributor guide and advertised by a README badge (#679, #680, #742). By Nick Hodgskin and Henri Drake.
Bugfixes¶
-
Respect the
fill_valuebound on the@as_grid_ufuncdecorator (or passed toGridUFunc). It was silently dropped inGridUFunc.__call__— only a call-timefill_valuetook effect, so a bound value fell through to theapply_as_grid_ufuncdefault of0. The bound value is now forwarded (and still overridable at call time), mirroring the other bound boundary kwargs (#652, #710). By Vincent Gao. -
Fix
xgcm.padding.pad(..., other_component=...)(and hence vectorGrid.diff/Grid.interp) silently ignoring the vector rotation when the component is passed as a bareDataArrayrather than a{axis_name: DataArray}dict. On aface_connectionsgrid the bare form padded the component scalar-style, so the halo across a rotated (axis-swapping) or reversed seam was wrong and no error was raised — e.g. on ECCO LLC90 the global convergence sum of the advective heat flux was-1.6e9(bare) versus0(dict). The bare form now recovers the component's axis from its own staggering and runs the same rotation/sign-flip logic as the dict form, giving identical output, and raises a clear error when the axis cannot be inferred (e.g. a cell-centre field) (#748). By Henri Drake. -
Fix
Grid.transform(..., method="conservative")falsely raisingNotImplementedError("not yet supported for multi-dimensional targets") when a 1-dimensional target was combined with an explicittarget_dimlonger than one character: the guard tested the length of the dimension name instead of the number of target dimensions (#741). By Henri Drake. -
Preserve the input DataArray's dimension order in the output of
apply_as_grid_ufunc(and theGrid.apply_as_grid_ufuncmethod). Previouslyxarray.apply_ufuncmoved the operated-on core dimension to the end and never moved it back, so an input with dims('tile', 'j', 'i')came back as('tile', 'i', 'j'). The output now follows the input ordering (with the core dim renamed in-place if it changes grid position) (#533). -
Grid operations (e.g.
Grid.interp,Grid.diff,Grid.cumsum) no longer drop or clobber non-core coordinates carried on the inputDataArray. Padding strips all coordinates and they were only restored from the grid's own dataset, so a coordinate that lived on the input but not on the grid (e.g. atimecoordinate) was lost, and a coordinate present on both was overwritten with the grid's (possibly stale) copy. Coordinates on non-core dimensions are now preserved from the input array (first input wins for repeated names), while the newly position-shifted core-dim coordinate still comes from the grid (#496, #575). -
Fix
TypeError: dict.copy() takes no keyword argumentswhen applying vector grid ufuncs (e.g.diff_2d_vector,interp_2d_vector) on grids without face connections. A vector component supplied as a{axis_name: DataArray}dict was forwarded unchanged byxgcm.padding.padto the basic padding routine_pad_basic(which expects aDataArray);padnow unpacks the innerDataArrayon the non-face-connection path, mirroring the existing face-connection path (#581). By Henri Drake. -
Fix
diff_2d_vector/interp_2d_vector(and the equivalent vector-componentGrid.diff/Grid.interp) on grids with face connections when a vector component is a dask array chunked into more than one chunk along its core dimension. Themap_overlappath now derives the output chunk spec from the padded, rechunked array, so face-connection padding that rechunks non-core dimensions no longer raisesValueError: Dimension 0 has 2 blocks, adjust_chunks specified with 1 blocks(#708). By Henri Drake. -
Fix non-deterministic, hash-seed-dependent halo values in face-connection padding that could yield incorrect results across a face-connection seam between runs (#713). By Henri Drake.
v0.9.0 (2025/08/20)¶
New Features¶
-
Methods for autoparsing of dataset metadata to construct a
xgcm.Gridclass have been added. Currently these include restructred functionality for the COMODO conventions (already in xgcm) and the addition of SGRID conventions (#109, #559). By Jack Atkinson. -
Vertical coordinate transformations are now also supported for multi-dimensional targets, for example a terrain-following (spatially varying) vertical coordinate. This feature currently only works with the linear interpolation method (#614, #642). By Nora Loose.
Breaking Changes¶
-
All computation methods on the
xgcm.Axisclass have been removed, in favour of using the corresponding methods on thexgcm.Gridobject. Thexgcm.Axisclass has also been removed from public API. (#405, #557). By Thomas Nicholas. -
All functionality for generating c-grid dimensions on incomplete datasets via
Grid.autogenerate, was removed (#557). By Julius Busecke.
Internal Changes¶
-
Switch CI environment setup to micromamba (#576, #577). By Julius Busecke.
-
pre-commit autoupdate frequency reduced (#563). By Julius Busecke.
Documentation¶
Bugfixes¶
-
Fix bug in
xgcm.transform.transformthat violated tracer conservation when using conservative interpolation in the presence of nans. (#635) By Julius Busecke. -
Fix bug in
xgcm.padding._maybe_rename_grid_positionswhere dimensions were assumed to have coordinate values leading to errors with ECCO data. (#531, #595, #597). By Julius Busecke. -
Remove remaining mentions of
extrapolateas boundary option (#602). By Julius Busecke. -
Fix broken docs build due to broken backwards compatibility in sphinx extensions (#631) By Julius Busecke.
-
Fix bug that did not allow to create grids with faceconnections if the face dimension was coordinate-less. (#616, #616). By Julius Busecke.
v0.8.1 (2022/11/22)¶
New Features¶
Breaking Changes¶
Internal Changes¶
- Rewrote cumsum to use a different code path from
apply_as_grid_ufuncinternally, which makes it less susceptible to subtle bugs like the one reported in #507. (#558). By Thomas Nicholas.
Documentation¶
- Improved error message to suggest rechunking to a single chunk when trying to perform disallowed operations along chunked core dims. By Thomas Nicholas.
Bugfixes¶
- Fix bug where chunked core dims of only a single chunk triggered errors. (#558, #518, #522) By Thomas Nicholas.
v0.8.0 (2022/06/14)¶
New Features¶
- Addition of logarithmic interpolation to transform (#483). By Jonathan Thielen.
Breaking Changes¶
Internal Changes¶
- Switching code linting to the pre-commit.ci service (#490). By Julius Busecke.
Documentation¶
- Fix 'suggest edits' button in docs (#512, #503). By Julius Busecke.
Bugfixes¶
- Fix formatting of the CITATION.cff file (#500). By Julius Busecke.
- Fix bug with cumsum when data chunked with dask. (#415, #507) By Thomas Nicholas.
v0.7.0 (2022/4/20)¶
New Features¶
-
Turn numpy-style ufuncs into grid-aware "grid-ufuncs" via new functions
apply_as_grid_ufuncandas_grid_ufunc. (#362, #344) By Thomas Nicholas. -
Padding of vector fields for complex topologies via a dictionary-like syntax has been added (#459). By Julius Busecke.
Breaking Changes¶
- Removed the
extrapolateboundary option (#470). By Thomas Nicholas.
Internal Changes¶
- All computation methods on the
Gridobject are now re-routed throughapply_as_grid_ufunc. By Thomas Nicholas.
Documentation¶
-
Switch to pangeo-book-scheme (#482). By Julius Busecke.
-
Add CITATION.cff file (#450). By Julius Busecke.
v0.6.1 (2022/02/15)¶
Documentation¶
- Switch RTD build to use mamba for increased speed and reduced memory useage (#401). By Julius Busecke.
Internal Changes¶
-
Switch CI to use mamba (#412, #398). By Julius Busecke.
-
Add deprecation warnings for future changes in the API (#409,#411). By Julius Busecke.
v0.6.0 (2021/11/03)¶
New Features¶
-
Grid.set_metricsnow enables adding metrics to a grid object (#336, #199). By Dianne Deauna under the SIParCS internship. -
Grid.get_metricrefactored, and now incorporatesGrid.interp_liketo allow for automatic interpolation of missing metrics from available values on surrounding positions (#345, #354). By Dianne Deauna.[^siparcs] -
Grid.set_metricsenables overwriting of previously assigned metrics to a grid object, and allows for multiple metrics on the same axes (must be different dimensions) (#351, #199). By Dianne Deauna.[^siparcs] -
Grid.interp_likeenables users to interpolate arrays onto the grid positions of another array, and can specify boundary conditions and fill values (#234 , #343, #350). By Dianne Deauna.[^siparcs] -
Better input checking when creating a grid object avoids creating grid positions on dataset coordinates which are not 1D (#208, #358). By Julius Busecke.
[^siparcs]: under the SIParCS internship
Breaking Changes¶
- Drop support for Python 3.6 (#360, #361). By Julius Busecke.
Documentation¶
- Added documentation on boundary conditions (#273, #325) By Romain Caneill.
- Updated metrics documentation for new methods in Grid Metrics. By Dianne Deauna.[^siparcs]
Internal Changes¶
- Fixed metrics tests so some tests that previously did not run now do run, and refactored the metrics tests. By Tom Nicholas.[^siparcs]
-
Enabled type checking on the repository with mypy. By Tom Nicholas.[^siparcs]
-
Removed dependency on docrep, which as docrep 2.7 used a GPL licence, implicitly changed the license of xGCM. Therefore xGCM now has a valid MIT license, instead of accidentally being a GPL licence as it was before. (#308, #384) By Tom Nicholas.[^siparcs]
Deprecations¶
- The
keep_coordskwarg is now deprecated, and will be removed in the next version. (#382) By Tom Nicholas.[^siparcs]
v0.5.2 (2021/5/27)¶
Bug fixes¶
- Raise more useful errors when datasets are provided as arguments to grid.transform (#329, #328). By Julius Busecke.
Documentation¶
-
Updated Realistic Data examples in Transforming Vertical Coordinates (#322) By Dianne Deauna.[^siparcs]
-
Migrated model example notebooks to xgcm-examples which integrates with pangeo gallery (#294) By Julius Busecke.
v0.5.1 (2020/10/16)¶
Bug fixes¶
- Add support for older numba versions (<0.49) (#263, #262). By Navid Constantinou.
v0.5.0 (2020/9/28)¶
New Features¶
Grid.transformandAxis.transformnow enable 1-dimensional coordinate transformation (#205, #222). By Ryan Abernathey and Julius Busecke.
Bug fixes¶
-
More reliable handling of missing values in
Grid.average. Missing values between data and metrics do not have to be aligned by the user anymore. (#259). By Julius Busecke. -
Remove outdated
example_notebooksfolder (#244, #243). By Nikolay Koldunov and Julius Busecke.
v0.4.0 (2020/9/2)¶
New Features¶
-
Support for keeping compatible coordinates in most Grid operations (#186). By Aurélien Ponte.
-
Support for specifying default
boundaryandfill_valuein thexgcm.Gridconstructor. Default values can be overridden in individual method calls (e.g.Grid.interp) as usual. By Deepak Cherian.
Bug fixes¶
- Fix for parsing fill_values as dictionary (#218). By Julius Busecke.
Internal Changes¶
- Complete refactor of the CI to github actions (#214). By Julius Busecke.
v0.3.0 (31 January 2020)¶
This release adds support for model grid metrics , bug fixes and extended documentation.
Breaking changes¶
New Features¶
-
Support for 'grid-aware' average and cumsum using
Grid.averageandGrid.cumsum(#162). By Julius Busecke. -
Support for 'grid-aware' integration using
Grid.integrate(#130). By Julius Busecke.
Bug fixes¶
-
Fix for broken stale build (#155). By Julius Busecke.
-
Fixed bug in handling of grid metrics. (#136). By Ryan Abernathey.
-
Fixed bug in
Grid.derivative(#132). By Timothy Smith.
Documentation¶
-
Added docs for
Grid.derivative(#163) By Timothy Smith. -
Add binderized examples (#141). By Ryan Abernathey.
-
Simplify example notebooks (#140). By Ryan Abernathey.
-
Execute example notebook during doc build (#138). By Ryan Abernathey.
-
Added contributor guide to docs (#137). By Julius Busecke.
Internal Changes¶
-
Added GitHub Action to publish xgcm to PyPI on release (#170). By Anderson Banihirwe.
-
Reorganized environment names for CI (#139). By Julius Busecke.
-
Added automatic code formatting via black (#131). By Julius Busecke.
v0.2.0 (21 March 2019)¶
Changes not documented for this release
v0.1.0 (13 July 2014)¶
Changes not documented for this release
Initial release.