Skip to content

Commit f48ba29

Browse files
MAINT: Bump Pixi version and unpin XGCM (#2767)
1 parent 88482c8 commit f48ba29

4 files changed

Lines changed: 13 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ jobs:
5454
persist-credentials: false
5555
- uses: Parcels-code/pixi-lock/create-and-cache@38495788b79a5ff26009aecc15daa9a8310b8832 # v0.1.0
5656
id: pixi-lock
57-
with:
58-
pixi-version: v0.70.2
5957
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
6058
with:
6159
name: pixi-lock

.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ build:
77
jobs:
88
create_environment:
99
- asdf plugin add pixi
10-
- asdf install pixi 0.70.2
11-
- asdf global pixi 0.70.2
10+
- asdf install pixi latest
11+
- asdf global pixi latest
1212
install:
1313
- pixi install -e docs
1414
build:

pixi.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ exclude-newer = "5d" # security pre-caution against compromised packages
44
preview = ["pixi-build"]
55
channels = ["conda-forge"]
66
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
7-
requires-pixi = ">=0.67.0,!=0.68.0,<0.71.0"
7+
requires-pixi = ">=0.72.0"
88

99
[package]
1010
name = "parcels"
1111
version = "dynamic" # dynamic versioning needs better support in pixi https://github.com/prefix-dev/pixi/issues/2923#issuecomment-2598460666 . Putting `version = "dynamic"` here for now until pixi recommends something else.
1212

1313
[package.build]
14-
backend = { name = "pixi-build-python", version = "0.4.*" }
14+
backend = { name = "pixi-build-python", version = "0.7.*" }
1515

1616
[package.host-dependencies]
1717
setuptools = "*"
@@ -30,7 +30,7 @@ holoviews = ">=1.22.0" # https://github.com/prefix-dev/rattler-build/issues/2326
3030
uxarray = ">=2026.04.1"
3131
dask = ">=2024.5.1"
3232
zarr = ">=3"
33-
xgcm = { git = "https://github.com/xgcm/xgcm", rev = "532a3c567c475cbe192f49b9961f8117806bbfb7" } # TODO: Switch to release version after release is cut
33+
xgcm = { git = "https://github.com/xgcm/xgcm", rev = "master" } # TODO: Switch to release version after release is cut
3434
cf_xarray = ">=0.8.6"
3535
cftime = ">=1.6.3"
3636
pooch = ">=1.8.0"
@@ -61,7 +61,7 @@ pyarrow = "20.0.*"
6161
uxarray = "==2026.04.1"
6262
dask = "2024.6.*"
6363
zarr = "3.0.*"
64-
xgcm = { version = "0.9.*", channel = "conda-forge" }
64+
xgcm = { git = "https://github.com/xgcm/xgcm", rev = "master" } # TODO: Switch to release version after release is cut
6565
cf_xarray = "0.10.*"
6666
cftime = "1.6.*"
6767
pooch = "1.8.*"

src/parcels/_core/xgrid.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections.abc import Hashable, Sequence
22
from dataclasses import dataclass
33
from functools import cached_property
4-
from typing import Any, Literal, cast
4+
from typing import TYPE_CHECKING, Any, Literal, cast
55

66
import numpy as np
77
import numpy.typing as npt
@@ -17,20 +17,23 @@
1717
from parcels._sgrid.accessor import _get_dim_to_axis_mapping
1818
from parcels._sgrid.core import SGRID_PADDING_TO_XGCM_POSITION
1919

20+
if TYPE_CHECKING:
21+
import xgcm.axis
22+
2023
_FIELD_DATA_ORDERING: Sequence[ptyping.XgcmAxisDirection] = "TZYX"
2124
_XGRID_AXES_ORDERING: Sequence[ptyping.XgridAxis] = "ZYX"
2225

23-
_DEFAULT_XGCM_KWARGS: dict[str, Any] = {"periodic": False}
26+
_DEFAULT_XGCM_KWARGS: dict[str, Any] = {"padding": "fill"}
2427

2528

26-
def get_cell_count_along_dim(ds: xr.Dataset, axis: xgcm.Axis) -> int:
29+
def get_cell_count_along_dim(ds: xr.Dataset, axis: xgcm.axis.Axis) -> int:
2730
first_coord = list(axis.coords.items())[0]
2831
_, coord_var = first_coord
2932

3033
return ds[coord_var].size - 1
3134

3235

33-
def get_time(ds: xr.Dataset, axis: xgcm.Axis) -> npt.NDArray:
36+
def get_time(ds: xr.Dataset, axis: xgcm.axis.Axis) -> npt.NDArray:
3437
return ds[axis.coords["center"]].values
3538

3639

0 commit comments

Comments
 (0)