Skip to content

Commit aff52e4

Browse files
committed
Linting
1 parent a59e6a9 commit aff52e4

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

ms2query/benchmarking/EvaluateMethods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def benchmark_exact_matching_within_ionmode(
6161
6262
For each inchikey with more than 1 spectrum the spectra are split in two sets. Half for each inchikey is added
6363
to the library (training set), for the other half predictions are made. Thereby there is always an exact match
64-
avaialable. Only the highest ranked prediction is considered correct if the correct inchikey is predicted. An accuracy per
65-
inchikey is calculated followed by calculating the average.
64+
avaialable. Only the highest ranked prediction is considered correct if the correct inchikey is predicted.
65+
An accuracy per inchikey is calculated followed by calculating the average.
6666
"""
6767
selected_spectra = subset_spectra_on_ionmode(self.validation_spectrum_set, ionmode)
6868

ms2query/benchmarking/SpectrumDataSet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ def subset_spectra(self, spectrum_indexes) -> "SpectraWithFingerprints":
112112
# Only keep the fingerprints for which we have inchikeys.
113113
# Important note: This is not a deep copy!
114114
# And the fingerprint is not reset (so it is not always actually matching the most common inchi)
115-
new_instance.inchikey_fingerprint_pairs = {inchikey: self.inchikey_fingerprint_pairs[inchikey] for inchikey in new_instance.spectrum_indexes_per_inchikey.keys()}
115+
new_instance.inchikey_fingerprint_pairs = {inchikey: self.inchikey_fingerprint_pairs[inchikey] for inchikey
116+
in new_instance.spectrum_indexes_per_inchikey.keys()}
116117
return new_instance
117118

118119

ms2query/benchmarking/reference_methods/PredictMS2DeepScoreSimilarity.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def predict_top_ms2deepscores(
2121
k: Number of highest matches to return
2222
2323
Returns:
24-
List[List[int]: indexes of highest scores and the value for the highest score. Per query embedding the top k highest indexes are given.
24+
List[List[int]: indexes of highest scores and the value for the highest score.
25+
Per query embedding the top k highest indexes are given.
2526
List[List[float]: the highest scores.
2627
"""
2728
top_indexes_per_batch = []

ms2query/benchmarking/reference_methods/predict_using_closest_tanimoto.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ def predict_using_closest_tanimoto(
2525
return inchikeys_of_best_match, highest_scores
2626

2727

28-
def predict_using_closest_tanimoto_single_spectrum(spectra_with_embeddings, single_spectrum_with_embeddings,
29-
nr_of_closest_inchikeys_to_select,
30-
nr_of_inchikeys_with_highest_ms2deepscore_to_select) -> Tuple[str, float]:
28+
def predict_using_closest_tanimoto_single_spectrum(
29+
spectra_with_embeddings, single_spectrum_with_embeddings,
30+
nr_of_closest_inchikeys_to_select, nr_of_inchikeys_with_highest_ms2deepscore_to_select) -> Tuple[str, float]:
3131
if len(single_spectrum_with_embeddings.spectra) != 1:
3232
raise ValueError("expected a single spectrum")
3333
ms2deepscores = cosine_similarity_matrix(single_spectrum_with_embeddings.embeddings,

ms2query/benchmarking/reference_methods/predict_with_integrated_similarity_flow.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def integrated_similarity_flow(
8282
predicted_scores: List[float], similarities: np.ndarray, nr_of_spectra_per_inchikey: List[float]
8383
) -> List[float]:
8484
"""Compute the confidence of the prediction for each candidate.
85-
Integrated similarity flow (ISF) scores are calculated using the similarity of candidates among each other and their distance to the query spectrum.
85+
Integrated similarity flow (ISF) scores are calculated using the similarity of candidates among each other
86+
and their distance to the query spectrum.
8687
8788
Args:
8889
distances (list): Distances of the candidates to the query spectrum in the chemical space.

0 commit comments

Comments
 (0)