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

MAINT: linalg: remove a stray np.cast #18973

Merged
merged 1 commit into from Jul 27, 2023
Merged

Conversation

ev-br
Copy link
Member

@ev-br ev-br commented Jul 27, 2023

Reference issue

numpy/numpy#24144 (comment)

What does this implement/fix?

Remove a stray call to np.cast.

Additional information

Now, without looking it up: what is the result of _I = np.cast['F'](1j) ?

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.

Thanks Evgeni.

Now, without looking it up: what is the result of _I = np.cast['F'](1j) ?

Got it wrong;) Honestly, I even had to look up dtype='F'. Always have to think hard about those letters, this should be spelled dtype=np.complex64. Also, the _I variable is only used in two places it looks like, so ideally it shouldn't have been there at all. But never mind, if needed that can be tweaked at a later date. This PR fixes the immediate issue.

@rgommers rgommers merged commit 73c8d7b into scipy:main Jul 27, 2023
21 of 25 checks passed
@rgommers
Copy link
Member

I also manually triggered the nightly wheel builds on main, to get a new nightly up quickly (may help JAX or scikit-learn).

@rgommers rgommers added this to the 1.12.0 milestone Jul 27, 2023
@rgommers rgommers added backport-candidate This fix should be ported by a maintainer to previous SciPy versions. and removed backport-candidate This fix should be ported by a maintainer to previous SciPy versions. labels Jul 27, 2023
@larsoner
Copy link
Member

Thanks @rgommers we just hit this in mne-tools/mne-python#11760 (comment) !

@pllim
Copy link
Contributor

pllim commented Jul 27, 2023

Hello and thanks for this patch! Any chance scipy dev wheel can be updated with this included? Otherwise, I get import error if I test downstream with both numpy dev and scipy dev wheels.

@ev-br
Copy link
Member Author

ev-br commented Jul 27, 2023

so ideally it shouldn't have been there at all.

Yes, could have been just 1j, but then combined with things being arrays or 0D arrays or numpy scalars or python scalars... Safer just keep it as it was :-).

@rgommers
Copy link
Member

New wheels uploaded to https://anaconda.org/scientific-python-nightly-wheels/scipy/files minutes ago (some are still trickling in). Please let me know if that didn't do the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks scipy.linalg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants