Skip to content

Commit 77c68bf

Browse files
committed
BugFix: Check the PDep method before using the METHOD_MAP dict
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.
1 parent e69e8a2 commit 77c68bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t3/utils/writer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def write_rmg_input_file(rmg: dict,
233233
)
234234

235235
# pressureDependence
236-
pdep = rmg['pdep']
236+
pdep = rmg['pdep'].copy()
237237
if pdep is not None:
238238
pdep_template = """
239239
pressureDependence(
@@ -246,7 +246,7 @@ def write_rmg_input_file(rmg: dict,
246246
maximumAtoms=${max_atoms},
247247
)
248248
"""
249-
pdep['method'] = METHOD_MAP[pdep['method']]
249+
pdep['method'] = pdep['method'] if pdep['method'] in list(METHOD_MAP.values()) else METHOD_MAP[pdep['method']]
250250
pdep['T_min'], pdep['T_max'], pdep['T_count'] = pdep['T']
251251
pdep['P_min'], pdep['P_max'], pdep['P_count'] = pdep['P']
252252
pdep['T_count'], pdep['P_count'] = int(pdep['T_count']), int(pdep['P_count'])

0 commit comments

Comments
 (0)