Skip to content

Commit

Permalink
fixed mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
dswigh committed Apr 14, 2023
1 parent a5e7bcc commit 8f5cc20
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions orderly/extract/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ def get_rxn_string_and_is_mapped(
@staticmethod
def extract_info_from_rxn_str(
rxn_str: RXN_STR, is_mapped: bool
) -> Optional[
Tuple[REACTANTS, AGENTS, PRODUCTS, RXN_STR, List[MOLECULE_IDENTIFIER]]
]:
) -> Tuple[REACTANTS, AGENTS, PRODUCTS, RXN_STR, List[MOLECULE_IDENTIFIER]]:
"""
Input a reaction object, and return the reactants, agents, products, and the reaction smiles string
"""
Expand Down Expand Up @@ -596,13 +594,8 @@ def handle_reaction_object(
reagents = labelled_reagents
catalysts = labelled_catalysts
is_mapped = False
elif (
(not trust_labelling)
and (rxn_str is None)
and (not use_labelling_if_extract_fails)
):
return None
else:

elif rxn_str is not None:
# extract info from the reaction string
rxn_info = OrdExtractor.extract_info_from_rxn_str(rxn_str, is_mapped)
(
Expand Down Expand Up @@ -641,7 +634,12 @@ def handle_reaction_object(
]
agents += molecules_unique_to_labelled_data

if trust_labelling == False:
else:
return None

if (
not trust_labelling
): # if we don't trust the labelling, we should merge the labelled data with the extracted data into just 'agents' and 'solvents'
# Merge conditions
agents, solvents = OrdExtractor.merge_to_agents(
agents,
Expand Down

0 comments on commit 8f5cc20

Please sign in to comment.