Skip to content

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

Merged
rgommers merged 1 commit into
scipy:mainfrom
ev-br:stray_np_cast
Jul 27, 2023
Merged

rgommers merged 1 commit into
scipy:mainfrom
ev-br:stray_np_cast

Conversation

@ev-br

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

Copy link
Copy Markdown
Member

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) ?

@rgommers rgommers left a comment

Copy link
Copy Markdown
Member

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
@rgommers

Copy link
Copy Markdown
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
Copy Markdown
Member

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

@pllim

pllim commented Jul 27, 2023

Copy link
Copy Markdown
Contributor

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

ev-br commented Jul 27, 2023

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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.

4 participants