FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add support for scalar arguments to xp.where by betatim · Pull Request #78 · data-apis/array-api-strict · GitHub

Add support for scalar arguments to xp.where - #78

Merged
ev-br merged 6 commits into
data-apis:mainfrom
betatim:where-with-scalars
Feb 3, 2025
Merged

Add support for scalar arguments to xp.where#78
ev-br merged 6 commits into
data-apis:mainfrom
betatim:where-with-scalars

Conversation

betatim commented Oct 31, 2024

Copy link
Copy Markdown
Member

This is related to data-apis/array-api#807

This only adds support for scalars to where(). If the second or third argument is a scalar it is turned into an array on the same device as condition.

I added 2024.12 as next_supported_version. This means we can use it in the tests. Not sure if we use some kind of dummy value instead of 2024.12?

asmeurer commented Nov 5, 2024

Copy link
Copy Markdown
Member

Some of this overlaps with the stuff I've done over at #82, although I haven't implemented any scalar stuff there yet because it isn't in the standard yet.

ev-br 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'd think it should allow complex x1 and x2, too. Here and in the annotation.

LGTM otherwise!

ev-br 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There's a conflict now, could you please resolve it?

Also, the spec requires that at least one of x1 and x2 is an array. IIUC, this PR allows both of them to be python scalars. As long as this repo is scrupulous in implementing the spec, it should probably check and error out if both are scalars?

ev-br mentioned this pull request Jan 27, 2025
13 tasks

ev-br commented Feb 1, 2025

Copy link
Copy Markdown
Member

A small update to make it adhere to the spec to the letter: betatim#1

betatim commented Feb 3, 2025

Copy link
Copy Markdown
Member Author

Thanks for the PR @ev-br If you'd like to take over the original PR (this PR) to get it done that would be awesome.

ev-br commented Feb 3, 2025

Copy link
Copy Markdown
Member

Happy to oblige @betatim --- thank you!

ev-br merged commit 590a2de into data-apis:main Feb 3, 2025
betatim deleted the where-with-scalars branch February 3, 2025 13:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL