Skip to content

Commit de95f77

Browse files
committed
minor fixes
1 parent 80c1670 commit de95f77

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

ms2query/database/ann_index.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
import numpy as np
66
import pandas as pd
77
from matchms import Spectrum
8-
from ms2deepscore.models import load_model
9-
from ms2deepscore import compute_embedding_array
8+
from ms2deepscore.models import compute_embedding_array, load_model
109
import faiss
1110

1211
from .spectra_merging import ensure_merged_tables # schema with precursor_mz + metadata fields

ms2query/database/compound_database.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def get_fingerprint(self, comp_id: str) -> Optional[Tuple[np.ndarray, np.ndarray
324324
# ---------- batch getters ----------
325325

326326
def get_compounds(self, comp_ids: List[str]) -> pd.DataFrame:
327+
# TODO: Allow returning duplicates? And handle arrays.
327328
"""
328329
Return metadata for many compounds (no fingerprint blobs), order preserved as in comp_ids.
329330
Missing comp_ids are omitted from the result.
@@ -349,12 +350,16 @@ def get_compounds(self, comp_ids: List[str]) -> pd.DataFrame:
349350
return df
350351

351352
def get_fingerprints(self, comp_ids: List[str]) -> List[Optional[Tuple[np.ndarray, np.ndarray]]]:
353+
# TODO: Allow returning duplicates? And handle arrays.
352354
"""
353355
Return a list of fingerprints aligned with comp_ids.
354356
Each item is (bits, counts) or None if not found/empty.
355357
"""
356358
if not comp_ids:
357359
return []
360+
361+
if isinstance(comp_ids, np.ndarray):
362+
comp_ids = [x for x in comp_ids]
358363

359364
placeholders = ",".join("?" for _ in comp_ids)
360365
rows = self._conn.execute(f"""

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"matplotlib",
4444
"skl2onnx",
4545
#"onnx<1.16.2",
46-
#"onnxruntime<1.16", # 1.16 breaks the code due to the issue https://github.com/iomega/ms2query/issues/208
46+
"onnxruntime>1.16", # 1.16 breaks the code due to the issue https://github.com/iomega/ms2query/issues/208
4747
],
4848
extras_require={"dev": ["bump2version",
4949
"isort>=5.1.0",

0 commit comments

Comments
 (0)