Skip to content

Commit f2c9332

Browse files
committed
Modifying input.py in Arkane so it can read network.py files that have SoluteTSData.
1 parent 28c096d commit f2c9332

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
@@ -635,6 +636,7 @@ def load_input_file(path):
635636
'database': database,
636637
# Jobs
637638
'kinetics': kinetics,
639+
'SoluteTSData': SoluteTSData,
638640
'statmech': statmech,
639641
'thermo': thermo,
640642
'pressureDependence': pressureDependence,
@@ -652,10 +654,15 @@ def load_input_file(path):
652654
load_necessary_databases()
653655

654656
with open(path, 'r') as f:
657+
content = f.read()
655658
try:
656-
exec(f.read(), global_context, local_context)
657-
except (NameError, TypeError, SyntaxError):
659+
exec(content, global_context, local_context)
660+
except (NameError, TypeError, SyntaxError) as e:
658661
logging.error('The input file {0!r} was invalid:'.format(path))
662+
line_number = e.__traceback__.tb_next.tb_lineno
663+
logging.error(f'Error occurred at or near line {line_number} of {path}.')
664+
lines = content.splitlines()
665+
logging.error(f'Line: {lines[line_number - 1]}')
659666
raise
660667

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

0 commit comments

Comments
 (0)