Skip to content

Commit 7eedf45

Browse files
Merge branch 'v4-dev' into implement_ei_in_search
2 parents 29a56f0 + 6b267ed commit 7eedf45

13 files changed

Lines changed: 28 additions & 1375 deletions

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies: #! Keep in sync with [tool.pixi.dependencies] in pyproject.toml
1818
- scikit-learn
1919
- zarr>=2.11.0,!=2.18.0,<3
2020
- uxarray>=2025.3.0
21+
- xgcm>=0.9.0
2122
- pooch
2223

2324
# Notebooks

parcels/fieldset.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
import numpy as np
88
import xarray as xr
9+
import xgcm
910

10-
from parcels import xgcm
1111
from parcels._core.utils.time import get_datetime_type_calendar
1212
from parcels._core.utils.time import is_compatible as datetime_is_compatible
1313
from parcels._typing import Mesh
@@ -130,14 +130,12 @@ def add_constant_field(self, name: str, value, mesh: Mesh = "flat"):
130130
correction for zonal velocity U near the poles.
131131
2. flat: No conversion, lat/lon are assumed to be in m.
132132
"""
133-
da = xr.DataArray(
134-
data=np.full((1, 1, 1, 1), value),
135-
)
136-
grid = XGrid(xgcm.Grid(da))
133+
ds = xr.Dataset({name: (["time", "lat", "lon", "depth"], np.full((1, 1, 1, 1), value))})
134+
grid = XGrid(xgcm.Grid(ds))
137135
self.add_field(
138136
Field(
139137
name,
140-
da,
138+
ds[name],
141139
grid,
142140
interp_method=None, # TODO : Need to define an interpolation method for constants
143141
)

parcels/xgcm/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

parcels/xgcm/comodo.py

Lines changed: 0 additions & 128 deletions
This file was deleted.

0 commit comments

Comments
 (0)