Skip to content

Commit

Permalink
Allow for compound classes = False
Browse files Browse the repository at this point in the history
  • Loading branch information
niekdejonge committed Nov 26, 2023
1 parent 95b9fdb commit 0cead59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ms2query/create_new_library/library_files_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ def add_compound_classes(self,
"""
if compound_classes is True:
compound_classes = select_compound_classes(self.list_of_spectra)
elif compound_classes is not None:
if not isinstance(compound_classes, pd.DataFrame):
raise ValueError("Expected a dataframe or True or None for compound classes")
elif compound_classes is not None and isinstance(compound_classes, pd.DataFrame):
if not compound_classes.index.name == "inchikey":
raise ValueError("Expected a pandas dataframe with inchikey as index name")
elif compound_classes is False or compound_classes is None:
compound_classes = None
else:
raise ValueError("Expected a dataframe or True or None for compound classes")
return compound_classes

def create_sqlite_file(self):
Expand Down

0 comments on commit 0cead59

Please sign in to comment.