Skip to content

Commit

Permalink
Misc fixes found by the cupy backend
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbell10 committed Aug 11, 2020
1 parent cc124c2 commit 76a279f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions unumpy/_multimethods.py
Expand Up @@ -1154,10 +1154,10 @@ def pad(array, pad_width, mode, **kwargs):
return (array,)


@create_numpy(_self_argreplacer)
@create_numpy(_first2argreplacer)
@all_of_type(ndarray)
def searchsorted(a, v, side="left", sorter=None):
return (a,)
return (a, v)


@create_numpy(_first2argreplacer)
Expand Down Expand Up @@ -2202,7 +2202,14 @@ def _interp_default(x, xp, fp, left=None, right=None, period=None):
return result


@create_numpy(_self_argreplacer, default=_interp_default)
def _interp_argreplacer(args, kwargs, dispatchables):
def interp(x, xp, fp, left=None, right=None, period=None):
return (dispatchables, dict(left=left, right=right, period=period))

return interp(*args, **kwargs)


@create_numpy(_interp_argreplacer, default=_interp_default)
@all_of_type(ndarray)
def interp(x, xp, fp, left=None, right=None, period=None):
return (x,)
return (x, xp, fp)
2 changes: 1 addition & 1 deletion unumpy/tests/test_numpy.py
Expand Up @@ -175,7 +175,7 @@ def replace_args_kwargs(method, backend, args, kwargs):
(np.ediff1d, ([1, 2, 4, 7, 0],), {}),
(np.cross, ([1, 2, 3], [4, 5, 6]), {}),
(np.trapz, ([1, 2, 3],), {}),
(np.i0, ([0.0, 1.0 + 2j],), {}),
(np.i0, ([0.0, 1.0],), {}),
(np.sinc, ([0, 1, 2],), {}),
(np.isclose, ([1, 3, 2], [3, 2, 1]), {}),
(np.allclose, ([1, 3, 2], [3, 2, 1]), {}),
Expand Down

0 comments on commit 76a279f

Please sign in to comment.