Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hydrolysis families and tests #770

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open

Hydrolysis families and tests #770

wants to merge 43 commits into from

Conversation

LeenFahoum
Copy link

new hydrolysis families and tests

alongd added 30 commits November 6, 2024 14:05
were used to report the git branch and commit of the repos
ARC reaction families are families for which only a template/recipe is given without kinetic data. They can be used by ARC to atom-map a reaction and search for a transition state just like RMG families. They have the same format as the `group.py` file in RMG reaction families, only here the files are named by the family label. ARC families should be located under ARC/data/families/ to be discovered by ARC.

Also added ARC_FAMILIES_PATH to settings
Currently the rmgdb module is only used by processor which will be dealt with in a different PR
It is no longer an object, no need to call family.label
No need to call determine_family() since family is now a property of reaction
from arc.mapping.engine import (assign_labels_to_products,
are_adj_elements_in_agreement,
create_qc_mol,
flip_map,
fingerprint,
get_atom_indices_of_labeled_atoms_in_an_rmg_reaction,
get_rmg_reactions_from_arc_reaction,
get_atom_indices_of_labeled_atoms_in_a_reaction,

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'get_atom_indices_of_labeled_atoms_in_a_reaction' may not be defined if module
arc.mapping.engine
is imported before module
arc.mapping.driver
, as the
definition
of get_atom_indices_of_labeled_atoms_in_a_reaction occurs after the cyclic
import
of arc.mapping.driver.
find_all_bdes,
cut_species_based_on_atom_indices,
update_xyz,
RESERVED_FINGERPRINT_KEYS,)
RESERVED_FINGERPRINT_KEYS,

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'RESERVED_FINGERPRINT_KEYS' may not be defined if module
arc.mapping.engine
is imported before module
arc.mapping.driver
, as the
definition
of RESERVED_FINGERPRINT_KEYS occurs after the cyclic
import
of arc.mapping.driver.
from arc.common import convert_list_index_0_to_1, extremum_list, generate_resonance_structures, logger, key_by_val
from arc.exceptions import SpeciesError
from arc.reaction.family import ReactionFamily, get_reaction_family_products

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'ReactionFamily' may not be defined if module
arc.reaction.family
is imported before module
arc.mapping.engine
, as the
definition
of ReactionFamily occurs after the cyclic
import
of arc.mapping.engine.
from arc.common import convert_list_index_0_to_1, extremum_list, generate_resonance_structures, logger, key_by_val
from arc.exceptions import SpeciesError
from arc.reaction.family import ReactionFamily, get_reaction_family_products

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'get_reaction_family_products' may not be defined if module
arc.reaction.family
is imported before module
arc.mapping.engine
, as the
definition
of get_reaction_family_products occurs after the cyclic
import
of arc.mapping.engine.
"""
label_dict = get_label_dict(rxn)
if not is_reactants:
product_pairs = pair_reaction_products(reaction=rxn, products=products) if products is not None else None

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable product_pairs is not used.

if TYPE_CHECKING:
from arc.species import ARCSpecies
from arc.reaction.reaction import ARCReaction

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'ARCReaction' may not be defined if module
arc.reaction.reaction
is imported before module
arc.reaction.family
, as the
definition
of ARCReaction occurs after the cyclic
import
of arc.reaction.family.
'ARCReaction' may not be defined if module
arc.reaction.reaction
is imported before module
arc.reaction.family
, as the
definition
of ARCReaction occurs after the cyclic
import
of arc.reaction.family.
Comment on lines +528 to +541
# def get_all_reactions_paths(rxn: 'ARCReaction') -> List['ARCReaction']:
# """
# Get all possible reaction paths with labeled atoms for a given ARC reaction.
#
# Args:
# rxn ('ARCReaction'): The ARC reaction object.
#
# Returns:
# List['ARCReaction']: A list of reactions, each represents a possible reaction path.
# """
# reaction_paths = list()
# for reactant in rxn.get_reactants_and_products(arc=True, return_copies=True)[0]:
# all_reactions.extend(reactant.generate_reactions())
# return all_reactions

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
from arc.common import get_logger
from arc.exceptions import ReactionError, InputError
from arc.reaction.family import ReactionFamily, get_reaction_family_products

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'ReactionFamily' may not be defined if module
arc.reaction.family
is imported before module
arc.reaction.reaction
, as the
definition
of ReactionFamily occurs after the cyclic
import
of arc.reaction.reaction.
from arc.common import get_logger
from arc.exceptions import ReactionError, InputError
from arc.reaction.family import ReactionFamily, get_reaction_family_products

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'get_reaction_family_products' may not be defined if module
arc.reaction.family
is imported before module
arc.reaction.reaction
, as the
definition
of get_reaction_family_products occurs after the cyclic
import
of arc.reaction.reaction.
@@ -0,0 +1,117 @@
import unittest
from rmgpy.molecule import Molecule

Check notice

Code scanning / CodeQL

Unused import Note test

Import of 'Molecule' is not used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants