Skip to content

Commit

Permalink
Minor improvements to run_autotst
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed Jun 18, 2019
1 parent dad2947 commit 086d67c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions arc/ts/run_autotst.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,31 @@ def parse_command_line_arguments(command_line_args=None):
return args


def main():
def main(reaction_label=None, reaction_family=None):
"""
Run AutoTST to generate a TS guess
Currently only works for H Abstraction
"""
# Parse the command-line arguments (requires the argparse module)
args = parse_command_line_arguments()
reaction_label = str(args.reaction_label)
reaction_family = str(args.reaction_family)
if reaction_label is None:
# Parse the command-line arguments (requires the argparse module)
args = parse_command_line_arguments()
reaction_label = str(args.reaction_label)
reaction_family = str(args.reaction_family)
reaction_family = str('H_Abstraction') if reaction_family is None else reaction_family

try:
reaction = AutoTST_Reaction(label=reaction_label, reaction_family=reaction_family)
except AssertionError:
except AssertionError as e:
logger.error('Could not generate a TS guess using AutoTST for reaction {0}'.format(reaction_label))
raise TSError('Could not generate AutoTST guess')
raise TSError('Could not generate AutoTST guess:\n{0}'.format(e.message))
else:
positions = reaction.ts.ase_ts.get_positions()
numbers = reaction.ts.ase_ts.get_atomic_numbers()
xyz_guess = get_xyz_string(coord=positions, number=numbers)

xyz_path = os.path.join(arc_path, 'arc', 'ts', 'auto_tst.xyz')

with open(xyz_path, 'wb') as f:
with open(xyz_path, 'w') as f:
f.write(xyz_guess)


Expand Down

0 comments on commit 086d67c

Please sign in to comment.