MannLabs / alphatims

An open-source Python package for efficient accession and visualization of Bruker TimsTOF raw data from the Mann Labs at the Max Planck Institute of Biochemistry.
https://doi.org/10.1016/j.mcpro.2021.100149
Apache License 2.0
81 stars 25 forks source link

Numpy Dependency issue "Attribute not found" #270

Closed Luxxii closed 1 year ago

Luxxii commented 1 year ago

Describe the bug Hey all, i am starting to explore TIMS data and already knew about this tool and had finally some time to try it out. During Indexing the spectra (in MGF conversion) i got the following error:

AttributeError: module 'numpy' has no attribute 'int'

To Reproduce

  1. To reproduce just execute the following alphatims export mgf (with numpy >=1.24.0)

Expected behavior No error and i get an MGF (for testing)

Logs Just for completeness, here the full error:

    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Version (please complete the following information): I tried this with a new environment and just executed pip install alphatims

Package         Version
--------------- ---------
alphatims       1.0.7
click           8.1.3
h5py            3.9.0
llvmlite        0.40.1rc1
numba           0.57.0
numpy           1.24.3
pandas          2.0.2
pip             23.1.2
psutil          5.9.5
python-dateutil 2.8.2
pytz            2023.3
pyzstd          0.15.7
setuptools      67.8.0
six             1.16.0
tqdm            4.65.0
tzdata          2023.3
wheel           0.40.0

Additional context Also in issue #25 this was mentioned!

To fix this issue, it is enough to run pip install numpy==1.23.5 (the version before they remove int as dtype).

It would be great if you could update the requirements.txt and include it there. Alternatively you could also update this line to np.int64.

sander-willems-bruker commented 1 year ago

Thanks for reporting this. It will be fixed in the next release.