Skip to content

API: Make any and all return booleans by default#25712

Merged
seberg merged 4 commits intonumpy:mainfrom
seberg:any-all-bool
Jan 31, 2024
Merged

API: Make any and all return booleans by default#25712
seberg merged 4 commits intonumpy:mainfrom
seberg:any-all-bool

Conversation

@seberg
Copy link
Member

@seberg seberg commented Jan 28, 2024

The method supports a dtype= argument, but I am thinking to promote np.logical_or.reduce() instead.

Closes gh-4352

@mattip
Copy link
Member

mattip commented Jan 31, 2024

This probably needs some changes in the doc string if not some mention somewhere in the user documentation. It is somewhat niche but a large change in UX

@seberg
Copy link
Member Author

seberg commented Jan 31, 2024

The any/all docs already claim to always return booleans. We could add a .. versionchanged:: directly in their notes?

@seberg
Copy link
Member Author

seberg commented Jan 31, 2024

The any/all docs already claim to always return booleans. We could add a .. versionchanged:: directly in their notes?

That seems very reasonable to me on second thought, so I did that.

@mattip
Copy link
Member

mattip commented Jan 31, 2024

Bleh. I think doc building is failing because of some partial merge with main, and the requirements file moved in #25697.

Copy link
Member

@mattip mattip left a comment

Choose a reason for hiding this comment

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

LGTM, once CI is happy.

@seberg
Copy link
Member Author

seberg commented Jan 31, 2024

Hmmm, will try to close/reopen, circleci choked on something.

@seberg seberg closed this Jan 31, 2024
@seberg seberg reopened this Jan 31, 2024
@seberg
Copy link
Member Author

seberg commented Jan 31, 2024

Sorry, I missed your comment jumping to the end, will try rebasing then...

@seberg
Copy link
Member Author

seberg commented Jan 31, 2024

OK, CI happy now, thanks for the review Matti.

@seberg seberg merged commit 6115c30 into numpy:main Jan 31, 2024
@seberg seberg deleted the any-all-bool branch January 31, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

numpy any and all applied to object arrays should return booleans.

2 participants