@@ -152,13 +152,20 @@ def test_vindex(data: st.DataObject) -> None:
152152
153153 indexer = data .draw (
154154 npst .integer_array_indices (
155- shape = nparray .shape ,
156- result_shape = npst .array_shapes (min_side = 1 , max_dims = None ),
155+ shape = nparray .shape , result_shape = npst .array_shapes (min_side = 1 , max_dims = None )
157156 )
158157 )
159158 actual = zarray .vindex [indexer ]
160159 assert_array_equal (nparray [indexer ], actual )
161160
161+ # FIXME!
162+ # when the indexer is such that a value gets overwritten multiple times,
163+ # I think the output depends on chunking.
164+ # new_data = data.draw(npst.arrays(shape=st.just(actual.shape), dtype=nparray.dtype))
165+ # nparray[indexer] = new_data
166+ # zarray.vindex[indexer] = new_data
167+ # assert_array_equal(nparray, zarray[:])
168+
162169
163170@given (store = stores , meta = array_metadata ()) # type: ignore[misc]
164171@pytest .mark .filterwarnings ("ignore::zarr.core.dtype.common.UnstableSpecificationWarning" )
@@ -216,6 +223,30 @@ def test_roundtrip_array_metadata_from_json(data: st.DataObject, zarr_format: in
216223 assert deep_equal (orig , rt ), f"Roundtrip mismatch:\n Original: { orig } \n Roundtripped: { rt } "
217224
218225
226+ # @st.composite
227+ # def advanced_indices(draw, *, shape):
228+ # basic_idxr = draw(
229+ # basic_indices(
230+ # shape=shape, min_dims=len(shape), max_dims=len(shape), allow_ellipsis=False
231+ # ).filter(lambda x: isinstance(x, tuple))
232+ # )
233+
234+ # int_idxr = draw(
235+ # npst.integer_array_indices(shape=shape, result_shape=npst.array_shapes(max_dims=1))
236+ # )
237+ # args = tuple(
238+ # st.sampled_from((l, r)) for l, r in zip_longest(basic_idxr, int_idxr, fillvalue=slice(None))
239+ # )
240+ # return draw(st.tuples(*args))
241+
242+
243+ # @given(st.data())
244+ # def test_roundtrip_object_array(data):
245+ # nparray = data.draw(np_arrays)
246+ # zarray = data.draw(arrays(arrays=st.just(nparray)))
247+ # assert_array_equal(nparray, zarray[:])
248+
249+
219250def serialized_complex_float_is_valid (
220251 serialized : tuple [numbers .Real | str , numbers .Real | str ],
221252) -> bool :
0 commit comments