Skip to content

BUG: Fix out-of-bound minimum offset for in1d table method#26963

Merged
charris merged 1 commit into
numpy:maintenance/2.0.xfrom
charris:backport-26930
Jul 17, 2024
Merged

BUG: Fix out-of-bound minimum offset for in1d table method#26963
charris merged 1 commit into
numpy:maintenance/2.0.xfrom
charris:backport-26930

Conversation

@charris
Copy link
Copy Markdown
Member

@charris charris commented Jul 17, 2024

Backport of #26930.

We could always use ar2.dtype, but we want intp anyway, so that is nicer. But if the minimum value doesn't fit intp, NumPy would complain (it may even guaranteed to work to force-cast, but...)

So just try to use intp, but if that doesn't work use ar2.dtype which must work, but means we'll have to cast once more (even if that cast is probably just a view in principle).

Closes gh-26922

We could always use ar2.dtype, but we want intp anyway, so that
is nicer.  But if the minimum value doesn't fit intp, NumPy would
complain (it may even guaranteed to work to force-cast,
but...)

So just try to use intp, but if that doesn't work use ar2.dtype
which must work, but means we'll have to cast once more (even if
that cast is probably just a view in principle).

Closes numpygh-26922
@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Jul 17, 2024
@charris charris added this to the 2.0.1 release milestone Jul 17, 2024
@charris charris merged commit 6afbbf8 into numpy:maintenance/2.0.x Jul 17, 2024
@charris charris deleted the backport-26930 branch July 17, 2024 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug 08 - Backport Used to tag backport PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants