Skip to content

Commit bd23749

Browse files
committed
update dependcies - particular numpy<2 and dask<=2024.7.2
1 parent 6dea879 commit bd23749

File tree

4 files changed

+38
-15
lines changed

4 files changed

+38
-15
lines changed

Changelog.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ version NEXTVERSION
4343
(https://github.com/NCAS-CMS/cf-python/issues/828)
4444
* New dependency: ``h5netcdf>=1.3.0``
4545
* New dependency: ``h5py>=3.10.0``
46-
* New dependency: ``s3fs>=2024.2.0``
46+
* New dependency: ``s3fs>=2024.6.0``
47+
* Changed dependency: ``numpy>=1.15,<2.0``
4748
* Changed dependency: ``1.11.2.0<=cfdm<1.11.3.0``
4849
* Changed dependency: ``cfunits>=3.3.7``
50+
* Changed dependency: ``dask>=2024.6.0,<=2024.7.1``
4951

5052
----
5153

cf/__init__.py

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
raise ImportError(_error0 + str(error1))
124124

125125
try:
126-
import numpy
126+
import numpy as np
127127
except ImportError as error1:
128128
raise ImportError(_error0 + str(error1))
129129

@@ -191,10 +191,11 @@
191191

192192
# Check the version of numpy
193193
_minimum_vn = "1.22"
194-
if Version(numpy.__version__) < Version(_minimum_vn):
195-
raise RuntimeError(
196-
f"Bad numpy version: cf requires numpy>={_minimum_vn}. "
197-
f"Got {numpy.__version__} at {numpy.__file__}"
194+
_maximum_vn = "2.0"
195+
if not Version(_minimum_vn) <= Version(np.__version__) < Version(_maximum_vn):
196+
raise ValueError(
197+
"Bad numpy version: cf requires _minimum_vn}<=numpy<{_maximum_vn}. "
198+
f"Got {np.__version__} at {np.__file__}"
198199
)
199200

200201
# Check the version of cfunits
@@ -208,15 +209,31 @@
208209
# Check the version of cfdm
209210
_minimum_vn = "1.11.2.0"
210211
_maximum_vn = "1.11.3.0"
211-
_cfdm_version = Version(cfdm.__version__)
212-
if not Version(_minimum_vn) <= _cfdm_version < Version(_maximum_vn):
212+
if (
213+
not Version(_minimum_vn)
214+
<= Version(cfdm.__version__)
215+
< Version(_maximum_vn)
216+
):
213217
raise RuntimeError(
214218
f"Bad cfdm version: cf requires {_minimum_vn}<=cfdm<{_maximum_vn}. "
215-
f"Got {_cfdm_version} at {cfdm.__file__}"
219+
f"Got {cfdm.__version__} at {cfdm.__file__}"
216220
)
217221

218222
# Check the version of dask
219223

224+
# Check the version of numpy
225+
_minimum_vn = "2024.6.1"
226+
_maximum_vn = "2024.7.1"
227+
if (
228+
not Version(_minimum_vn)
229+
<= Version(dask.__version__)
230+
<= Version(_maximum_vn)
231+
):
232+
raise ValueError(
233+
"Bad dask version: cf requires {_minimum_vn}<=dask<={_maximum_vn}. "
234+
f"Got {dask.__version__} at {dask.__file__}"
235+
)
236+
220237
# Check the version of Python
221238
_minimum_vn = "3.8.0"
222239
if Version(platform.python_version()) < Version(_minimum_vn):
@@ -233,6 +250,8 @@
233250
f"Got {scipy.__version__} at {scipy.__file__}"
234251
)
235252

253+
del _minimum_vn, _maximum_vn
254+
236255
from .constructs import Constructs
237256

238257
from .mixin import Coordinate

docs/source/installation.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,11 @@ Required
192192

193193
* `Python <https://www.python.org/>`_, 3.8.0 or newer.
194194

195-
* `numpy <https://pypi.org/project/numpy/>`_, 1.22.0 or newer.
195+
* `numpy <http://www.numpy.org>`_, versions 1.15 up to, but not
196+
including, 2.0.
196197

197-
* `dask <https://pypi.org/project/dask/>`_, 2022.12.1 or newer.
198+
* `dask <https://pypi.org/project/dask>`_, versions 2024.6.0 to
199+
2024.7.1 inclusive.
198200

199201
* `netCDF4 <https://pypi.org/project/netcdf4/>`_, 1.6.5 or newer.
200202

@@ -206,7 +208,7 @@ Required
206208

207209
* `h5py <https://pypi.org/project/h5py>`_, version 3.10.0 or newer.
208210

209-
* `s3fs <https://pypi.org/project/s3fs>`_, version 2024.2.0 or newer.
211+
* `s3fs <https://pypi.org/project/s3fs>`_, version 2024.6.0 or newer.
210212

211213
* `scipy <https://pypi.org/project/scipy>`_, version 1.10.0 or newer.
212214

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
netCDF4>=1.6.5
22
cftime>=1.6.2
3-
numpy>=1.22
3+
numpy>=1.22,<2.0
44
cfdm>=1.11.2.0, <1.11.3.0
55
psutil>=0.6.0
66
cfunits>=3.3.7
7-
dask>=2024.4.0
7+
dask>=2024.6.0,<=2024.7.1
88
packaging>=20.0
99
scipy>=1.10.0
1010
h5netcdf>=1.3.0
1111
h5py>=3.10.0
12-
s3fs>=2024.2.0
12+
s3fs>=2024.6.0

0 commit comments

Comments
 (0)