Skip to content

Commit

Permalink
Test reading from field selection with MultiManager (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjala authored Jul 31, 2024
1 parent c284df3 commit 625d666
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/hl/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2432,9 +2432,9 @@ def test_multi_selection(self):
for i in range(count):
np.testing.assert_array_equal(data_out[i][6:, 6:, 6:], data_in_original[i][6:, 6:, 6:])

def test_multi_write_field_selection(self):
def test_multi_field_selection(self):
"""
Test writing to a field selection on multiple datasets
Test reading/writing to a field selection on multiple datasets
"""
dt = np.dtype([('a', np.float32), ('b', np.int32), ('c', np.float32)])
shape = (100,)
Expand All @@ -2448,6 +2448,14 @@ def test_multi_write_field_selection(self):
dtype=dt)
datasets.append(dset)

# Perform read from field 'b'
mm = MultiManager(datasets=datasets)
out = mm[..., 'b']

# Verify data returned
for i in range(count):
np.testing.assert_array_equal(out[i], np.zeros(shape, dtype=dt['b']))

# Perform write to field 'b'
mm = MultiManager(datasets=datasets)
mm[..., 'b'] = [data['b'], data['b'], data['b']]
Expand Down

0 comments on commit 625d666

Please sign in to comment.