Skip to content

Commit

Permalink
compatibility with numpy>=2.0 and + (#452)
Browse files Browse the repository at this point in the history
* make numpy >= 2.0 compatible

* update environment on sciserver-catalog

* remove pin from numpy - it should still match the minimal dependency requirement as xarray
  • Loading branch information
Mikejmnez authored Oct 18, 2024
1 parent 054aebe commit e83d557
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4

Expand Down
3 changes: 2 additions & 1 deletion binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ dependencies:
- xoak
- cartopy
- esmpy
- intake=0.7
- intake-xarray
- geopy
- xesmf > 0.6.3
- xesmf>0.6.3
- esmf
- xgcm
- Ipython
Expand Down
3 changes: 2 additions & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ dependencies:
- distributed
- bottleneck
- netCDF4
- numpy
- xarray
- xoak
- cartopy
- scipy
- intake
- intake=0.7
- intake-xarray
- geopy
- xesmf > 0.6.3
Expand Down
4 changes: 2 additions & 2 deletions oceanspy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def densjmd95(s, t, p):
if isinstance(var, _xr.DataArray):
var = var.astype("float")
else:
var = _np.asfarray(var)
var = _np.asarray(var, _np.float64)

# coefficients nonlinear equation of state in pressure coordinates for
# 1. density of fresh water at p = 0
Expand Down Expand Up @@ -681,7 +681,7 @@ def densmdjwf(s, t, p):
if isinstance(var, _xr.DataArray):
var = var.astype("float")
else:
var = _np.asfarray(var)
var = _np.asarray(var, _np.float64)

# coefficients nonlinear equation of state in pressure coordinates for
eosMDJWFnum = [
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ 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",
"Topic :: Scientific/Engineering"
]
dependencies = [
"dask",
"xarray >= 0.14.1",
"xarray >= 2024.7.0",
"xgcm >= 0.2.0",
"shapely"
]
Expand All @@ -25,7 +25,7 @@ dynamic = ["version"]
license = {file = "LICENSE"}
name = "oceanspy"
readme = "README.rst"
requires-python = ">=3.9"
requires-python = ">=3.10"

[tool.coverage.run]
branch = true
Expand Down
7 changes: 4 additions & 3 deletions sciserver_catalogs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Oceanography
channels:
- conda-forge
dependencies:
- python=3.10
- python=3.11
- dask
- numpy
- distributed
- bottleneck
- netCDF4
Expand All @@ -12,7 +13,7 @@ dependencies:
- cartopy
- esmpy
- geopy
- xesmf > 0.6.3
- xesmf>0.6.3
- esmf
- xgcm
- Ipython
Expand Down Expand Up @@ -54,7 +55,7 @@ dependencies:
- imageio
- pre-commit
- xmitgcm
- intake
- intake=0.7
- intake-xarray
- pip:
- black-nb
Expand Down

0 comments on commit e83d557

Please sign in to comment.