Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: define complex scalar <op> fp array #871

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

ev-br
Copy link
Member

@ev-br ev-br commented Dec 10, 2024

Closes gh-841, which continued from #478. If I read the discussion right, there is a general support for allowing binary operations between a python complex scalar and a floating-point array.

The proposed wording tries to be explicit about preserving the precision: (1j*single_precision_array).dtype == single_precision_complex and (1j*double_precision_array).dtype == double_precision_complex. As long as we don't have to worry about half- or extended precision, being explicit feels simplest.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@rgommers rgommers added this to the v2024 milestone Dec 11, 2024
@kgryte kgryte added API change Changes to existing functions or objects in the API. topic: Complex Data Types Complex number data types. topic: Type Promotion Type promotion. Needs Changes Pull request which needs changes before being merged. labels Dec 12, 2024
@kgryte kgryte removed the Needs Changes Pull request which needs changes before being merged. label Feb 6, 2025
@kgryte
Copy link
Contributor

kgryte commented Feb 6, 2025

Made a couple of small tweaks, but otherwise this LGTM. Thanks, @ev-br and @lucascolley.

@kgryte kgryte changed the title doc: define complex scalar <op> fp array feat: define complex scalar <op> fp array Feb 6, 2025
@kgryte kgryte merged commit c7476ba into data-apis:main Feb 6, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change Changes to existing functions or objects in the API. topic: Complex Data Types Complex number data types. topic: Type Promotion Type promotion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arithmetic between real arrays and Python complex scalars (revisited)
4 participants