Skip to content

Commit

Permalink
Skip NMD for autotst
Browse files Browse the repository at this point in the history
  • Loading branch information
Calvin Pieters committed Dec 1, 2024
1 parent e06ddd1 commit d5449cb
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions arc/checks/ts.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,27 @@ def check_ts(reaction: 'ARCReaction',
if reaction.ts_species.ts_checks['E0'] is None and not reaction.ts_species.ts_checks['e_elect']:
check_rxn_e_elect(reaction=reaction, verbose=verbose)

if 'freq' in checks or (not reaction.ts_species.ts_checks['NMD'] and job is not None):
try:
check_normal_mode_displacement(reaction, job=job)
except (ValueError, KeyError) as e:
logger.error(f'Could not check normal mode displacement, got: \n{e}')
reaction.ts_species.ts_checks['NMD'] = True
if skip_nmd and not reaction.ts_species.ts_checks['NMD']:
logger.warning(f'Skipping normal mode displacement check for TS {reaction.ts_species.label}')
if 'freq' in checks or (not reaction.ts_species.ts_checks.get('NMD', False) and job is not None):
# Check if the job adapter is 'autotst' to decide whether to skip NMD
if job.species[0].chosen_ts_method == "autotst":
logger.info(
f'Skipping normal mode displacement check for TS {reaction.ts_species.label} '
f'due to job adapter "autotst".'
)
reaction.ts_species.ts_checks['NMD'] = True
else:
try:
check_normal_mode_displacement(reaction, job=job)
except (ValueError, KeyError) as e:
logger.error(f'Could not check normal mode displacement, got: \n{e}')
reaction.ts_species.ts_checks['NMD'] = True

# Handle skipping NMD based on the `skip_nmd` flag
if skip_nmd and not reaction.ts_species.ts_checks.get('NMD', False):
logger.warning(
f'Skipping normal mode displacement check for TS {reaction.ts_species.label}.'
)
reaction.ts_species.ts_checks['NMD'] = True

if 'rotors' in checks or (ts_passed_checks(species=reaction.ts_species, exemptions=['E0', 'warnings', 'IRC'])
and job is not None):
Expand Down

0 comments on commit d5449cb

Please sign in to comment.