From a15a72cbd2174fe12321f926d53f183372b43921 Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Fri, 28 Jul 2023 11:15:54 +0300 Subject: [PATCH 1/3] Keep species label if given when loading from Arkane YAML file --- arc/species/species.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arc/species/species.py b/arc/species/species.py index 81823f2c50..66927c5337 100644 --- a/arc/species/species.py +++ b/arc/species/species.py @@ -921,7 +921,7 @@ def from_yml_file(self, label: str = None) -> bool: # The data from the YAML file is loaded into the `species` argument of the `load_yaml` method in Arkane yml_content = read_yaml_file(self.yml_path) arkane_spc.load_yaml(path=self.yml_path, label=label, pdep=False) - self.label = label if label is not None else arkane_spc.label + self.label = label or self.label or arkane_spc.label self.final_xyz = xyz_from_data(coords=arkane_spc.conformer.coordinates.value, numbers=arkane_spc.conformer.number.value) if 'mol' in yml_content: From 90a7eba34f03bdc915dd9fd206cf1994f98c72ed Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Fri, 28 Jul 2023 11:16:51 +0300 Subject: [PATCH 2/3] Consider the original species label when loading a reaction from dict --- arc/reaction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arc/reaction.py b/arc/reaction.py index 3e1732de61..f9f42637de 100644 --- a/arc/reaction.py +++ b/arc/reaction.py @@ -302,10 +302,10 @@ def from_dict(self, self.r_species, self.p_species = list(), list() for spc in species_list: for r_spc_dict in reaction_dict['r_species']: - if spc.label == r_spc_dict['label']: + if r_spc_dict['label'] in [spc.label, spc.original_label]: self.r_species.append(spc) for p_spc_dict in reaction_dict['p_species']: - if spc.label == p_spc_dict['label']: + if p_spc_dict['label'] in [spc.label, spc.original_label]: self.p_species.append(spc) else: self.r_species = [ARCSpecies(species_dict=r_dict) for r_dict in reaction_dict['r_species']] \ From d5d9c8726f6aa75833b70f388b28c91f9d7831d8 Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Wed, 16 Aug 2023 21:23:52 +0300 Subject: [PATCH 3/3] Minor: Clean nul and run.out files generated when running species tests directly in the arc/species folder --- arc/species/species_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arc/species/species_test.py b/arc/species/species_test.py index 137d7842a5..b2816a5944 100644 --- a/arc/species/species_test.py +++ b/arc/species/species_test.py @@ -2645,7 +2645,8 @@ def tearDownClass(cls): project_directory = os.path.join(ARC_PATH, 'Projects', project) shutil.rmtree(project_directory, ignore_errors=True) - file_paths = [os.path.join(ARC_PATH, 'nul'), os.path.join(ARC_PATH, 'run.out')] + file_paths = [os.path.join(ARC_PATH, 'nul'), os.path.join(ARC_PATH, 'run.out'), + os.path.join(ARC_PATH, 'arc', 'species', 'nul'), os.path.join(ARC_PATH, 'arc', 'species', 'run.out')] for file_path in file_paths: if os.path.isfile(file_path): os.remove(file_path)