Skip to content

Commit 66be46d

Browse files
committed
dev
2 parents 9c22660 + 36613f4 commit 66be46d

6 files changed

Lines changed: 30 additions & 8 deletions

File tree

Changelog.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ Version NEXTVERSION
88
``h5py_options`` parameter
99
(https://github.com/NCAS-CMS/cf-python/issues/924)
1010
* New default backend for netCDF-4 in `cf.read` that allows parallel
11-
reading: (https://github.com/NCAS-CMS/cf-python/issues/912)
11+
reading: ``h5netcdf-pyfive``
12+
(https://github.com/NCAS-CMS/cf-python/issues/912)
1213
* New optional backend for netCDF-3 in `cf.read` that allows parallel
1314
reading: ``netcdf_file``
1415
(https://github.com/NCAS-CMS/cf-python/issues/912)
1516
* Changed dependency: ``cfdm>=1.13.1.0, <1.13.2.0``
1617
* Fix for subspacing with cyclic `cf.wi` and `cf.wo` arguments
1718
(https://github.com/NCAS-CMS/cf-python/issues/887)
1819

19-
----
20-
2120
Version 3.19.0
2221
--------------
2322

cf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@
153153
H5netcdfArray,
154154
NetCDFArray,
155155
NetCDF4Array,
156-
Netcdf_fileArray,
157156
PyfiveArray,
158157
PointTopologyArray,
159158
RaggedContiguousArray,
160159
RaggedIndexedArray,
161160
RaggedIndexedContiguousArray,
161+
ScipyNetcdfFileArray,
162162
SubsampledArray,
163163
UMArray,
164164
ZarrArray,

cf/cfimplementation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
GatheredArray,
3535
H5netcdfArray,
3636
NetCDF4Array,
37-
Netcdf_fileArray,
3837
PointTopologyArray,
3938
PyfiveArray,
4039
RaggedContiguousArray,
4140
RaggedIndexedArray,
4241
RaggedIndexedContiguousArray,
42+
ScipyNetcdfFileArray,
4343
SubsampledArray,
4444
ZarrArray,
4545
)
@@ -149,7 +149,7 @@ def set_construct(self, parent, construct, axes=None, copy=True, **kwargs):
149149
GatheredArray=GatheredArray,
150150
H5netcdfArray=H5netcdfArray,
151151
NetCDF4Array=NetCDF4Array,
152-
Netcdf_fileArray=Netcdf_fileArray,
152+
ScipyNetcdfFileArray=ScipyNetcdfFileArray,
153153
PointTopologyArray=PointTopologyArray,
154154
PyfiveArray=PyfiveArray,
155155
Quantization=Quantization,
@@ -208,7 +208,7 @@ def implementation():
208208
'GatheredArray': cf.data.array.gatheredarray.GatheredArray,
209209
'H5netcdfArray': cf.data.array.h5netcdfarray.H5netcdfArray,
210210
'NetCDF4Array': cf.data.array.netcdf4array.NetCDF4Array,
211-
'Netcdf_fileArray': cf.data.array.netcdf_filearray.Netcdf_fileArray,
211+
'ScipyNetcdfFileArray': cf.data.array.scipynetcdffilearray.ScipyNetcdfFileArray,
212212
'PointTopologyArray': <class 'cf.data.array.pointtopologyarray.PointTopologyArray'>,
213213
'PyfiveArray': cf.data.array.pyfivearray.PyfiveArray,
214214
'Quantization': cf.quantization.Quantization,

cf/data/array/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from .h5netcdfarray import H5netcdfArray
77
from .netcdfarray import NetCDFArray
88
from .netcdf4array import NetCDF4Array
9-
from .netcdf_filearray import Netcdf_fileArray
9+
from .scipynetcdffilearray import ScipyNetcdfFileArray
1010
from .pointtopologyarray import PointTopologyArray
1111
from .pyfivearray import PyfiveArray
1212
from .raggedcontiguousarray import RaggedContiguousArray
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import cfdm
2+
3+
from ...mixin_container import Container
4+
5+
6+
class ScipyNetcdfFileArray(
7+
Container,
8+
cfdm.ScipyNetcdfFileArray,
9+
):
10+
"""A netCDF-3 array accessed with `scipy.io.netcdf_file`.
11+
12+
.. versionadded:: NEXTVERSION
13+
14+
"""

cf/test/test_read_write.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,15 @@ def test_write_h5py_options(self):
10391039
f1 = cf.read(tmpfile1)[0]
10401040
self.assertTrue(f1.equals(f0))
10411041

1042+
def test_read_netcdf_file(self):
1043+
"""Test cf.read for differing the netcdf_file backend."""
1044+
f = self.f0
1045+
1046+
cf.write(f, tmpfile, fmt="NETCDF3_CLASSIC")
1047+
g = cf.read(tmpfile, netcdf_backend="netcdf_file")[0]
1048+
1049+
self.assertTrue(g.equals(f))
1050+
10421051

10431052
if __name__ == "__main__":
10441053
print("Run date:", datetime.datetime.now())

0 commit comments

Comments
 (0)