Skip to content

Drop numpy 1 requirement#162

Open
lykos98 wants to merge 7 commits intosissa-data-science:mainfrom
lykos98:drop-numpy1
Open

Drop numpy 1 requirement#162
lykos98 wants to merge 7 commits intosissa-data-science:mainfrom
lykos98:drop-numpy1

Conversation

@lykos98
Copy link
Copy Markdown

@lykos98 lykos98 commented Jun 25, 2025

Proposed changes

Dropped numpy-1.x.x requirement and added support for numpy-2.x

Types of changes

Minimal refactoring at the cython code, swapped only type definitions (eg. np.int / np.int_/np.float ) to numpy 2 counterparts.
I added also worflow dispatch on lint docs and test, in order to assure complete compatibility with your test suite.
I also thank @emaballarin for indicating me the precise modifications to perform.

[UPDATE]

The tests on github actions pass, but one more issue remains. Your tests are up to python version 3.12. Using python-3.13 the specified version of jax (v 0.4.30) is not avaliable. Releasing the dependence on this specific version of jax is problematic since if I use an updated version of jax tests on differentiable information imbalance fail. A more detailed discussion in a second pull request.

@alexdepremia alexdepremia requested a review from aldoglielmo July 21, 2025 13:19
@aldoglielmo
Copy link
Copy Markdown
Collaborator

My apologies @lykos98 and @alexdepremia ... I have completely overlooked this PR. It looks great, and it's much needed. I would be in fsvour of merging. @lykos98 any news came up in the meanwhile?

@imacocco
Copy link
Copy Markdown
Collaborator

can we directly check also jax compatibility?

@aldoglielmo
Copy link
Copy Markdown
Collaborator

can we directly check also jax compatibility?

what do you mean?

@imacocco
Copy link
Copy Markdown
Collaborator

can we directly check also jax compatibility?

what do you mean?

Shall jax version also be updated if we update numpy? I am not an everyday jax user, so I am not aware of the details and it could be that there is no problem in keeping the same jax version (which is now hard-coded to 0.4.30)

emaballarin added a commit to emaballarin/DADApy that referenced this pull request Mar 25, 2026
@lykos98
Copy link
Copy Markdown
Author

lykos98 commented Mar 26, 2026

My apologies @lykos98 and @alexdepremia ... I have completely overlooked this PR. It looks great, and it's much needed. I would be in fsvour of merging. @lykos98 any news came up in the meanwhile?

Hi!
I have not really worked on the patch after the pull request. A fresh repo sync and a run on the tests should be made in order to check if, after a year, everything is fine. Sorry for the spam in the diff, but those fixes require to re-"cythonize" all the .pyx files, thus causing changes to the .c files that in the diff appear as thousands of lines modified. I suggest considering, as a low-priority enhancement, also the "cythonization" on the fly of the .pyx files when either the wheel is built for package release or right before the pip install if it is done from source.

A second thing is the jax compatibility issue. At the moment of the pull request, I found that on Python 3.12 the version of jax required is not available, and changing it breaks some tests on differentiable information imbalance. This needs to be investigated and moved to an issue. I am not familiar with the code of diff information imbalance. Fixing this will also allow dadapy to support more modern Python versions.

From my side in these days I will sync the branch and, in case, fix what breaks.

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