Skip to content

Numpy 20 fixes #565

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 23 commits into from
Oct 4, 2024
Merged

Numpy 20 fixes #565

merged 23 commits into from
Oct 4, 2024

Conversation

matthew-brett
Copy link
Member

Working on build / compile and test for Numpy 2.0.

@matthew-brett
Copy link
Member Author

matthew-brett commented Jun 18, 2024

Currently blocked by multiple regular but not deterministic segmentation faults, that seem to be most commonly from fffpy_multi_iterator_delete or elsewhere in the fffpy_multi_iterator stuff. Test files currently causing segmentation faults are:

  • nipy/labs/bindings/tests/test_numpy.py
  • nipy/labs/glm/tests/test_glm.py
  • nipy/labs/utils/tests/test_repro.py
  • nipy/labs/group/tests/test_onesample_stat.py
  • nipy/labs/spatial_models/tests/test_parcel_io.py
  • nipy/labs/group/tests/test_permutation_test.py

No such segmentation faults on Numpy 1.26.4, which tests clean.

@matthew-brett
Copy link
Member Author

matthew-brett commented Jun 18, 2024

@alexis-roche - do you have any time to have a look at what's going on here with fff and Numpy 2.0 crashes?

Procedure is:

virtualenv nipy-env
. ./nipy-env/bin/activate
git clone https://github.com/matthew-brett/nipy
cd nipy
git checkout numpy-20-fixes
pip install meson-python ninja cython numpy pytest spin
spin install
pytest nipy/labs/bindings/tests/test_numpy.py

If it doesn't segfault first time, try running the pytest line a few times.

In case it's useful - Numpy 2.0 changes : https://numpy.org/doc/stable//numpy_2_0_migration_guide.html

@effigies
Copy link
Member

I'm not getting segfaults, but I am getting:

corrupted size vs. prev_size
[1]    769785 IOT instruction (core dumped)  pytest -sv nipy/labs/bindings/tests/test_numpy.py
double free or corruption (out)
[1]    769607 IOT instruction (core dumped)  pytest -sv nipy/labs/bindings/tests/test_numpy.py

I don't have any insights into what's causing this.

numpy.rec is not a module, but a synonym for a module, so cannot be
imported, at least for some versions of Numpy.
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 98.68421% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.61%. Comparing base (3e8409c) to head (d8989ab).
Report is 40 commits behind head on main.

Files with missing lines Patch % Lines
nipy/algorithms/graph/graph.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #565      +/-   ##
==========================================
- Coverage   84.70%   84.61%   -0.09%     
==========================================
  Files         297      293       -4     
  Lines       27590    27479     -111     
  Branches     3361     3362       +1     
==========================================
- Hits        23370    23252     -118     
- Misses       3266     3273       +7     
  Partials      954      954              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@effigies
Copy link
Member

effigies commented Oct 3, 2024

Given Py3.8 is end-of-life next week, might make more sense to just remove support and end testing on it.

@matthew-brett
Copy link
Member Author

Good call - dropped. Tests passing now.

@matthew-brett
Copy link
Member Author

Ah - that turns out to be because Python 3.8 pulls in Numpy < 2, which is the actual problem.

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

LGTM

@matthew-brett
Copy link
Member Author

OK - added back 3.8 to trigger a Numpy < 2 build - and added some Numpy 1.2x fixes to the original Numpy 2.0 Nipy port. I think this is ready now. And it will fix a few of the outstanding issues.

@effigies effigies merged commit 181ea05 into nipy:main Oct 4, 2024
20 of 21 checks passed
@matthew-brett
Copy link
Member Author

matthew-brett commented Oct 7, 2024

Numpy issue with description, discussion, resolution of segfault: numpy/numpy#26765

@matthew-brett matthew-brett deleted the numpy-20-fixes branch October 7, 2024 19:06
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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy