Skip to content

Commit

Permalink
Don't provide use_cache with h5py
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjala committed May 7, 2024
1 parent d44dddd commit a744ce4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion test/hl/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def test_create(self):
pass

# re-open as read-write
f = h5py.File(filename, 'w', use_cache=False)
if h5py.__name__ == "h5pyd":
f = h5py.File(filename, 'w', use_cache=False)
else:
f = h5py.File(filename, 'w')
self.assertTrue(f.id.id is not None)
self.assertEqual(f.mode, 'r+')
self.assertEqual(len(f.keys()), 0)
Expand Down
10 changes: 8 additions & 2 deletions test/hl/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def test_create(self):
# create main test file
filename = self.getFileName("create_group")
print("filename:", filename)
f = h5py.File(filename, 'w', use_cache=False)
if h5py.__name__ == "h5pyd":
f = h5py.File(filename, 'w', use_cache=False)
else:
f = h5py.File(filename, 'w')
is_hsds = False
if isinstance(f.id.id, str) and f.id.id.startswith("g-"):
is_hsds = True # HSDS has different permission defaults
Expand Down Expand Up @@ -281,7 +284,10 @@ def get_count(grp):
filename = self.getFileName("test_link_removal")
print(filename)

f = h5py.File(filename, 'w', use_cache=False)
if h5py.__name__ == "h5pyd":
f = h5py.File(filename, 'w', use_cache=False)
else:
f = h5py.File(filename, 'w')
g1 = f.create_group("g1")
dset = g1.create_dataset('ds', (5, 7), dtype='f4')

Expand Down

0 comments on commit a744ce4

Please sign in to comment.