File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -255,12 +255,18 @@ def test_searchsorted(data):
255255 sorter = None
256256 x1 = xp .sort (x1 )
257257 note (f"{ x1 = } " )
258+
258259 x2 = data .draw (
259260 st .lists (st .sampled_from (_x1 ), unique = True , min_size = 1 ).map (
260261 lambda o : xp .asarray (o , dtype = dh .default_float )
261262 ),
262263 label = "x2" ,
263264 )
265+ # make x2.ndim > 1, if it makes sense
266+ factors = hh ._factorize (x2 .shape [0 ])
267+ if len (factors ) > 1 :
268+ x2 = xp .reshape (x2 , tuple (factors ))
269+
264270 kw = data .draw (hh .kwargs (side = st .sampled_from (["left" , "right" ])))
265271
266272 repro_snippet = ph .format_snippet (
@@ -275,7 +281,7 @@ def test_searchsorted(data):
275281 out_dtype = out .dtype ,
276282 expected = xp .__array_namespace_info__ ().default_dtypes ()["indexing" ],
277283 )
278- # TODO: x2.ndim > 1, values testing
284+ # TODO: values testing
279285 ph .assert_shape ("searchsorted" , out_shape = out .shape , expected = x2 .shape )
280286 except Exception as exc :
281287 exc .add_note (repro_snippet )
You can’t perform that action at this time.
0 commit comments