We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cb1297 commit e6f1735Copy full SHA for e6f1735
spectrum_utils/spectrum.py
@@ -75,7 +75,7 @@ def intensity(self) -> np.ndarray:
75
def round(
76
self, decimals: int = 0, combine: str = "sum"
77
) -> "MsmsSpectrumJit":
78
- mz_round = np.round_(self._mz, decimals, np.empty_like(self._mz))
+ mz_round = np.round(self._mz, decimals=decimals)
79
mz_unique = np.unique(mz_round)
80
if len(mz_unique) == len(mz_round):
81
self._mz = mz_unique
tests/spectrum_test.py
@@ -49,7 +49,7 @@ def test_mz_array():
49
mz = np.random.uniform(100, 1400, num_peaks).tolist()
50
intensity = np.random.lognormal(0, 1, num_peaks)
51
spec = spectrum.MsmsSpectrum("test_spectrum", 500, 2, mz, intensity)
52
- assert type(spec.mz) == np.ndarray
+ assert isinstance(spec.mz, np.ndarray)
53
with pytest.raises(AttributeError):
54
spec.mz = np.random.uniform(100, 1400, num_peaks)
55
@@ -59,7 +59,7 @@ def test_intensity_array():
59
mz = np.random.uniform(100, 1400, num_peaks)
60
intensity = np.random.lognormal(0, 1, num_peaks).tolist()
61
62
- assert type(spec.intensity) == np.ndarray
+ assert isinstance(spec.intensity, np.ndarray)
63
64
spec.intensity = np.random.lognormal(0, 1, num_peaks)
65
0 commit comments