Skip to content

Commit 4603f89

Browse files
authored
Merge pull request #1231 from wright-group/hdf5-inheritance
Fix iterator failures with h5py 3.16
2 parents 6bb1142 + ce6b67a commit 4603f89

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
55

66
## [Unreleased]
77

8+
### Fixed
9+
- WrightTools works with new h5py 3.16
10+
811
## [3.6.2]
912

1013
### Fixed

WrightTools/_group.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,3 +407,11 @@ def save(self, filepath=None, overwrite=False, verbose=True):
407407
if verbose:
408408
print("file saved at", filepath)
409409
return str(filepath)
410+
411+
def items(self):
412+
for k in self.keys():
413+
yield k, self[k]
414+
415+
def values(self):
416+
for k in self.keys():
417+
yield self[k]

tests/collection/collection.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ def test_create_data():
3131
assert child1.natural_name == "data"
3232

3333

34+
def test_looping_collection():
35+
col = wt.Collection()
36+
child1 = col.create_data()
37+
assert isinstance(list(col.values())[0], type(child1))
38+
39+
3440
if __name__ == "__main__":
3541
test_create_collection()
3642
test_create_data()
43+
test_looping_collection()

0 commit comments

Comments
 (0)