Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid crushing when can't trsh scan #763

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions arc/job/trsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

import math
import os
import re
from typing import List, Optional, Tuple, Union

import numpy as np
import pandas as pd
import re

from arc.common import (check_torsion_change,
convert_to_hours,
Expand All @@ -18,26 +18,26 @@
get_number_with_ordinal_indicator,
is_same_pivot,
is_same_sequence_sublist,
is_str_float
is_str_float,
)
from arc.exceptions import InputError, SpeciesError, TrshError
from arc.imports import settings
from arc.level import Level
from arc.job.local import execute_command
from arc.job.ssh import SSHClient
from arc.level import Level
from arc.species import ARCSpecies
from arc.species.conformers import determine_smallest_atom_index_in_scan
from arc.species.converter import (displace_xyz, ics_to_scan_constraints)
from arc.species.converter import displace_xyz, ics_to_scan_constraints
from arc.species.species import determine_rotor_symmetry
from arc.species.vectors import calculate_dihedral_angle, calculate_distance

from arc.parser import (parse_1d_scan_coords,
parse_normal_mode_displacement,
parse_scan_args,
parse_scan_conformers,
parse_xyz_from_file,
)


logger = get_logger()


Expand Down Expand Up @@ -1537,8 +1537,9 @@ def scan_quality_check(label: str,
# Find the dihedrals in degrees of the lowest conformer:
min_index = np.argmin(energies)
conf_xyzs = parse_1d_scan_coords(log_file)
actions = {'change conformer': conf_xyzs[min_index]}
return invalidate, invalidation_reason, message, actions
if len(conf_xyzs) > min_index:
actions = {'change conformer': conf_xyzs[min_index]}
return invalidate, invalidation_reason, message, actions

# 1.3 Check consistency
if 0 in changed_ic_dict.keys() and len(changed_ic_dict) == 1:
Expand Down
Loading