Repository: bittremieux-lab/spectrum_utils

Issue:
Deprecated np.round_ in NumPy ≥ 2.0
like there was a attribute error due to np.round_ as it is depreciated in numpy = > 2.0  used [here](https://github.com/bittremieux-lab/spectrum_utils/blob/main/spectrum_utils/spectrum.py#L78) .

Discussion:

Solution patch:
diff --git a/spectrum_utils/spectrum.py b/spectrum_utils/spectrum.py
index 260a478..8054f4b 100755
--- a/spectrum_utils/spectrum.py
+++ b/spectrum_utils/spectrum.py
@@ -75,7 +75,7 @@ class MsmsSpectrumJit:
     def round(
         self, decimals: int = 0, combine: str = "sum"
     ) -> "MsmsSpectrumJit":
-        mz_round = np.round_(self._mz, decimals, np.empty_like(self._mz))
+        mz_round = np.round(self._mz, decimals=decimals)
         mz_unique = np.unique(mz_round)
         if len(mz_unique) == len(mz_round):
             self._mz = mz_unique


Test patch:
diff --git a/tests/spectrum_test.py b/tests/spectrum_test.py
index a1bc57d..6c164de 100644
--- a/tests/spectrum_test.py
+++ b/tests/spectrum_test.py
@@ -49,7 +49,7 @@ def test_mz_array():
     mz = np.random.uniform(100, 1400, num_peaks).tolist()
     intensity = np.random.lognormal(0, 1, num_peaks)
     spec = spectrum.MsmsSpectrum("test_spectrum", 500, 2, mz, intensity)
-    assert type(spec.mz) == np.ndarray
+    assert isinstance(spec.mz, np.ndarray)
     with pytest.raises(AttributeError):
         spec.mz = np.random.uniform(100, 1400, num_peaks)
 
@@ -59,7 +59,7 @@ def test_intensity_array():
     mz = np.random.uniform(100, 1400, num_peaks)
     intensity = np.random.lognormal(0, 1, num_peaks).tolist()
     spec = spectrum.MsmsSpectrum("test_spectrum", 500, 2, mz, intensity)
-    assert type(spec.intensity) == np.ndarray
+    assert isinstance(spec.intensity, np.ndarray)
     with pytest.raises(AttributeError):
         spec.intensity = np.random.lognormal(0, 1, num_peaks)