Skip to content

Commit

Permalink
Test that compound reference arrays are written as a compound array
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Dec 21, 2023
1 parent 8100341 commit 63922ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/unit/base_tests_zarrio.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ def test_read_reference_compound(self):
self.read()
builder = self.createReferenceCompoundBuilder()['ref_dataset']
read_builder = self.root['ref_dataset']

# ensure the array was written as a compound array
ref_dtype = np.dtype([('id', '<i8'), ('name', '<U25'), ('reference', 'O')])
assert read_builder.data.dataset.dtype == ref_dtype

# Load the elements of each entry in the compound dataset and compar the index, string, and referenced array
for i, v in enumerate(read_builder['data']):
self.assertEqual(v[0], builder['data'][i][0]) # Compare index value from compound tuple
Expand Down

0 comments on commit 63922ae

Please sign in to comment.