h5netcdf 1.5.0__py3-none-any.whl → 1.6.1__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/_version.py +9 -4
- h5netcdf/core.py +6 -1
- h5netcdf/tests/test_h5netcdf.py +30 -0
- {h5netcdf-1.5.0.dist-info → h5netcdf-1.6.1.dist-info}/METADATA +1 -1
- h5netcdf-1.6.1.dist-info/RECORD +16 -0
- {h5netcdf-1.5.0.dist-info → h5netcdf-1.6.1.dist-info}/WHEEL +1 -1
- h5netcdf-1.5.0.dist-info/RECORD +0 -16
- {h5netcdf-1.5.0.dist-info → h5netcdf-1.6.1.dist-info}/AUTHORS.txt +0 -0
- {h5netcdf-1.5.0.dist-info → h5netcdf-1.6.1.dist-info}/LICENSE +0 -0
- {h5netcdf-1.5.0.dist-info → h5netcdf-1.6.1.dist-info}/top_level.txt +0 -0
h5netcdf/_version.py
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
# file generated by
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
2
|
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
|
|
5
|
+
|
|
3
6
|
TYPE_CHECKING = False
|
|
4
7
|
if TYPE_CHECKING:
|
|
5
|
-
from typing import Tuple
|
|
8
|
+
from typing import Tuple
|
|
9
|
+
from typing import Union
|
|
10
|
+
|
|
6
11
|
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
7
12
|
else:
|
|
8
13
|
VERSION_TUPLE = object
|
|
@@ -12,5 +17,5 @@ __version__: str
|
|
|
12
17
|
__version_tuple__: VERSION_TUPLE
|
|
13
18
|
version_tuple: VERSION_TUPLE
|
|
14
19
|
|
|
15
|
-
__version__ = version = '1.
|
|
16
|
-
__version_tuple__ = version_tuple = (1,
|
|
20
|
+
__version__ = version = '1.6.1'
|
|
21
|
+
__version_tuple__ = version_tuple = (1, 6, 1)
|
h5netcdf/core.py
CHANGED
|
@@ -608,6 +608,11 @@ class BaseVariable(BaseObject):
|
|
|
608
608
|
class Variable(BaseVariable):
|
|
609
609
|
@property
|
|
610
610
|
def chunks(self):
|
|
611
|
+
if self.shape == ():
|
|
612
|
+
# In HSDS, the layout can be chunked even for scalar datasets, but with only a single chunk.
|
|
613
|
+
# Return None for scalar datasets since they shall be handled as non-chunked.
|
|
614
|
+
assert self._h5ds.chunks in (None, (), (1,))
|
|
615
|
+
return None
|
|
611
616
|
return self._h5ds.chunks
|
|
612
617
|
|
|
613
618
|
@property
|
|
@@ -1505,7 +1510,7 @@ class File(Group):
|
|
|
1505
1510
|
self._close_h5file = True
|
|
1506
1511
|
try:
|
|
1507
1512
|
if isinstance(path, str):
|
|
1508
|
-
if (
|
|
1513
|
+
if kwargs.get("driver") == "h5pyd" or (
|
|
1509
1514
|
path.startswith(("http://", "https://", "hdf5://"))
|
|
1510
1515
|
and "driver" not in kwargs
|
|
1511
1516
|
):
|
h5netcdf/tests/test_h5netcdf.py
CHANGED
|
@@ -2743,3 +2743,33 @@ def test_hsds(hsds_up):
|
|
|
2743
2743
|
|
|
2744
2744
|
with h5netcdf.File(fname, "r") as ds:
|
|
2745
2745
|
print(ds["test"]["var1"])
|
|
2746
|
+
|
|
2747
|
+
|
|
2748
|
+
def test_h5pyd_driver(hsds_up):
|
|
2749
|
+
# test that specifying driver='h5pyd' forces use of h5pyd
|
|
2750
|
+
if without_h5pyd:
|
|
2751
|
+
pytest.skip("h5pyd package not available")
|
|
2752
|
+
elif not hsds_up:
|
|
2753
|
+
pytest.skip("HSDS service not running")
|
|
2754
|
+
rnd = "".join(random.choice(string.ascii_uppercase) for _ in range(5))
|
|
2755
|
+
for prefix in ("/", "hdf5://"):
|
|
2756
|
+
fname = f"{prefix}testfile{rnd}.nc"
|
|
2757
|
+
with h5netcdf.File(fname, "w", driver="h5pyd") as ds:
|
|
2758
|
+
assert ds._h5py == h5pyd
|
|
2759
|
+
assert isinstance(ds._h5file, h5pyd.File)
|
|
2760
|
+
|
|
2761
|
+
|
|
2762
|
+
def test_h5pyd_nonchunked_scalars(hsds_up):
|
|
2763
|
+
if without_h5pyd:
|
|
2764
|
+
pytest.skip("h5pyd package not available")
|
|
2765
|
+
elif not hsds_up:
|
|
2766
|
+
pytest.skip("HSDS service not running")
|
|
2767
|
+
rnd = "".join(random.choice(string.ascii_uppercase) for _ in range(5))
|
|
2768
|
+
fname = f"hdf5://testfile{rnd}.nc"
|
|
2769
|
+
with h5pyd.File(fname, "w") as ds:
|
|
2770
|
+
ds.create_dataset("foo", data=b"1234")
|
|
2771
|
+
with h5netcdf.File(fname, "r", driver="h5pyd") as ds:
|
|
2772
|
+
# HSDS stores this as a chunked dataset, but only with a single chunk
|
|
2773
|
+
assert ds["foo"]._h5ds.chunks == (1,)
|
|
2774
|
+
# However, since it is a scalar dataset, we should not expose the chunking
|
|
2775
|
+
assert ds["foo"].chunks is None
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
h5netcdf/__init__.py,sha256=Y0EBCcmlJctwl1kCmj7yLijTVy9AioBTr2091vInAtw,456
|
|
2
|
+
h5netcdf/_version.py,sha256=vFpyllSQPpQuwzP7Cf743S6HuWgZRMOD31pPfh-WoZM,511
|
|
3
|
+
h5netcdf/attrs.py,sha256=4IvV4ULLWkz4igFsvu9S2LB745wgUKrIdIuSeO5kpX8,3581
|
|
4
|
+
h5netcdf/core.py,sha256=jIzkOpoZncik2mvLC-aCv7x5QxiBcMPjIRdjKEu9SVA,63124
|
|
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=l6bOQyqe4gcdKHSNNijeWlFYTpEZse4QEUWbUntAIf4,1825
|
|
9
|
+
h5netcdf/tests/pytest.ini,sha256=ruJxrLdCIA4bCPVuPQjxsLSlvVxuIsIakK6iQOmz-ak,107
|
|
10
|
+
h5netcdf/tests/test_h5netcdf.py,sha256=OeEF7NrTfd5PMGzIPg2zeIUyTFKX9ZVoiLtvE3XO9sA,108407
|
|
11
|
+
h5netcdf-1.6.1.dist-info/AUTHORS.txt,sha256=LTKzUh9o4Wc_oT3aFC48cyDCCP6tdm6VEV_6RrNy4uo,272
|
|
12
|
+
h5netcdf-1.6.1.dist-info/LICENSE,sha256=Xer1Jg8iL_n9Da0xt0S99blk6tsg9tee_JdgH1rWTjs,1505
|
|
13
|
+
h5netcdf-1.6.1.dist-info/METADATA,sha256=x81zx4yWKM52EMDfghLa6CvFYbPytMRXrk8uZi7cPug,13366
|
|
14
|
+
h5netcdf-1.6.1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
15
|
+
h5netcdf-1.6.1.dist-info/top_level.txt,sha256=Fb_KIpOE6MBqjSvxV1Ay7oYce1mdmQ1pO9JQJPDeGqg,9
|
|
16
|
+
h5netcdf-1.6.1.dist-info/RECORD,,
|
h5netcdf-1.5.0.dist-info/RECORD
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
h5netcdf/__init__.py,sha256=Y0EBCcmlJctwl1kCmj7yLijTVy9AioBTr2091vInAtw,456
|
|
2
|
-
h5netcdf/_version.py,sha256=OYzqgMEgfFG0au4hzbEdgYI-c7Hxo3wdBtrpEjK1RoY,411
|
|
3
|
-
h5netcdf/attrs.py,sha256=4IvV4ULLWkz4igFsvu9S2LB745wgUKrIdIuSeO5kpX8,3581
|
|
4
|
-
h5netcdf/core.py,sha256=eRBedSrVW1XTi2VaQmnbkb5mmNStjXLKtMfKS2aXZ9M,62784
|
|
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=l6bOQyqe4gcdKHSNNijeWlFYTpEZse4QEUWbUntAIf4,1825
|
|
9
|
-
h5netcdf/tests/pytest.ini,sha256=ruJxrLdCIA4bCPVuPQjxsLSlvVxuIsIakK6iQOmz-ak,107
|
|
10
|
-
h5netcdf/tests/test_h5netcdf.py,sha256=0YEueWNipnriBEPCr1-WHc6yas2OhAxyKRYJPpdktfQ,107166
|
|
11
|
-
h5netcdf-1.5.0.dist-info/AUTHORS.txt,sha256=LTKzUh9o4Wc_oT3aFC48cyDCCP6tdm6VEV_6RrNy4uo,272
|
|
12
|
-
h5netcdf-1.5.0.dist-info/LICENSE,sha256=Xer1Jg8iL_n9Da0xt0S99blk6tsg9tee_JdgH1rWTjs,1505
|
|
13
|
-
h5netcdf-1.5.0.dist-info/METADATA,sha256=4nRbqYGrDkO_v8Pjp7Hn3qkSrfG3zXbtce_ZbjzY2lc,13366
|
|
14
|
-
h5netcdf-1.5.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
15
|
-
h5netcdf-1.5.0.dist-info/top_level.txt,sha256=Fb_KIpOE6MBqjSvxV1Ay7oYce1mdmQ1pO9JQJPDeGqg,9
|
|
16
|
-
h5netcdf-1.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|