Skip to content

Commit 5768059

Browse files
committed
Modifying input.py in Arkane so it can read network.py files that have SoluteTSData.
1 parent 2b0610a commit 5768059

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

arkane/input.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
from rmgpy.thermo.wilhoit import Wilhoit
6161
from rmgpy.kinetics.uncertainties import RateUncertainty
6262
from rmgpy.transport import TransportData
63+
from rmgpy.data.solvation import SoluteTSData
6364
from rmgpy.util import as_list
6465

6566
from arkane.common import is_pdep
@@ -637,6 +638,7 @@ def load_input_file(path):
637638
'database': database,
638639
# Jobs
639640
'kinetics': kinetics,
641+
'SoluteTSData': SoluteTSData,
640642
'statmech': statmech,
641643
'thermo': thermo,
642644
'pressureDependence': pressureDependence,
@@ -654,10 +656,15 @@ def load_input_file(path):
654656
load_necessary_databases()
655657

656658
with open(path, 'r') as f:
659+
content = f.read()
657660
try:
658-
exec(f.read(), global_context, local_context)
659-
except (NameError, TypeError, SyntaxError):
661+
exec(content, global_context, local_context)
662+
except (NameError, TypeError, SyntaxError) as e:
660663
logging.error('The input file {0!r} was invalid:'.format(path))
664+
line_number = e.__traceback__.tb_next.tb_lineno
665+
logging.error(f'Error occurred at or near line {line_number} of {path}.')
666+
lines = content.splitlines()
667+
logging.error(f'Line: {lines[line_number - 1]}')
661668
raise
662669

663670
model_chemistry = local_context.get('modelChemistry', None)

0 commit comments

Comments
 (0)