File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1382,3 +1382,22 @@ def test_roundtrip_numcodecs() -> None:
13821382 metadata = root ["test" ].metadata .to_dict ()
13831383 expected = (* filters , BYTES_CODEC , * compressors )
13841384 assert metadata ["codecs" ] == expected
1385+
1386+
1387+ def _index_array (arr : Array , index : Any ) -> Any :
1388+ return arr [index ]
1389+
1390+
1391+ @pytest .mark .parametrize ("store" , ["local" ], indirect = True )
1392+ def test_multiprocessing (store : Store ) -> None :
1393+ """
1394+ Test that arrays can be pickled and indexed in child processes
1395+ """
1396+ data = np .arange (100 )
1397+ arr = zarr .create_array (store = store , data = data )
1398+ from multiprocessing import Pool
1399+
1400+ pool = Pool ()
1401+
1402+ results = pool .starmap (_index_array , [(arr , slice (len (data )))] * 3 )
1403+ assert all (np .array_equal (r , data ) for r in results )
You can’t perform that action at this time.
0 commit comments