From 77c68bf45eadd153ef38fcb607647c4d8dba6935 Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Mon, 24 Aug 2020 13:04:34 -0400 Subject: [PATCH] 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. --- t3/utils/writer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t3/utils/writer.py b/t3/utils/writer.py index f8e2a75e..11c8bd30 100644 --- a/t3/utils/writer.py +++ b/t3/utils/writer.py @@ -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( @@ -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'])