@@ -2353,10 +2353,10 @@ def test_multi_selection_rw(self):
2353
2353
for i in range (count ):
2354
2354
np .testing .assert_array_equal (data_out [i ][6 :, 6 :, 6 :], data_in_original [i ][6 :, 6 :, 6 :])
2355
2355
2356
- """
2357
- TBD - Field selection in h5pyd seems to work slightly different than in h5py
2358
2356
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
+ """
2360
2360
dt = np .dtype ([('a' , np .float32 ), ('b' , np .int32 ), ('c' , np .float32 )])
2361
2361
shape = (100 ,)
2362
2362
data = np .ones (shape , dtype = dt )
@@ -2378,8 +2378,14 @@ def test_multi_write_field_selection(self):
2378
2378
np .testing .assert_array_equal (out ['a' ], np .zeros (shape , dtype = dt ['a' ]))
2379
2379
np .testing .assert_array_equal (out ['b' ], data ['b' ])
2380
2380
np .testing .assert_array_equal (out ['c' ], np .zeros (shape , dtype = dt ['c' ]))
2381
- """
2382
2381
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 )
2383
2389
2384
2390
if __name__ == '__main__' :
2385
2391
loglevel = logging .ERROR
0 commit comments