h5netcdf 1.7.0__py3-none-any.whl → 1.7.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 CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '1.7.0'
32
- __version_tuple__ = version_tuple = (1, 7, 0)
31
+ __version__ = version = '1.7.1'
32
+ __version_tuple__ = version_tuple = (1, 7, 1)
33
33
 
34
34
  __commit_id__ = commit_id = None
h5netcdf/attrs.py CHANGED
@@ -87,10 +87,11 @@ class Attributes(MutableMapping):
87
87
 
88
88
  self._check_dtype(dtype)
89
89
 
90
+ is_plain_string = dtype.kind in {"S", "U"} and dtype.metadata is None
90
91
  if (
91
- dtype.kind in {"S", "U"} # for strings
92
- and dtype.metadata is None # but not special h5py strings
93
- and not isinstance(value, (list, self._h5py.Empty))
92
+ is_plain_string # for simple strings
93
+ and (not isinstance(value, list) and self._format == "NETCDF4_CLASSIC")
94
+ and not isinstance(value, self._h5py.Empty)
94
95
  and self._h5py.__name__ == "h5py"
95
96
  ):
96
97
  # create with low level API to get fixed length strings
@@ -2999,3 +2999,17 @@ def test_is_classic(tmp_local_netcdf):
2999
2999
 
3000
3000
  out = subprocess.run(["ncdump", "-k", tmp_local_netcdf], capture_output=True)
3001
3001
  assert out.stdout.decode().strip() == "netCDF-4 classic model"
3002
+
3003
+
3004
+ @pytest.mark.parametrize(
3005
+ "attr", [("un", "deux"), ["un", "deux"], ("one", "two"), ["one", "two"]]
3006
+ )
3007
+ def test_attributes_list(tmp_local_netcdf, attr):
3008
+ # regression test for https://github.com/h5netcdf/h5netcdf/issues/291
3009
+ with h5netcdf.File(tmp_local_netcdf, mode="w") as hf:
3010
+ hf.attrs["foo"] = attr
3011
+
3012
+ with h5netcdf.File(tmp_local_netcdf, mode="r") as hf:
3013
+ assert hf.attrs["foo"][0] == attr[0]
3014
+ assert hf.attrs["foo"][1] == attr[1]
3015
+ assert isinstance(hf.attrs["foo"], list)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: h5netcdf
3
- Version: 1.7.0
3
+ Version: 1.7.1
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>
@@ -1,16 +1,16 @@
1
1
  h5netcdf/__init__.py,sha256=Y0EBCcmlJctwl1kCmj7yLijTVy9AioBTr2091vInAtw,456
2
- h5netcdf/_version.py,sha256=oGRWiKvEGHesjf5wCNHGVlYfAA3dInDJeL5EiMaru6A,704
3
- h5netcdf/attrs.py,sha256=yPwGhaEhr7TtihH--Tx24j7gKgRDQIXs-mtx6ngIZRo,4494
2
+ h5netcdf/_version.py,sha256=wcauG7D_isNqKUiP6L0WuH_5Dwe0oyUJa9LG3cC4WHk,704
3
+ h5netcdf/attrs.py,sha256=GSq2lzv9q0tEkJBqr2Hyrwo0YJnWZHxtLRhhG9NVf4w,4575
4
4
  h5netcdf/core.py,sha256=Fg_68fF9vcyozlk-2vO1Qa0U_oRbvWfE976ax--CvxM,69698
5
5
  h5netcdf/dimensions.py,sha256=pxtt3ID55bTMp6djIpAka3RgXzioIUs9qBBgMqd9HhU,8336
6
6
  h5netcdf/legacyapi.py,sha256=MIZlht5Ad4hDFF1Slz2vXmKkgbv7Fhhf2YwNIe16Lfk,7682
7
7
  h5netcdf/utils.py,sha256=btxKI-VZP-Wn0Rk_wmnhnUls-mrxO42w0s_uX_su4FI,6528
8
8
  h5netcdf/tests/conftest.py,sha256=qS7XTZxos0NIRFtMCJwVEyx0paZw8Le1loPK1MtoQ_0,2350
9
9
  h5netcdf/tests/pytest.ini,sha256=ruJxrLdCIA4bCPVuPQjxsLSlvVxuIsIakK6iQOmz-ak,107
10
- h5netcdf/tests/test_h5netcdf.py,sha256=s5m3N3huMsxmIAN_W78-YnawB-lKWQPmQgSutO6bwzA,116652
11
- h5netcdf-1.7.0.dist-info/licenses/AUTHORS.txt,sha256=LTKzUh9o4Wc_oT3aFC48cyDCCP6tdm6VEV_6RrNy4uo,272
12
- h5netcdf-1.7.0.dist-info/licenses/LICENSE,sha256=Xer1Jg8iL_n9Da0xt0S99blk6tsg9tee_JdgH1rWTjs,1505
13
- h5netcdf-1.7.0.dist-info/METADATA,sha256=lNPv7WhB1VSjMJYsmC0qJX_wRvRP_deMsIXidu0Ch3A,13396
14
- h5netcdf-1.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- h5netcdf-1.7.0.dist-info/top_level.txt,sha256=Fb_KIpOE6MBqjSvxV1Ay7oYce1mdmQ1pO9JQJPDeGqg,9
16
- h5netcdf-1.7.0.dist-info/RECORD,,
10
+ h5netcdf/tests/test_h5netcdf.py,sha256=FWH2xJfIrBkUg7QEqOTvhrJYVvMU6flkDdkX-NWjI7s,117170
11
+ h5netcdf-1.7.1.dist-info/licenses/AUTHORS.txt,sha256=LTKzUh9o4Wc_oT3aFC48cyDCCP6tdm6VEV_6RrNy4uo,272
12
+ h5netcdf-1.7.1.dist-info/licenses/LICENSE,sha256=Xer1Jg8iL_n9Da0xt0S99blk6tsg9tee_JdgH1rWTjs,1505
13
+ h5netcdf-1.7.1.dist-info/METADATA,sha256=tqEPGLxlIdLwfJjNy2NV60F_5jz95xr5YQ13KzfZa6I,13396
14
+ h5netcdf-1.7.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ h5netcdf-1.7.1.dist-info/top_level.txt,sha256=Fb_KIpOE6MBqjSvxV1Ay7oYce1mdmQ1pO9JQJPDeGqg,9
16
+ h5netcdf-1.7.1.dist-info/RECORD,,