diff --git a/t3/logger.py b/t3/logger.py index c8c5df07..91a1d0de 100644 --- a/t3/logger.py +++ b/t3/logger.py @@ -177,11 +177,8 @@ def log_species_to_calculate(self, Args: species_keys (List[int]): Entries are T3 species indices. species_dict (dict): The T3 species dictionary. - - Todo: - Log the reasons one by one with line breaks and enumerate """ - if len(species_keys): + if len(species_keys) and any(spc_dict['compute_thermo'] for spc_dict in species_dict.values()): self.info('\n\nSpecies to calculate thermodynamic data for:') max_label_length = max([len(spc_dict['QM label']) for key, spc_dict in species_dict.items() if key in species_keys]) @@ -193,6 +190,8 @@ def log_species_to_calculate(self, self.info(f'-----{space1} ------{space2} -----------------------------') for key in species_keys: spc_dict = species_dict[key] + if not spc_dict['compute_thermo']: + continue smiles = spc_dict['object'].molecule[0].to_smiles() space1 = ' ' * (max_label_length - len(spc_dict['QM label']) + 1) space2 = ' ' * (max_smiles_length - len(smiles) + 1) diff --git a/t3/main.py b/t3/main.py index ff2341df..64386601 100755 --- a/t3/main.py +++ b/t3/main.py @@ -321,7 +321,7 @@ def execute(self): self.run_arc(arc_kwargs=self.qm) self.process_arc_run() if not additional_calcs_required and self.iteration >= len(self.rmg['model']['core_tolerance']): - # T3 iterated through all of the user requested tolerances, and there are no more calculations required + # T3 iterated through all the user requested tolerances, and there are no more calculations required break if self.check_overtime(): @@ -1231,6 +1231,7 @@ def load_species_and_reactions_from_chemkin_file(self) -> Tuple[List[Species], L def add_species(self, species: Species, reasons: Union[List[str], str], + compute_thermo: bool = True, ) -> Optional[int]: """ Add a species to self.species and to self.qm['species']. @@ -1239,6 +1240,7 @@ def add_species(self, Args: species (Species): The species to consider. reasons (Union[List[str], str]): Reasons for calculating this species. + compute_thermo (bool, optional): Whether to compute thermo for this species (default: ``True``). Returns: Optional[int]: The T3 species index (the respective self.species key) if the species was just added, @@ -1256,6 +1258,7 @@ def add_species(self, 'reasons': reasons, 'converged': None, 'iteration': self.iteration, + 'compute_thermo': compute_thermo, } # Check whether T3 has xyz information for this species, if so process it. @@ -1274,7 +1277,7 @@ def add_species(self, xyzs.append(xyz_dict) if len(xyzs): if self.qm['adapter'] == 'ARC': - # Make qm_species and ARCSpecies instance to consider the xyz information + # Make qm_species an ARCSpecies instance to consider the xyz information qm_species = ARCSpecies(label=qm_species.label, rmg_species=qm_species, xyz=xyzs, @@ -1283,6 +1286,17 @@ def add_species(self, else: raise NotImplementedError(f"Passing XYZ information to {self.qm['adapter']} " f"is not yet implemented.") + if not self.species_requires_refinement(qm_species): + if isinstance(qm_species, ARCSpecies): + qm_species.compute_thermo = False + qm_species.include_in_thermo_lib = False + else: + qm_species = ARCSpecies(label=qm_species.label, + rmg_species=qm_species, + xyz=None, + compute_thermo=False, + include_in_thermo_lib=False, + ) self.qm['species'].append(qm_species) return key