Skip to content

Commit

Permalink
Update test_spectrum_document.py
Browse files Browse the repository at this point in the history
  • Loading branch information
niekdejonge authored Aug 6, 2024
1 parent d4ee4e9 commit 97432d3
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions tests/test_spectrum_document.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np
import pytest
from matchms import Spectrum
from matchms.filtering import add_losses
from spec2vec import SpectrumDocument


Expand Down Expand Up @@ -42,7 +41,6 @@ def test_spectrum_document_init_default_with_losses():
intensities = np.array([0, 0.01, 0.1, 1], dtype="float")
metadata = dict(precursor_mz=100.0)
spectrum_in = Spectrum(mz=mz, intensities=intensities, metadata=metadata)
spectrum = add_losses(spectrum_in)
spectrum_document = SpectrumDocument(spectrum)

assert spectrum_document.n_decimals == 2, "Expected different default for n_decimals"
Expand All @@ -60,7 +58,6 @@ def test_spectrum_document_init_n_decimals_1():
intensities = np.array([0, 0.01, 0.1, 1], dtype="float")
metadata = dict(precursor_mz=100.0)
spectrum_in = Spectrum(mz=mz, intensities=intensities, metadata=metadata)
spectrum = add_losses(spectrum_in)
spectrum_document = SpectrumDocument(spectrum, n_decimals=1)

assert spectrum_document.n_decimals == 1
Expand Down Expand Up @@ -127,7 +124,6 @@ def test_spectrum_document_losses_getter():
intensities = np.array([0, 0.01, 0.1, 1], dtype="float")
metadata = {"precursor_mz": 100.0}
spectrum_in = Spectrum(mz=mz, intensities=intensities, metadata=metadata)
spectrum = add_losses(spectrum_in)
spectrum_document = SpectrumDocument(spectrum, n_decimals=2)
assert np.all(spectrum_document.losses.mz == np.array([60., 70., 80., 90.])), \
"Expected different losses"
Expand Down

0 comments on commit 97432d3

Please sign in to comment.