Skip to content

Commit d7a5540

Browse files
committed
Skip MultiManager tests with h5py
1 parent 376f921 commit d7a5540

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/hl/test_dataset.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,7 @@ def test_basetype_commutative(self,):
19701970
assert (val != dset) == (dset != val)
19711971

19721972

1973+
@ut.skipIf(config.get('use_h5py'), "h5py does not support MultiManager")
19731974
class TestMultiManager(BaseDataset):
19741975
def test_multi_read_scalar_dataspaces(self):
19751976
"""
@@ -2350,16 +2351,17 @@ def test_multi_write_mixed_shapes(self):
23502351
out = self.f["data" + str(i)][...]
23512352
np.testing.assert_array_equal(out[sel_idx, sel_idx], data_in + i)
23522353

2353-
def test_multi_selection_rw(self):
2354+
def test_multi_selection(self):
23542355
"""
2355-
Test reading and writing a unique selection in each dataset
2356+
Test using a different selection
2357+
for each dataset in a MultiManager
23562358
"""
23572359
shape = (10, 10, 10)
23582360
count = 3
23592361
dt = np.int32
23602362

23612363
# Create datasets
2362-
data_in = np.reshape(np.arange(np.prod(shape)), shape)
2364+
data_in = np.reshape(np.arange(np.prod(shape), dtype=dt), shape)
23632365
data_in_original = data_in.copy()
23642366
datasets = []
23652367

@@ -2368,7 +2370,7 @@ def test_multi_selection_rw(self):
23682370
dtype=dt, data=data_in)
23692371
datasets.append(dset)
23702372

2371-
mm = MultiManager(datasets=datasets)
2373+
mm = h5py.MultiManager(datasets=datasets)
23722374

23732375
# Selections to read from
23742376
sel = [np.s_[0:10, 0:10, 0:10], np.s_[0:5, 5:10, 1:4:2], np.s_[4, 5, 6]]
@@ -2379,15 +2381,15 @@ def test_multi_selection_rw(self):
23792381

23802382
# If selection list has only a single element, apply it to all dsets
23812383
sel = [np.s_[0:10, 0:10, 0:10]]
2382-
data_out = mm[sel[0]]
2384+
data_out = mm[sel]
23832385

23842386
for d in data_out:
23852387
np.testing.assert_array_equal(d, data_in[sel[0]])
23862388

23872389
# Selections to write to
23882390
sel = [np.s_[0:10, 0:10, 0:10], np.s_[0:5, 0:5, 0:5], np.s_[0, 0, 0]]
23892391
data_in = [np.zeros_like(data_in), np.ones_like(data_in), np.full_like(data_in, 2)]
2390-
mm[sel] = data_in
2392+
mm[sel] = [data_in[i][sel[i]] for i in range(count)]
23912393

23922394
for i in range(count):
23932395
np.testing.assert_array_equal(self.f["data" + str(i)][sel[i]], data_in[i][sel[i]])

0 commit comments

Comments
 (0)