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 b12cd3d commit 1540f95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_spectrum_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_spectrum_document_metadata_getter():
metadata = {"precursor_mz": 100.0,
"smiles": "testsmiles"}
spectrum_in = Spectrum(mz=mz, intensities=intensities, metadata=metadata)
spectrum_document = SpectrumDocument(spectrum_in, n_decimals=2)
spectrum_document = SpectrumDocument(spectrum_in, n_decimals=2, loss_mz_from=0.0, loss_mz_to=-1.0)

assert spectrum_document.n_decimals == 2
assert len(spectrum_document) == 4
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_spectrum_document_peak_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_document = SpectrumDocument(spectrum_in, n_decimals=2)
spectrum_document = SpectrumDocument(spectrum_in, n_decimals=2, loss_mz_from=0.0, loss_mz_to=-1.0)

assert spectrum_document.words == [
"[email protected]", "[email protected]", "[email protected]", "[email protected]"
Expand All @@ -124,7 +124,7 @@ 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_document = SpectrumDocument(spectrum_in, n_decimals=2)
spectrum_document = SpectrumDocument(spectrum_in, n_decimals=2, loss_mz_from=0.0, loss_mz_to=-1.0)
assert np.all(spectrum_document.losses.mz == np.array([60., 70., 80., 90.])), \
"Expected different losses"
assert np.all(spectrum_document.losses.intensities == intensities[::-1]), \
Expand Down

0 comments on commit 1540f95

Please sign in to comment.