Skip to content

BUG: Ignore invalid and overflow warnings in masked setitem#23634

Merged
charris merged 1 commit intonumpy:maintenance/1.24.xfrom
charris:backport-23627
Apr 22, 2023
Merged

BUG: Ignore invalid and overflow warnings in masked setitem#23634
charris merged 1 commit intonumpy:maintenance/1.24.xfrom
charris:backport-23627

Conversation

@charris
Copy link
Copy Markdown
Member

@charris charris commented Apr 21, 2023

Backport of #23627.

Giving a warning for invalid/overflow in settitem/casts is right (IMO), however for masked arrays it can be surprising since the warning is not useful if the value is invalid but also masked.

So, simply blanket ignore the relevant warnings in setitem via errstate. (There may be some other cases like .astype() where it might be helpful to MA users to just blanket opt-out of these new warnings.)

Closes gh-23000

Giving a warning for invalid/overflow in settitem/casts is right
(IMO), however for masked arrays it can be surprising since the
warning is not useful if the value is invalid but also masked.

So, simply blanket ignore the relevant warnings in setitem via errstate.
(There may be some other cases like `.astype()` where it might be
helpful to MA users to just blanket opt-out of these new warnings.)

Closes numpygh-23000
@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Apr 21, 2023
@charris charris added this to the 1.24.3 release milestone Apr 21, 2023
@charris charris closed this Apr 22, 2023
@charris charris reopened this Apr 22, 2023
@charris charris merged commit d4b1eac into numpy:maintenance/1.24.x Apr 22, 2023
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