h5netcdf 1.3.0__py3-none-any.whl → 1.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of h5netcdf might be problematic. Click here for more details.
- h5netcdf/__init__.py +1 -0
- h5netcdf/_version.py +2 -2
- h5netcdf/attrs.py +2 -2
- h5netcdf/core.py +554 -87
- h5netcdf/dimensions.py +6 -9
- h5netcdf/legacyapi.py +26 -5
- h5netcdf/tests/test_h5netcdf.py +607 -63
- {h5netcdf-1.3.0.dist-info → h5netcdf-1.4.0.dist-info}/METADATA +26 -27
- h5netcdf-1.4.0.dist-info/RECORD +16 -0
- {h5netcdf-1.3.0.dist-info → h5netcdf-1.4.0.dist-info}/WHEEL +1 -1
- h5netcdf-1.3.0.dist-info/RECORD +0 -16
- {h5netcdf-1.3.0.dist-info → h5netcdf-1.4.0.dist-info}/AUTHORS.txt +0 -0
- {h5netcdf-1.3.0.dist-info → h5netcdf-1.4.0.dist-info}/LICENSE +0 -0
- {h5netcdf-1.3.0.dist-info → h5netcdf-1.4.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: h5netcdf
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: netCDF4 via h5py
|
|
5
5
|
Author-email: Stephan Hoyer <shoyer@gmail.com>, Kai Mühlbauer <kmuehlbauer@wradlib.org>
|
|
6
6
|
Maintainer-email: h5netcdf developers <devteam@h5netcdf.org>
|
|
@@ -45,6 +45,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
45
45
|
Classifier: Programming Language :: Python :: 3.9
|
|
46
46
|
Classifier: Programming Language :: Python :: 3.10
|
|
47
47
|
Classifier: Programming Language :: Python :: 3.11
|
|
48
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
48
49
|
Classifier: Topic :: Scientific/Engineering
|
|
49
50
|
Requires-Python: >=3.9
|
|
50
51
|
Description-Content-Type: text/x-rst
|
|
@@ -53,8 +54,8 @@ License-File: AUTHORS.txt
|
|
|
53
54
|
Requires-Dist: h5py
|
|
54
55
|
Requires-Dist: packaging
|
|
55
56
|
Provides-Extra: test
|
|
56
|
-
Requires-Dist: netCDF4
|
|
57
|
-
Requires-Dist: pytest
|
|
57
|
+
Requires-Dist: netCDF4; extra == "test"
|
|
58
|
+
Requires-Dist: pytest; extra == "test"
|
|
58
59
|
|
|
59
60
|
h5netcdf
|
|
60
61
|
========
|
|
@@ -138,32 +139,32 @@ design is an adaptation of h5py to the netCDF data model. For example:
|
|
|
138
139
|
import h5netcdf
|
|
139
140
|
import numpy as np
|
|
140
141
|
|
|
141
|
-
with h5netcdf.File(
|
|
142
|
+
with h5netcdf.File("mydata.nc", "w") as f:
|
|
142
143
|
# set dimensions with a dictionary
|
|
143
|
-
f.dimensions = {
|
|
144
|
+
f.dimensions = {"x": 5}
|
|
144
145
|
# and update them with a dict-like interface
|
|
145
146
|
# f.dimensions['x'] = 5
|
|
146
147
|
# f.dimensions.update({'x': 5})
|
|
147
148
|
|
|
148
|
-
v = f.create_variable(
|
|
149
|
+
v = f.create_variable("hello", ("x",), float)
|
|
149
150
|
v[:] = np.ones(5)
|
|
150
151
|
|
|
151
152
|
# you don't need to create groups first
|
|
152
153
|
# you also don't need to create dimensions first if you supply data
|
|
153
154
|
# with the new variable
|
|
154
|
-
v = f.create_variable(
|
|
155
|
+
v = f.create_variable("/grouped/data", ("y",), data=np.arange(10))
|
|
155
156
|
|
|
156
157
|
# access and modify attributes with a dict-like interface
|
|
157
|
-
v.attrs[
|
|
158
|
+
v.attrs["foo"] = "bar"
|
|
158
159
|
|
|
159
160
|
# you can access variables and groups directly using a hierarchical
|
|
160
161
|
# keys like h5py
|
|
161
|
-
print(f[
|
|
162
|
+
print(f["/grouped/data"])
|
|
162
163
|
|
|
163
164
|
# add an unlimited dimension
|
|
164
|
-
f.dimensions[
|
|
165
|
+
f.dimensions["z"] = None
|
|
165
166
|
# explicitly resize a dimension and all variables using it
|
|
166
|
-
f.resize_dimension(
|
|
167
|
+
f.resize_dimension("z", 3)
|
|
167
168
|
|
|
168
169
|
Notes:
|
|
169
170
|
|
|
@@ -184,22 +185,23 @@ The legacy API is designed for compatibility with `netCDF4-python`_. To use it,
|
|
|
184
185
|
.. code-block:: python
|
|
185
186
|
|
|
186
187
|
import h5netcdf.legacyapi as netCDF4
|
|
188
|
+
|
|
187
189
|
# everything here would also work with this instead:
|
|
188
190
|
# import netCDF4
|
|
189
191
|
import numpy as np
|
|
190
192
|
|
|
191
|
-
with netCDF4.Dataset(
|
|
192
|
-
ds.createDimension(
|
|
193
|
-
v = ds.createVariable(
|
|
193
|
+
with netCDF4.Dataset("mydata.nc", "w") as ds:
|
|
194
|
+
ds.createDimension("x", 5)
|
|
195
|
+
v = ds.createVariable("hello", float, ("x",))
|
|
194
196
|
v[:] = np.ones(5)
|
|
195
197
|
|
|
196
|
-
g = ds.createGroup(
|
|
197
|
-
g.createDimension(
|
|
198
|
-
g.createVariable(
|
|
199
|
-
v = g[
|
|
198
|
+
g = ds.createGroup("grouped")
|
|
199
|
+
g.createDimension("y", 10)
|
|
200
|
+
g.createVariable("data", "i8", ("y",))
|
|
201
|
+
v = g["data"]
|
|
200
202
|
v[:] = np.arange(10)
|
|
201
|
-
v.foo =
|
|
202
|
-
print(ds.groups[
|
|
203
|
+
v.foo = "bar"
|
|
204
|
+
print(ds.groups["grouped"].variables["data"])
|
|
203
205
|
|
|
204
206
|
The legacy API is designed to be easy to try-out for netCDF4-python users, but it is not an
|
|
205
207
|
exact match. Here is an incomplete list of functionality we don't include:
|
|
@@ -222,9 +224,6 @@ h5py implements some features that do not (yet) result in valid netCDF files:
|
|
|
222
224
|
|
|
223
225
|
- Data types:
|
|
224
226
|
- Booleans
|
|
225
|
-
- Complex values
|
|
226
|
-
- Non-string variable length types
|
|
227
|
-
- Enum types
|
|
228
227
|
- Reference types
|
|
229
228
|
- Arbitrary filters:
|
|
230
229
|
- Scale-offset filters
|
|
@@ -239,11 +238,11 @@ when creating a file:
|
|
|
239
238
|
.. code-block:: python
|
|
240
239
|
|
|
241
240
|
# avoid the .nc extension for non-netcdf files
|
|
242
|
-
f = h5netcdf.File(
|
|
241
|
+
f = h5netcdf.File("mydata.h5", invalid_netcdf=True)
|
|
243
242
|
...
|
|
244
243
|
|
|
245
244
|
# works with the legacy API, too, though compression options are not exposed
|
|
246
|
-
ds = h5netcdf.legacyapi.Dataset(
|
|
245
|
+
ds = h5netcdf.legacyapi.Dataset("mydata.h5", invalid_netcdf=True)
|
|
247
246
|
...
|
|
248
247
|
|
|
249
248
|
In such cases the `_NCProperties` attribute will not be saved to the file or be removed
|
|
@@ -281,7 +280,7 @@ phony dimensions according to `netCDF`_ behaviour.
|
|
|
281
280
|
.. code-block:: python
|
|
282
281
|
|
|
283
282
|
# mimic netCDF-behaviour for non-netcdf files
|
|
284
|
-
f = h5netcdf.File(
|
|
283
|
+
f = h5netcdf.File("mydata.h5", mode="r", phony_dims="sort")
|
|
285
284
|
...
|
|
286
285
|
|
|
287
286
|
Note, that this iterates once over the whole group-hierarchy. This has affects
|
|
@@ -292,7 +291,7 @@ to group access time. The created phony dimension naming will differ from
|
|
|
292
291
|
|
|
293
292
|
.. code-block:: python
|
|
294
293
|
|
|
295
|
-
f = h5netcdf.File(
|
|
294
|
+
f = h5netcdf.File("mydata.h5", mode="r", phony_dims="access")
|
|
296
295
|
...
|
|
297
296
|
|
|
298
297
|
.. rubric:: Footnotes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
h5netcdf/__init__.py,sha256=Y0EBCcmlJctwl1kCmj7yLijTVy9AioBTr2091vInAtw,456
|
|
2
|
+
h5netcdf/_version.py,sha256=R8-T9fmURjcuoxYpHTAjyNAhgJPDtI2jogCjqYYkfCU,411
|
|
3
|
+
h5netcdf/attrs.py,sha256=4IvV4ULLWkz4igFsvu9S2LB745wgUKrIdIuSeO5kpX8,3581
|
|
4
|
+
h5netcdf/core.py,sha256=5rjGhCTIHZKJ_yMHyvZHIPndPr1Em9CVzyiV5F9H3E8,62511
|
|
5
|
+
h5netcdf/dimensions.py,sha256=2g0p9DOAC0hhQ94spIAjWeKC1qyhzzO0s15xCFYSscM,7803
|
|
6
|
+
h5netcdf/legacyapi.py,sha256=MIZlht5Ad4hDFF1Slz2vXmKkgbv7Fhhf2YwNIe16Lfk,7682
|
|
7
|
+
h5netcdf/utils.py,sha256=6E-HAIE0ONMyL4SxI3oUyQvrDgDWifR5EPde91V9rT0,674
|
|
8
|
+
h5netcdf/tests/conftest.py,sha256=cI0BXKM_LRdsQ8vAl3vJ0r1ShGpNUfj2xOH6KmgfZHw,5034
|
|
9
|
+
h5netcdf/tests/pytest.ini,sha256=ruJxrLdCIA4bCPVuPQjxsLSlvVxuIsIakK6iQOmz-ak,107
|
|
10
|
+
h5netcdf/tests/test_h5netcdf.py,sha256=ufQ4NSwrJlu2hQkVLzrkyntqWXpxSxRmBYoSiR_PMB4,106640
|
|
11
|
+
h5netcdf-1.4.0.dist-info/AUTHORS.txt,sha256=LTKzUh9o4Wc_oT3aFC48cyDCCP6tdm6VEV_6RrNy4uo,272
|
|
12
|
+
h5netcdf-1.4.0.dist-info/LICENSE,sha256=Xer1Jg8iL_n9Da0xt0S99blk6tsg9tee_JdgH1rWTjs,1505
|
|
13
|
+
h5netcdf-1.4.0.dist-info/METADATA,sha256=PMKsb8Ehgh8_d-MMmVvBNP8tN6ugP54gagEAqjYTUos,13366
|
|
14
|
+
h5netcdf-1.4.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
15
|
+
h5netcdf-1.4.0.dist-info/top_level.txt,sha256=Fb_KIpOE6MBqjSvxV1Ay7oYce1mdmQ1pO9JQJPDeGqg,9
|
|
16
|
+
h5netcdf-1.4.0.dist-info/RECORD,,
|
h5netcdf-1.3.0.dist-info/RECORD
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
h5netcdf/__init__.py,sha256=PHxu5IhN7HMvn1E7RU4Rrg_aAnOwz9NP343vHBg4OWs,455
|
|
2
|
-
h5netcdf/_version.py,sha256=HGwtpza1HCPtlyqElUvIyH97K44TO13CYiYVZNezQ1M,411
|
|
3
|
-
h5netcdf/attrs.py,sha256=KsFmU0TWfLX2DyMzAvTITU8v_EBpmJuf7aCuuiXkp3E,3581
|
|
4
|
-
h5netcdf/core.py,sha256=iC1fwpG6sHnwvlLzF1kTn3fmEwB27CwIHB0TgC4fuFE,45646
|
|
5
|
-
h5netcdf/dimensions.py,sha256=wEi2puREyGpTYAAfcUzpbhYVxtOZhr85xcz3ZUAtByw,7826
|
|
6
|
-
h5netcdf/legacyapi.py,sha256=5oGc9GVP0m9-6K6HLfaTKO2SoBkYeWX-wdIIL3u__Yg,7109
|
|
7
|
-
h5netcdf/utils.py,sha256=6E-HAIE0ONMyL4SxI3oUyQvrDgDWifR5EPde91V9rT0,674
|
|
8
|
-
h5netcdf/tests/conftest.py,sha256=cI0BXKM_LRdsQ8vAl3vJ0r1ShGpNUfj2xOH6KmgfZHw,5034
|
|
9
|
-
h5netcdf/tests/pytest.ini,sha256=ruJxrLdCIA4bCPVuPQjxsLSlvVxuIsIakK6iQOmz-ak,107
|
|
10
|
-
h5netcdf/tests/test_h5netcdf.py,sha256=OawSuldKEP7fTbul7EpVvTVMoWH0pQsUXc3gZJo59sg,84498
|
|
11
|
-
h5netcdf-1.3.0.dist-info/AUTHORS.txt,sha256=LTKzUh9o4Wc_oT3aFC48cyDCCP6tdm6VEV_6RrNy4uo,272
|
|
12
|
-
h5netcdf-1.3.0.dist-info/LICENSE,sha256=Xer1Jg8iL_n9Da0xt0S99blk6tsg9tee_JdgH1rWTjs,1505
|
|
13
|
-
h5netcdf-1.3.0.dist-info/METADATA,sha256=Y6MCNXk14aGtX0OqQRafW2oh5GDGni4F0WAcfKgSCJ0,13393
|
|
14
|
-
h5netcdf-1.3.0.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
|
|
15
|
-
h5netcdf-1.3.0.dist-info/top_level.txt,sha256=Fb_KIpOE6MBqjSvxV1Ay7oYce1mdmQ1pO9JQJPDeGqg,9
|
|
16
|
-
h5netcdf-1.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|