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 BP tree corruption due to numpy uints #563

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fedarko
Copy link
Collaborator

@fedarko fedarko commented Aug 3, 2024

Closes #562 (which was the cause of the problem discussed in #561).

Strangely enough, I can't seem to get Empress' Python code running within a conda environment that has numpy 2 installed -- I get a weird error from bp/_bp.pyx saying that ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject. But presumably it is possible to get numpy 2 and empress working together, because that was the set of circumstances that led to #561.

Anyway, all this to say that this PR should fix #562 and make Empress compatible with numpy 2. I can't guarantee that, since I haven't been able to get iow + numpy 2 to play nicely together on my system ... but I imagine we'll eventually need to support numpy 2 anyway, so we may as well address this now.

Edit: the build is broken for other reasons (the main build is broken due to -- it looks like -- Q2 2020.6 not being installable any more, due to seaborn version jank?; and the standalone python 3.7 build is broken due to an old version of skbio). I guess fixing the build will be another PR ...

fedarko added 2 commits August 2, 2024 18:03
Ideally we would test this on numpy v2, but I can't seem to get empress
running with numpy v2 on my system (get a cython error from iow).

in any case this should address the problem
far as i can tell, both my system and gh actions are using flake8
7.1.0, so idk why only gh actions complained about the 80 char
line length. whatever it's worth fixing i guess
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.

numpy 2 breaks the int-encoding representation of the BP tree
1 participant