Skip to content

Commit

Permalink
Use the existing SA path in rmg_constantTP adatper
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed May 2, 2024
1 parent d1d2b42 commit 96c8dac
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions t3/simulate/rmg_constantTP.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,16 @@ def get_sa_coefficients(self) -> Optional[dict]:
sa_dict (Optional[dict]): An SA dictionary, structure is given in the docstring for T3/t3/main.py
"""
chem_to_rmg_rxn_index_map = get_chem_to_rmg_rxn_index_map(chem_annotated_path=self.paths['chem annotated'])
solver_path = os.path.join(self.paths['SA'], 'solver')
if not os.path.exists(solver_path):
self.logger.error("Could not find the path to RMG's SA solver output folder.")
if not os.path.exists(self.paths['SA solver']):
self.logger.error(f"Could not find the path to RMG's SA solver output folder:\n{self.paths['SA solver']}.")
return None
sa_files = list()
for file_ in os.listdir(solver_path):
for file_ in os.listdir(self.paths['SA solver']):
if 'sensitivity' in file_ and file_.endswith(".csv"):
sa_files.append(file_)
sa_dict = {'kinetics': dict(), 'thermo': dict(), 'time': list()}
for sa_file in sa_files:
df = pd.read_csv(os.path.join(solver_path, sa_file))
df = pd.read_csv(os.path.join(self.paths['SA solver'], sa_file))
for header in df.columns:
sa_type = None
if 'Time' in header:
Expand Down

0 comments on commit 96c8dac

Please sign in to comment.