numpy 2 breaks the int-encoding representation of the BP tree
- Dominant language
- JavaScript
- Stars
- 56
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
As documented in #561.
As far as I can tell, there are two possible solutions:
1. Pin `numpy < 2`
2. Update `empress.tools.shifting()` to convert all bits in the input `bitlist` to `int` objects, rather than `np.uint8` objects
For the time being, the first option is easier. But I imagine QIIME 2 will eventually move to using numpy 2, which will mean we'll have to go with the second option. (For reference: the latest release of Q2, 2024.5, uses `numpy=1.26.4` -- which is literally the latest numpy version before the 2.x versions.)
Option 2 isn't really that bad -- I think just adding `bitlist = [int(x) for x in bitlist]` to line 3 of `shifting()` would fix the problem.
Contributor guide
Research direction
Start by locating empress.tools.shifting() and inspect how its bitlist is converted for BP-tree int encoding. Test the reported behavior with NumPy 2, then verify that BP-tree encoding works without the NumPy 1.x pin; the issue suggests converting bitlist elements to int objects as the intended fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy
- Domain
- bioinformatics
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100