Skip to content

DOC: Fix migration note for alltrue and sometrue#27015

Merged
rgommers merged 1 commit into
numpy:mainfrom
mtsokol:sometrue-migration
Jul 23, 2024
Merged

DOC: Fix migration note for alltrue and sometrue#27015
rgommers merged 1 commit into
numpy:mainfrom
mtsokol:sometrue-migration

Conversation

@mtsokol

@mtsokol mtsokol commented Jul 23, 2024

Copy link
Copy Markdown
Member

Hi @ngoldbaum,

I think I made a mistake in #26517 as pointed out it in astral-sh/ruff#12416.

np.sometrue and np.alltrue should be mapped to np.any and np.all instead of Python builtins any/all. (It could be also backported).

@mtsokol

mtsokol commented Jul 23, 2024

Copy link
Copy Markdown
Member Author

@rgommers I see that I took it from the deprecation message added here: 9990f98

I think in:

    .. deprecated:: 1.25.0
        ``sometrue`` is deprecated as of NumPy 1.25.0, and will be
        removed in NumPy 2.0. Please use `any` instead.

and

    .. deprecated:: 1.25.0
        ``alltrue`` is deprecated as of NumPy 1.25.0, and will be
        removed in NumPy 2.0. Please use `all` instead.

you meant np.all and np.any, not the Python builtins, right? As the release note states.

@rgommers rgommers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @mtsokol.

you meant np.all and np.any, not the Python builtins, right? As the release note states.

Yes indeed. That seemed clear to me even without the np. - I think all the surrounding notes with the np. included were written later. Nevertheless, this PR makes it more clear, so in it goes.

@rgommers rgommers changed the title BUG: Fix migration note for alltrue and sometrue DOC: Fix migration note for alltrue and sometrue Jul 23, 2024
@rgommers

Copy link
Copy Markdown
Member

Certainly not a bug I'd say - changed to DOC:

@rgommers rgommers merged commit d3d7b55 into numpy:main Jul 23, 2024
@rgommers rgommers added the 09 - Backport-Candidate PRs tagged should be backported label Jul 23, 2024
@rgommers

Copy link
Copy Markdown
Member

Backporting sounds fine to me, in case we do a 2.0.2 release - label added.

@mtsokol mtsokol deleted the sometrue-migration branch July 23, 2024 09:34
@charris charris changed the title DOC: Fix migration note for alltrue and sometrue DOC: Fix migration note for alltrue and sometrue Jul 23, 2024
charris pushed a commit to charris/numpy that referenced this pull request Jul 24, 2024
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 24, 2024
ArvidJB pushed a commit to ArvidJB/numpy that referenced this pull request Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants