Skip to content

Commit

Permalink
BugFix: Check the PDep method before using the METHOD_MAP dict
Browse files Browse the repository at this point in the history
The first iteration will assign the value from this dictionary to pdep['method', the T3 will crash at the second iteration, since the corresponding value is not a key in this dict. Here we first check whether the value is already correct, if not we use the mapping dict.
  • Loading branch information
alongd committed Aug 26, 2020
1 parent e69e8a2 commit 77c68bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t3/utils/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def write_rmg_input_file(rmg: dict,
)

# pressureDependence
pdep = rmg['pdep']
pdep = rmg['pdep'].copy()
if pdep is not None:
pdep_template = """
pressureDependence(
Expand All @@ -246,7 +246,7 @@ def write_rmg_input_file(rmg: dict,
maximumAtoms=${max_atoms},
)
"""
pdep['method'] = METHOD_MAP[pdep['method']]
pdep['method'] = pdep['method'] if pdep['method'] in list(METHOD_MAP.values()) else METHOD_MAP[pdep['method']]
pdep['T_min'], pdep['T_max'], pdep['T_count'] = pdep['T']
pdep['P_min'], pdep['P_max'], pdep['P_count'] = pdep['P']
pdep['T_count'], pdep['P_count'] = int(pdep['T_count']), int(pdep['P_count'])
Expand Down

0 comments on commit 77c68bf

Please sign in to comment.