8000 DOC: Add release notes for complex types changes in 2.x by lysnikolaou · Pull Request #24362 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DOC: Add release notes for complex types changes in 2.x #24362

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

Merged
merged 4 commits into from
Aug 9, 2023

Conversation

lysnikolaou
Copy link
Member

Closes #24361.

@mattip
Copy link
Member
mattip commented Aug 8, 2023

This looks so good it is a shame to hide it in a release note which might get lost with time. Could you merge most of the text with the existing complex section of the npymath docs, which is found in the sources here and leave a short summary in the release note?

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.

Easy links to the release snippet and complex types info.

Build log is showing something off with .. version-changed (line 519 in the log). There is also a warning about a missing ComplexWarning import in scipy, but that should go away once scipy/scipy#19015 makes it into a nightly.

@mattip mattip merged commit adf9794 into numpy:main Aug 9, 2023
@mattip
Copy link
Member
mattip commented Aug 9, 2023

Thanks @lysnikolaou

Comment on lines +4 to +5
* The underlying C types for all of numpy's complex types have been changed to
use C99 complex types.
Copy link
Member

Choose a reason for hiding this comment

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

Is this really true across all platforms and compilers? C99 complex types can be used with all the C arithmetic operators (+, -, *, /). If there are still some platforms where the complex type is being defined with a struct, it won't be possible to use the arithmetic operators with it, so we shouldn't make such a broad claim here. (I just ran into this in #24416, where the attempts to use arithmetic operators fails to compile on some platforms.)

Copy link
Member

Choose a reason for hiding this comment

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

C99 complex types can be used with all the C arithmetic operators (+, -, *, /).

Unfortunately MSVC begs to differ. Their documentation states

Because complex numbers aren't a native type in the Microsoft compiler, the standard arithmetic operators aren't defined on complex types.

Copy link
Member

Choose a reason for hiding this comment

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

That just means Microsoft does not implement C99--no surprise there, that has been the case forever.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, the wording on that page is a bit confusing. It says that it provides all of the function required by the C99 standard, but I guess the types themselves are not C99-compatible. Should we change the wording there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Add documentation and release notes for new complex types
3 participants
0