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

Fix compatibility with numpy 2 #382

Merged
merged 4 commits into from
Jul 27, 2024
Merged

Conversation

MartinCapraro
Copy link
Contributor

This PR simply replaces the usage of the deprecated numpy types np.float_ and np.complex_ with np.float64 and np.complex128. This seems to be sufficient to obtain compatibility with numpy 2.0.1.

@MartinCapraro
Copy link
Contributor Author

I should perhaps add some detail to explain how I confirmed this works:

I forked the repo, and removed the restriction in setup.py that numpy<2 is required for installation. I then installed the fork in a new virtualenv with pip install . --use-pep517. I then attempted to run a simple script from the tutorial, fixing the errors as they came up, until the script ran successfully.

The tests also mostly passed. There are two that fail, with the id cluster_10^-4 but they also fail when I cloned the master branch of the main repo. Looking at the github build/test logs (e.g. https://github.com/rparini/cxroots/actions/runs/10121727774/job/27993000890) I actually think they may be excluded from the test action somehow? I don't know if that's intentional.

@rparini rparini linked an issue Jul 27, 2024 that may be closed by this pull request
@rparini
Copy link
Owner

rparini commented Jul 27, 2024

@MartinCapraro thanks for this!

There are two that fail, with the id cluster_10^-4 but they also fail when I cloned the master branch of the main repo. Looking at the github build/test logs (e.g. https://github.com/rparini/cxroots/actions/runs/10121727774/job/27993000890) I actually think they may be excluded from the test action somehow? I don't know if that's intentional

Yes that is a very slow test so I've configured CI to skip it. My expectation is it should pass when run locally so I'll have a look at that sometime. I think it doesn't need to hold up this PR though.

@rparini rparini merged commit 3edb2c2 into rparini:master Jul 27, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add numpy v2 compatibility
2 participants