From 0ff829a1fca6a81e79ccbe39af6bb000273cddae Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Sun, 18 Aug 2024 10:08:39 +0300 Subject: [PATCH 1/2] Organised imports in job trsh --- arc/job/trsh.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arc/job/trsh.py b/arc/job/trsh.py index df27442b5c..ade06a3675 100644 --- a/arc/job/trsh.py +++ b/arc/job/trsh.py @@ -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, @@ -18,18 +18,19 @@ 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, @@ -37,7 +38,6 @@ parse_xyz_from_file, ) - logger = get_logger() From 82f6c480e29fbc51bc2a8b522a65bfc37cca5fb3 Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Sun, 18 Aug 2024 10:10:17 +0300 Subject: [PATCH 2/2] BugFix: Only call conf_xyzs[min_index] if the length makes sense --- arc/job/trsh.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arc/job/trsh.py b/arc/job/trsh.py index ade06a3675..815296b93b 100644 --- a/arc/job/trsh.py +++ b/arc/job/trsh.py @@ -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: