h5netcdf 1.7.0__tar.gz → 1.7.1__tar.gz

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.

Files changed (33) hide show
  1. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/CHANGELOG.rst +5 -0
  2. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/PKG-INFO +1 -1
  3. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf/_version.py +3 -3
  4. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf/attrs.py +4 -3
  5. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf/tests/test_h5netcdf.py +14 -0
  6. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf.egg-info/PKG-INFO +1 -1
  7. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/.pre-commit-config.yaml +0 -0
  8. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/AUTHORS.txt +0 -0
  9. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/LICENSE +0 -0
  10. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/README.rst +0 -0
  11. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/doc/Makefile +0 -0
  12. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/doc/api.rst +0 -0
  13. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/doc/changelog.rst +0 -0
  14. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/doc/conf.py +0 -0
  15. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/doc/devguide.rst +0 -0
  16. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/doc/feature.rst +0 -0
  17. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/doc/index.rst +0 -0
  18. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/doc/legacyapi.rst +0 -0
  19. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf/__init__.py +0 -0
  20. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf/core.py +0 -0
  21. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf/dimensions.py +0 -0
  22. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf/legacyapi.py +0 -0
  23. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf/tests/conftest.py +0 -0
  24. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf/tests/pytest.ini +0 -0
  25. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf/utils.py +0 -0
  26. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf.egg-info/SOURCES.txt +0 -0
  27. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf.egg-info/dependency_links.txt +0 -0
  28. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf.egg-info/requires.txt +0 -0
  29. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/h5netcdf.egg-info/top_level.txt +0 -0
  30. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/licenses/H5PY_LICENSE.txt +0 -0
  31. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/licenses/PSF_LICENSE.txt +0 -0
  32. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/pyproject.toml +0 -0
  33. {h5netcdf-1.7.0 → h5netcdf-1.7.1}/setup.cfg +0 -0
@@ -1,6 +1,11 @@
1
1
  Change Log
2
2
  ----------
3
3
 
4
+ Version 1.7.1 (October 16th, 2025):
5
+
6
+ - Fix regression where attributes with list of strings were written with h5py low-level API instead of high-level API (:issue:`291`, :pull:`292`).
7
+ By `Kai Mühlbauer <https://github.com/kmuehlbauer>`_
8
+
4
9
  Version 1.7.0 (October 15th, 2025):
5
10
 
6
11
  - Fix unintentional changes in test suite (:pull:`277`).
@@ -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>
@@ -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
- __commit_id__ = commit_id = 'g9cb422fb6'
34
+ __commit_id__ = commit_id = 'g251854355'
@@ -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>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes