Skip to content

Commit 39aa400

Browse files
committed
Test MultiManager + Field Selection
1 parent 0cc166e commit 39aa400

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/hl/test_dataset.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,10 +2353,10 @@ def test_multi_selection_rw(self):
23532353
for i in range(count):
23542354
np.testing.assert_array_equal(data_out[i][6:, 6:, 6:], data_in_original[i][6:, 6:, 6:])
23552355

2356-
"""
2357-
TBD - Field selection in h5pyd seems to work slightly different than in h5py
23582356
def test_multi_write_field_selection(self):
2359-
Testing writing to a field selection on multiple datasets
2357+
"""
2358+
Test writing to a field selection on multiple datasets
2359+
"""
23602360
dt = np.dtype([('a', np.float32), ('b', np.int32), ('c', np.float32)])
23612361
shape = (100,)
23622362
data = np.ones(shape, dtype=dt)
@@ -2378,8 +2378,14 @@ def test_multi_write_field_selection(self):
23782378
np.testing.assert_array_equal(out['a'], np.zeros(shape, dtype=dt['a']))
23792379
np.testing.assert_array_equal(out['b'], data['b'])
23802380
np.testing.assert_array_equal(out['c'], np.zeros(shape, dtype=dt['c']))
2381-
"""
23822381

2382+
# Test writing to entire compound type
2383+
data = np.zeros(shape, dtype=dt)
2384+
mm[...] = [data, data, data]
2385+
2386+
for i in range(count):
2387+
out = np.array(self.f["data" + str(i)], dtype=dt)
2388+
np.testing.assert_array_equal(out, data)
23832389

23842390
if __name__ == '__main__':
23852391
loglevel = logging.ERROR

0 commit comments

Comments
 (0)