Skip to content

Commit

Permalink
Use output consistently throughout main
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed Aug 11, 2024
1 parent 47d3736 commit 8cb54d1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions arc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,11 @@ def execute(self) -> dict:
ts_adapters=self.ts_adapters,
report_e_elect=self.report_e_elect,
skip_nmd=self.skip_nmd,
output=self.output,
)

save_yaml_file(path=os.path.join(self.project_directory, 'output', 'status.yml'), content=self.scheduler.output)
self.output = self.scheduler.output
save_yaml_file(path=os.path.join(self.project_directory, 'output', 'status.yml'), content=self.output)

Check warning on line 641 in arc/main.py

View check run for this annotation

Codecov / codecov/patch

arc/main.py#L640-L641

Added lines #L640 - L641 were not covered by tests

if not self.keep_checks:
delete_check_files(self.project_directory)
Expand All @@ -650,7 +652,7 @@ def execute(self) -> dict:
project_directory=self.project_directory,
species_dict=self.scheduler.species_dict,
reactions=self.scheduler.rxn_list,
output_dict=self.scheduler.output,
output_dict=self.output,
bac_type=self.bac_type,
freq_scale_factor=self.freq_scale_factor,
compute_thermo=self.compute_thermo,
Expand Down Expand Up @@ -708,7 +710,7 @@ def save_project_info_file(self):
txt += '\nConsidered the following species and TSs:\n'
for species in self.species:
descriptor = 'TS' if species.is_ts else 'Species'
failed = '' if self.scheduler.output[species.label]['convergence'] else ' (Failed!)'
failed = '' if self.output[species.label]['convergence'] else ' (Failed!)'

Check warning on line 713 in arc/main.py

View check run for this annotation

Codecov / codecov/patch

arc/main.py#L713

Added line #L713 was not covered by tests
txt += f'{descriptor} {species.label}{failed} (run time: {species.run_time})\n'
if self.reactions:
for rxn in self.reactions:
Expand All @@ -730,14 +732,14 @@ def save_project_info_file(self):
if not species.is_ts:
spc_dict = dict()
spc_dict['label'] = species.label
spc_dict['success'] = self.scheduler.output[species.label]['convergence']
spc_dict['success'] = self.output[species.label]['convergence']

Check warning on line 735 in arc/main.py

View check run for this annotation

Codecov / codecov/patch

arc/main.py#L735

Added line #L735 was not covered by tests
spc_dict['smiles'] = species.mol.copy(deep=True).to_smiles() if species.mol is not None else None
spc_dict['adj'] = species.mol.copy(deep=True).to_adjacency_list() if species.mol is not None else None
content['species'].append(spc_dict)
for reaction in self.reactions:
rxn_dict = dict()
rxn_dict['label'] = reaction.label
rxn_dict['success'] = self.scheduler.output[reaction.ts_species.label]['convergence']
rxn_dict['success'] = self.output[reaction.ts_species.label]['convergence']

Check warning on line 742 in arc/main.py

View check run for this annotation

Codecov / codecov/patch

arc/main.py#L742

Added line #L742 was not covered by tests
content['reactions'].append(rxn_dict)
save_yaml_file(path=path, content=content)

Expand All @@ -750,7 +752,7 @@ def summary(self) -> dict:
"""
status_dict = {}
logger.info(f'\n\n\nAll jobs terminated. Summary for project {self.project}:\n')
for label, output in self.scheduler.output.items():
for label, output in self.output.items():
if output['convergence']:
status_dict[label] = True
logger.info(f'Species {label} converged successfully\n')
Expand Down

0 comments on commit 8cb54d1

Please sign in to comment.