Skip to content

Conversation

@kgryte
Copy link
Contributor

@kgryte kgryte commented May 23, 2022

This PR

  • adds complex number support to asarray. Importantly, if one or more values are complex numbers, the output data type must be the default complex floating-point data type.

@kgryte kgryte added API change Changes to existing functions or objects in the API. topic: Complex Data Types Complex number data types. labels May 23, 2022
@kgryte kgryte added this to the v2022 milestone May 23, 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.

LGTM modulo a few small textual things.

@leofang
Copy link
Contributor

leofang commented May 25, 2022

I fail to see why complex should appear before (or after) float with the "precedence" clause, I must be missing something...

@kgryte
Copy link
Contributor Author

kgryte commented May 25, 2022

@leofang Because if at least one value is complex, then the returned array must have a complex data type. Hence, if provided a mixture of complex and float, complex takes precedence. This is similar to type promotion semantics.

@kgryte
Copy link
Contributor Author

kgryte commented Jun 6, 2022

Thanks, @leofang! As this now has two approvals, will merge and any further changes can be addressed through subsequent PRs...

@kgryte kgryte merged commit b09cda6 into main Jun 6, 2022
@kgryte kgryte deleted the cmplx-asarray branch June 6, 2022 20:11
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants