Skip to content

Commit c6ef954

Browse files
committed
dev
1 parent 242c57c commit c6ef954

File tree

7 files changed

+21
-23
lines changed

7 files changed

+21
-23
lines changed

cf/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,28 +173,27 @@
173173
)
174174

175175
# Check the version of netCDF4
176-
_minimum_vn = "1.6.5"
176+
_minimum_vn = "1.7.2"
177177
if Version(netCDF4.__version__) < Version(_minimum_vn):
178178
raise RuntimeError(
179179
f"Bad netCDF4 version: cf requires netCDF4>={_minimum_vn}. "
180180
f"Got {netCDF4.__version__} at {netCDF4.__file__}"
181181
)
182182

183183
# Check the version of cftime
184-
_minimum_vn = "1.6.2"
184+
_minimum_vn = "1.6.4"
185185
if Version(cftime.__version__) < Version(_minimum_vn):
186186
raise RuntimeError(
187187
f"Bad cftime version: cf requires cftime>={_minimum_vn}. "
188188
f"Got {cftime.__version__} at {cftime.__file__}"
189189
)
190190

191191
# Check the version of numpy
192-
_minimum_vn = "1.22"
193-
_maximum_vn = "2.0"
194-
if not Version(_minimum_vn) <= Version(np.__version__) < Version(_maximum_vn):
192+
_minimum_vn = "2.0.0"
193+
if not Version(_minimum_vn) < Version(np.__version__):
195194
raise ValueError(
196-
"Bad numpy version: cf requires _minimum_vn}<=numpy<{_maximum_vn}. "
197-
f"Got {np.__version__} at {np.__file__}"
195+
"Bad numpy version: cfdm requires {_minimum_vn}<=numpy. "
196+
f"Got {Version(np.__version__)} at {np.__file__}"
198197
)
199198

200199
# Check the version of cfunits

cf/data/collapse/dask_collapse.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,6 @@ def cf_sample_size_chunk(x, dtype="i8", computing_meta=False, **kwargs):
858858
return x
859859

860860
x = cfdm_to_memory(x)
861-
862861
if np.ma.isMA(x):
863862
N = chunk.sum(np.ones_like(x, dtype=dtype), **kwargs)
864863
else:

cf/mixin/fielddomain.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,7 @@ def _point_not_in_cell(nodes_x, nodes_y, point):
692692
if ind is not None:
693693
mask_component_shape = []
694694
masked_subspace_size = 1
695-
# TODONUMPY2: https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword
696-
ind = np.array(ind, copy=False)
695+
ind = np.array(ind)
697696

698697
for i, (axis, start, stop) in enumerate(
699698
zip(canonical_axes, ind.min(axis=1), ind.max(axis=1))

cf/mixin/propertiesdata.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ class PropertiesData(Properties):
4949

5050
_special_properties = ("units", "calendar")
5151

52-
def __array__(self, *dtype):
53-
"""Returns a numpy array representation of the data."""
54-
data = self.get_data(None)
55-
if data is not None:
56-
return data.__array__(*dtype)
57-
58-
raise ValueError(f"{self.__class__.__name__} has no data")
52+
# def __array__(self, *dtype):
53+
# """Returns a numpy array representation of the data."""
54+
# data = self.get_data(None)
55+
# if data is not None:
56+
# return data.__array__(*dtype)#
57+
#
58+
# raise ValueError(f"{self.__class__.__name__} has no data")
5959

6060
def __contains__(self, value):
6161
"""Called to implement membership test operators.

cf/test/test_Data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2621,7 +2621,7 @@ def test_Data_percentile_median(self):
26212621
a1 = np.nanpercentile(filled, q, keepdims=keepdims)
26222622
mask = np.isnan(a1)
26232623
if mask.any():
2624-
a1 = np.ma.masked_where(mask, a1, copy=False)
2624+
a1 = np.ma.masked_where(mask, a1)
26252625

26262626
b1 = d.percentile(q, squeeze=not keepdims)
26272627
self.assertEqual(b1.shape, a1.shape)
@@ -3613,6 +3613,7 @@ def test_Data_sample_size(self):
36133613
b = np.ma.asanyarray(b)
36143614

36153615
e = d.sample_size(axes=axis, squeeze=True)
3616+
36163617
e = np.ma.array(e.array)
36173618

36183619
self.assertTrue((e.mask == b.mask).all())

cf/test/test_Field.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2550,7 +2550,7 @@ def test_Field_percentile(self):
25502550
# TODO: add loop to check get same shape and close enough data
25512551
# for every possible axis combo (see also test_Data_percentile).
25522552

2553-
def test_Field__aaa_grad_xy(self):
2553+
def test_Field_grad_xy(self):
25542554
f = cf.example_field(0)
25552555

25562556
# theta=0 is at the north pole

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
netCDF4>=1.6.5
2-
cftime>=1.6.2
3-
numpy>=1.22,<2.0
1+
netCDF4>=1.7.2
2+
cftime>=1.6.4
3+
numpy>=2.0.0
44
cfdm>=1.12.0.0, <1.12.1.0
55
psutil>=0.6.0
66
cfunits>=3.3.7
77
dask>=2024.6.0,<=2024.7.1
88
packaging>=20.0
99
scipy>=1.10.0
1010
h5netcdf>=1.3.0
11-
h5py>=3.10.0
11+
h5py>=3.12.1
1212
s3fs>=2024.6.0

0 commit comments

Comments
 (0)