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

Add surface mechanisms to flux diagram tool #2727

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions rmgpy/tools/fluxdiagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,20 +533,21 @@ def load_chemkin_output(output_file, reaction_model):

def create_flux_diagram(input_file, chemkin_file, species_dict, save_path=None, species_path=None, java=False,
settings=None, chemkin_output='', central_species_list=None, superimpose=False,
save_states=False, read_states=False, diffusion_limited=True, check_duplicates=True):
save_states=False, read_states=False, diffusion_limited=True, check_duplicates=True,
surface_path=False):
"""
Generates the flux diagram based on a condition 'input_file', chemkin.inp chemkin_file,
a species_dict txt file, plus an optional chemkin_output file.
"""
if species_path is None:
species_path = os.path.join(os.path.dirname(input_file), 'species')
species_path = os.path.join(os.path.dirname(os.path.abspath(input_file)), 'species')
generate_images = True
else:
generate_images = False

print('Loading RMG job...')
rmg = load_rmg_job(input_file, chemkin_file, species_dict,
generate_images=generate_images, use_java=java, check_duplicates=check_duplicates)
generate_images=generate_images, use_java=java, check_duplicates=check_duplicates, surface_path=surface_path)

if save_path is None:
save_path = os.path.join(rmg.output_directory, 'flux')
Expand Down
8 changes: 6 additions & 2 deletions rmgpy/tools/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def load_rmg_job(
use_java=False,
use_chemkin_names=False,
check_duplicates=True,
surface_path=False,
):
# The argument is an RMG-Py input file
rmg = load_rmg_py_job(
Expand All @@ -59,13 +60,14 @@ def load_rmg_job(
generate_images,
use_chemkin_names=use_chemkin_names,
check_duplicates=check_duplicates,
surface_path=surface_path,
)

return rmg


def load_rmg_py_job(input_file, chemkin_file=None, species_dict=None, generate_images=True,
use_chemkin_names=False, check_duplicates=True):
use_chemkin_names=False, check_duplicates=True, surface_path=False):
"""
Load the results of an RMG-Py job generated from the given `input_file`.
"""
Expand All @@ -83,7 +85,9 @@ def load_rmg_py_job(input_file, chemkin_file=None, species_dict=None, generate_i
species_dict = os.path.join(os.path.dirname(input_file), 'chemkin', 'species_dictionary.txt')
species_list, reaction_list = load_chemkin_file(chemkin_file, species_dict,
use_chemkin_names=use_chemkin_names,
check_duplicates=check_duplicates)
check_duplicates=check_duplicates,
surface_path=surface_path,
)

# Created "observed" versions of all reactive species that are not explicitly
# identified as "constant" species
Expand Down
Loading