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

Update guidance concerning mixing arrays with Python scalars to handle complex #513

Merged
merged 1 commit into from
Nov 21, 2022

Conversation

kgryte
Copy link
Contributor

@kgryte kgryte commented Nov 21, 2022

This PR

  • updates the guidance concerning mixing arrays with Python scalars. The current specification accommodates bool and real-valued data types. This PR updates the guidance to accommodate mixing a complex Python scalar with arrays. Guidance is intentionally limited to when a scalar is complex and an array has a complex floating-point array data type.
  • does not specify what happens when a scalar is complex and an array has a real-valued array data type. Behavior is left implementation-specific (e.g., promotion, exception, etc). Given that current guidance requires converting a scalar to the array data type, to accommodate complex scalars and real-valued arrays, we'd need to specify casting rules for complex to real, which is something the specification has thus far avoided (e.g., astype, real, imag, conj, et al). This PR aims to be consistent with those prior decisions.

@kgryte kgryte added Narrative Content Narrative documentation content. topic: Complex Data Types Complex number data types. topic: Type Promotion Type promotion. labels Nov 21, 2022
@kgryte kgryte added this to the v2022 milestone Nov 21, 2022
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

This looks logical and straightforward to me, so I'll merge it. Thanks @kgryte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Narrative Content Narrative documentation content. 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.

2 participants