@@ -60,7 +60,7 @@ def test_add_and_retrieve_single(tmp_db):
6060 sid = ids [0 ]
6161 assert isinstance (sid , int )
6262
63- out = tmp_db .retrieve_spectra_by_ids ([sid ])
63+ out = tmp_db .get_spectra_by_ids ([sid ])
6464 assert len (out ) == 1
6565 sp_out = out [0 ]
6666
@@ -81,19 +81,19 @@ def test_add_and_retrieve_multiple_order_preserved(tmp_db, spectra_small):
8181
8282 # request in a permuted order; results should follow request order
8383 req = [ids [2 ], ids [0 ], ids [1 ]]
84- out = tmp_db .retrieve_spectra_by_ids (req )
84+ out = tmp_db .get_spectra_by_ids (req )
8585 assert [sp .metadata ["spec_id" ] for sp in out ] == req
8686
8787 # spot-check one item’s content
8888 s2 = out [1 ] # corresponds to ids[0]
8989 assert s2 .metadata ["precursor_mz" ] == pytest .approx (240.0 )
9090
9191
92- def test_retrieve_fragments_by_ids (tmp_db , spectra_small ):
92+ def test_get_fragments_by_ids (tmp_db , spectra_small ):
9393 ids = tmp_db .add_spectrum (spectra_small )
9494 req = [ids [1 ], ids [1 ], 9999999 , ids [0 ]] # includes duplicate + missing
9595 # Implementation skips missing IDs and preserves order for the present ones
96- frags = tmp_db .retrieve_fragments_by_ids (req )
96+ frags = tmp_db .get_fragments_by_ids (req )
9797 # We expect two results (the duplicate is returned twice; missing is skipped)
9898 assert len (frags ) == 3
9999 (mz_a , in_a ), (mz_b , in_b ), (mz_c , in_c ) = frags
@@ -107,9 +107,9 @@ def test_retrieve_fragments_by_ids(tmp_db, spectra_small):
107107 assert mz_c .shape [0 ] == spectra_small [0 ].mz .shape [0 ]
108108
109109
110- def test_retrieve_metadata_by_ids_df (tmp_db , spectra_small ):
110+ def test_get_metadata_by_ids_df (tmp_db , spectra_small ):
111111 ids = tmp_db .add_spectrum (spectra_small )
112- df = tmp_db .retrieve_metadata_by_ids ([ids [2 ], ids [0 ]])
112+ df = tmp_db .get_metadata_by_ids ([ids [2 ], ids [0 ]])
113113
114114 # Expected columns: spec_id + configured metadata fields
115115 expected_cols = ["spec_id" ] + tmp_db .metadata_fields
@@ -141,9 +141,9 @@ def test_sql_query_simple(tmp_db, spectra_small):
141141def test_missing_ids_handling (tmp_db , spectra_small ):
142142 ids = tmp_db .add_spectrum (spectra_small )
143143 req = [999999 , ids [1 ]]
144- out_spectra = tmp_db .retrieve_spectra_by_ids (req )
145- out_meta = tmp_db .retrieve_metadata_by_ids (req )
146- out_frags = tmp_db .retrieve_fragments_by_ids (req )
144+ out_spectra = tmp_db .get_spectra_by_ids (req )
145+ out_meta = tmp_db .get_metadata_by_ids (req )
146+ out_frags = tmp_db .get_fragments_by_ids (req )
147147
148148 # Implementation skips missing IDs but preserves order of the ones that exist
149149 assert [s .metadata ["spec_id" ] for s in out_spectra ] == [ids [1 ]]
0 commit comments