Skip to content

Commit

Permalink
fix shuffling
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-huber committed Aug 14, 2023
1 parent 93677a7 commit 30de0be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ms2deepscore/spectrum_pair_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SelectedCompoundPairs:
This is meant to be used with the results of the `compute_spectrum_pairs()` function.
The therein selected (cherrypicked) scores are stored similar to a list-of-lists format.
"""
def __init__(self, coo_array, inchikeys, shuffling: bool = True):
self._scores = []
Expand Down
4 changes: 2 additions & 2 deletions tests/test_spectrum_pair_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_SCP_initialization(dummy_data):
def test_SCP_shuffle(dummy_data):
data, row, col, inchikeys = dummy_data
coo = coo_array((data, (row, col)))
scp = SelectedCompoundPairs(coo, inchikeys)
scp = SelectedCompoundPairs(coo, inchikeys, shuffling=False)

original_cols = [r.copy() for r in scp._cols]
original_scores = [s.copy() for s in scp._scores]
Expand All @@ -179,7 +179,7 @@ def test_SCP_shuffle(dummy_data):
def test_SCP_next_pair_for_inchikey(dummy_data):
data, row, col, inchikeys = dummy_data
coo = coo_array((data, (row, col)))
scp = SelectedCompoundPairs(coo, inchikeys)
scp = SelectedCompoundPairs(coo, inchikeys, shuffling=False)

score, inchikey2 = scp.next_pair_for_inchikey("Inchikey1")
assert score == 0.7
Expand Down

0 comments on commit 30de0be

Please sign in to comment.