diff --git a/rmgpy/tools/fluxdiagram.py b/rmgpy/tools/fluxdiagram.py index 8a472046e0..00d4e39eb6 100644 --- a/rmgpy/tools/fluxdiagram.py +++ b/rmgpy/tools/fluxdiagram.py @@ -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') diff --git a/rmgpy/tools/loader.py b/rmgpy/tools/loader.py index de7546ed48..0c7ad00bad 100644 --- a/rmgpy/tools/loader.py +++ b/rmgpy/tools/loader.py @@ -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( @@ -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`. """ @@ -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