Skip to content

Commit

Permalink
Add method "save_e_elect" to save electronic energy to the output file.
Browse files Browse the repository at this point in the history
  • Loading branch information
JintaoWu98 committed Oct 22, 2023
1 parent 08a086b commit 42cae71
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions arc/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
get_logger,
get_number_with_ordinal_indicator,
is_angle_linear,
read_yaml_file,
safe_copy_file,
save_yaml_file,
sort_two_lists_by_the_first,
Expand Down Expand Up @@ -2556,6 +2557,9 @@ def post_sp_actions(self,
if species_has_freq(self.output[label], self.species_dict[label].yml_path):
self.check_rxn_e0_by_spc(label)

if self.report_e_elect:
self.save_e_elect(label)

# set *at the end* to differentiate between sp jobs when using complex solvation corrections
self.output[label]['job_types']['sp'] = True

Expand Down Expand Up @@ -3618,6 +3622,18 @@ def generate_final_ts_guess_report(self):
if content:
save_yaml_file(path=path, content=content)

def save_e_elect(self, label: str):
"""
Save the electronic energy of the corresponding species.
It will append if the file already exists.
"""
path = os.path.join(self.project_directory, 'output', 'e_elect_summary.yml')
content = dict()
if os.path.isfile(path):
content = read_yaml_file(path)
content[label] = self.species_dict[label].e_elect
save_yaml_file(path=path, content=content)


def species_has_freq(species_output_dict: dict,
yml_path: Optional[str] = None,
Expand Down

0 comments on commit 42cae71

Please sign in to comment.