Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Cache conda
Expand Down
5 changes: 3 additions & 2 deletions ci/environment-py3.11.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test_env_intake-axds
name: test-env-xroms
channels:
- conda-forge
dependencies:
Expand All @@ -15,11 +15,12 @@ dependencies:
- numpy
- pooch
- xarray
- xgcm=0.8.1
# - xgcm >= 0.8.1
##############
- pytest
- pip:
- xgcm >= 0.8.1
# - xgcm >= 0.8.1
- codecov
- pytest-cov
- coverage[toml]
8 changes: 4 additions & 4 deletions ci/environment-py3.9.yml → ci/environment-py3.12.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: test_env_intake-axds
name: test-env-xroms
channels:
- conda-forge
dependencies:
- python=3.9
- python=3.12
############## These will have to be adjusted to your specific project
- cartopy
- cf_xarray
Expand All @@ -15,11 +15,11 @@ dependencies:
- numpy
- pooch
- xarray
# - xgcm >= 0.8.1
- xgcm=0.8.1
##############
- pytest
- pip:
- xgcm >= 0.8.1
# - xgcm >= 0.8.1
- codecov
- pytest-cov
- coverage[toml]
8 changes: 4 additions & 4 deletions ci/environment-py3.10.yml → ci/environment-py3.13.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: test_env_intake-axds
name: test-env-xroms
channels:
- conda-forge
dependencies:
- python=3.10
- python=3.13
############## These will have to be adjusted to your specific project
- cartopy
- cf_xarray
Expand All @@ -15,11 +15,11 @@ dependencies:
- numpy
- pooch
- xarray
# - xgcm >= 0.8.1
- xgcm=0.8.1
##############
- pytest
- pip:
- xgcm >= 0.8.1
# - xgcm >= 0.8.1
- codecov
- pytest-cov
- coverage[toml]
7 changes: 4 additions & 3 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.10
- python=3.12
# If your docs code examples depend on other packages add them here
- cartopy
- cf_xarray
Expand All @@ -13,14 +13,15 @@ dependencies:
- esmpy=>8.5.0 # https://github.com/esmf-org/esmf/issues/140
- matplotlib-base
- netcdf4
- numpy <1.24 # https://github.com/numba/numba/issues/8615#issuecomment-1360792615
- numpy #<1.24 # https://github.com/numba/numba/issues/8615#issuecomment-1360792615
- numba >= 0.49 # required by xgcm
- pip
- pooch
- requests
- scipy
- xarray
- xcmocean
- xgcm >= 0.8.1
- xgcm=0.8.1
- xesmf # don't install if on windows
- xroms
# These are needed for the docs themselves
Expand Down
5 changes: 5 additions & 0 deletions docs/whats_new.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# What's New

## v0.6.2 (August 27, 2025)
* catching and ignoring a bunch of warnings from `xgcm`, but still staying with `xgcm` `v0.8.1` until I can update this code to match.
* updating CI test versions to 3.11, 3.12, 3.13


## v0.6.1 (October 28, 2024)
* Correction in a few built-in calculations of u/v grid to rho-grid interpolations of u and v velocities (currently `speed` and `_uv2eastnorth`). In these cases, we need to fill nans with zeros so that the masked locations in the velocity fields are not fully brought forward into the rho mask but are instead interpolated over. By making them 0, they are calculated into the mask\_rho positions by combining them with neighboring cells. If this wasn't done, the fact that they are masked would supersede the neighboring cells and they would be masked in mask\_rho. This needs to be done anytime the velocities are moved from their native grids to the rho or other grids to preserve their locations around masked cells.

Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ dependencies:
- esmpy>=8.5.0 # https://github.com/esmf-org/esmf/issues/140
- matplotlib-base
- netcdf4
- numpy <1.24 # https://github.com/numba/numba/issues/8615#issuecomment-1360792615
- numpy #<1.24 # https://github.com/numba/numba/issues/8615#issuecomment-1360792615
- numba >= 0.49 # required by xgcm
- pip
- pooch
- requests
- xarray
- xcmocean
- xgcm >= 0.8.1
- xgcm=0.8.1
- xesmf # don't install if on windows
# - pip: # install from github to get recent PRs I contributed
# - git@github.com:xarray-contrib/cf-xarray.git
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ numba >= 0.49
numpy
pooch
xarray
xgcm >= 0.8.1
xgcm == 0.8.1
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
# Dont change this one
License :: OSI Approved :: MIT License

Expand All @@ -80,7 +80,7 @@ install_requires =
numpy
pooch
xarray
xgcm >= 0.8.1
xgcm==0.8.1
setup_requires=
setuptools_scm
python_requires = >=3.6
Expand Down
28 changes: 18 additions & 10 deletions xroms/interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ def isoslice(var, iso_values, xgrid, iso_array=None, axis="Z"):
key = "z"

# perform interpolation
transformed = xgrid.transform(var, axis, iso_values, target_data=iso_array)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
transformed = xgrid.transform(var, axis, iso_values, target_data=iso_array)

if key not in transformed.coords:
transformed = transformed.assign_coords({key: iso_array})
Expand All @@ -287,9 +289,11 @@ def isoslice(var, iso_values, xgrid, iso_array=None, axis="Z"):
iso_array = iso_array.cf.isel(Z=0).drop_vars(
iso_array.cf["Z"].name, errors="ignore"
)
transformedlon = xgrid.transform(
var[lonkey], axis, iso_values, target_data=iso_array
)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
transformedlon = xgrid.transform(
var[lonkey], axis, iso_values, target_data=iso_array
)
transformed = transformed.assign_coords({lonkey: transformedlon})

transformed[lonkey].attrs["standard_name"] = "longitude"
Expand All @@ -308,9 +312,11 @@ def isoslice(var, iso_values, xgrid, iso_array=None, axis="Z"):
iso_array = iso_array.cf.isel(Z=0).drop_vars(
iso_array.cf["Z"].name, errors="ignore"
)
transformedlat = xgrid.transform(
var[latkey], axis, iso_values, target_data=iso_array
)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
transformedlat = xgrid.transform(
var[latkey], axis, iso_values, target_data=iso_array
)
transformed = transformed.assign_coords({latkey: transformedlat})

transformed[latkey].attrs["standard_name"] = "latitude"
Expand All @@ -319,9 +325,11 @@ def isoslice(var, iso_values, xgrid, iso_array=None, axis="Z"):
zkey = var.cf["vertical"].name

if zkey not in transformed.coords:
transformedZ = xgrid.transform(
var[zkey], axis, iso_values, target_data=iso_array
)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
transformedZ = xgrid.transform(
var[zkey], axis, iso_values, target_data=iso_array
)
transformed = transformed.assign_coords({zkey: transformedZ})

transformed[zkey].attrs["positive"] = "up"
Expand Down
Loading
Loading