diff --git a/ms2query/ms2library.py b/ms2query/ms2library.py index da726ad3..9c5c7cc2 100644 --- a/ms2query/ms2library.py +++ b/ms2query/ms2library.py @@ -386,8 +386,7 @@ def select_files_for_ms2query(file_names: List[str], files_to_select=None): """Selects the files needed for MS2Library based on their file extensions. """ dict_with_file_extensions = \ {"sqlite": ".sqlite", "s2v_model": ".model", "ms2ds_model": ".hdf5", - "ms2query_model": ".onnx", "s2v_embeddings": "s2v_embeddings.pickle", - "ms2ds_embeddings": "ms2ds_embeddings.pickle"} + "ms2query_model": ".onnx"} if files_to_select is not None: dict_with_file_extensions = {key: value for key, value in dict_with_file_extensions.items() if key in files_to_select} diff --git a/tests/conftest.py b/tests/conftest.py index ecd40d0f..7cea3296 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -112,19 +112,3 @@ def hundred_test_spectra(path_to_general_test_files): def expected_tanimoto_scores_df(path_to_general_test_files): return pd.read_csv(os.path.join(path_to_general_test_files, "tanimoto_scores_100_test_spectra.csv"), index_col=0) - - -@pytest.fixture(scope="package") -def expected_ms2ds_embeddings(path_to_general_test_files): - expected_embeddings = load_pickled_file(os.path.join( - path_to_general_test_files, - "100_test_spectra_ms2ds_embeddings.pickle")) - return expected_embeddings - - -@pytest.fixture(scope="package") -def expected_s2v_embeddings(path_to_general_test_files): - expected_embeddings = load_pickled_file(os.path.join( - path_to_general_test_files, - "100_test_spectra_s2v_embeddings.pickle")) - return expected_embeddings diff --git a/tests/test_files/100_test_spectra_ms2ds_embeddings.pickle b/tests/test_files/100_test_spectra_ms2ds_embeddings.pickle deleted file mode 100644 index e712e5ad..00000000 Binary files a/tests/test_files/100_test_spectra_ms2ds_embeddings.pickle and /dev/null differ diff --git a/tests/test_files/100_test_spectra_s2v_embeddings.pickle b/tests/test_files/100_test_spectra_s2v_embeddings.pickle deleted file mode 100644 index 4ed6e822..00000000 Binary files a/tests/test_files/100_test_spectra_s2v_embeddings.pickle and /dev/null differ diff --git a/tests/test_library_files_creator.py b/tests/test_library_files_creator.py index 34f74475..bb50b390 100644 --- a/tests/test_library_files_creator.py +++ b/tests/test_library_files_creator.py @@ -22,30 +22,6 @@ def test_give_already_used_file_name(tmp_path, path_to_general_test_files, hundr LibraryFilesCreator(hundred_test_spectra, tmp_path) -def test_create_ms2ds_embeddings(tmp_path, path_to_general_test_files, - hundred_test_spectra, - expected_ms2ds_embeddings, - ms2deepscore_model_file_name): - """Tests store_ms2ds_embeddings""" - library_spectra = [normalize_and_filter_peaks(s) for s in hundred_test_spectra if s is not None] - embeddings = create_ms2ds_embeddings(ms2ds_model=load_ms2ds_model(ms2deepscore_model_file_name), - list_of_spectra=library_spectra) - pd.testing.assert_frame_equal(embeddings, expected_ms2ds_embeddings, - check_exact=False, - atol=1e-5) - - -def test_create_s2v_embeddings(tmp_path, path_to_general_test_files, hundred_test_spectra, - expected_s2v_embeddings, - spec2vec_model_file_name): - """Tests store_ms2ds_embeddings""" - library_spectra = [normalize_and_filter_peaks(s) for s in hundred_test_spectra if s is not None] - - embeddings = create_s2v_embeddings(Word2Vec.load(spec2vec_model_file_name), library_spectra) - pd.testing.assert_frame_equal(embeddings, expected_s2v_embeddings, - check_exact=False, - atol=1e-5) - def check_sqlite_files_are_equal(new_sqlite_file_name, reference_sqlite_file, check_metadata=True): """Raises an error if the two sqlite files are not equal""" # Test if file is made