Skip to content

Commit

Permalink
Add the "report_e_elect" as the argument and attribute to decide whet…
Browse files Browse the repository at this point in the history
…her electronic energy will be in the output or not.
  • Loading branch information
JintaoWu98 committed Oct 22, 2023
1 parent 067e76c commit 08a086b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class ARC(object):
Only used for restarting.
running_jobs (dict, optional): A dictionary of jobs submitted in a precious ARC instance, used for restarting.
ts_adapters (list, optional): Entries represent different TS adapters.
report_e_elect (bool, optional): Whether to report electronic energy. Default is ``False``.
Attributes:
project (str): The project's name. Used for naming the working directory.
Expand Down Expand Up @@ -221,6 +222,8 @@ class ARC(object):
format (``True``) or classical two-parameter Arrhenius equation format (``False``).
trsh_ess_jobs (bool): Whether to attempt troubleshooting failed ESS jobs. Default is ``True``.
ts_adapters (list): Entries represent different TS adapters.
report_e_elect (bool): Whether to report electronic energy.
"""

def __init__(self,
Expand Down Expand Up @@ -269,6 +272,7 @@ def __init__(self,
ts_adapters: List[str] = None,
ts_guess_level: Optional[Union[str, dict, Level]] = None,
verbose=logging.INFO,
report_e_elect: Optional[bool] = False,
):

if project is None:
Expand Down Expand Up @@ -320,6 +324,7 @@ def __init__(self,
self.arkane_level_of_theory = Level(repr=arkane_level_of_theory) if arkane_level_of_theory is not None else None
self.freq_scale_factor = freq_scale_factor
self.ts_adapters = ts_adapters
self.report_e_elect = report_e_elect
for ts_adapter in self.ts_adapters or list():
if ts_adapter.lower() not in _registered_job_adapters.keys():
raise InputError(f'Unknown TS adapter: "{ts_adapter}"')
Expand Down Expand Up @@ -526,6 +531,8 @@ def as_dict(self) -> dict:
if not isinstance(self.ts_guess_level, (dict, str)) else self.ts_guess_level
if self.verbose != logging.INFO:
restart_dict['verbose'] = int(self.verbose)
if self.report_e_elect:
restart_dict['report_e_elect'] = self.report_e_elect
return restart_dict

def write_input_file(self, path=None):
Expand Down Expand Up @@ -592,6 +599,7 @@ def execute(self) -> dict:
trsh_ess_jobs=self.trsh_ess_jobs,
fine_only=self.fine_only,
ts_adapters=self.ts_adapters,
report_e_elect=self.report_e_elect,
)

save_yaml_file(path=os.path.join(self.project_directory, 'output', 'status.yml'), content=self.scheduler.output)
Expand Down
4 changes: 4 additions & 0 deletions arc/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class Scheduler(object):
freq_scale_factor (float, optional): The harmonic frequencies scaling factor.
trsh_ess_jobs (bool, optional): Whether to attempt troubleshooting failed ESS jobs. Default is ``True``.
ts_adapters (list, optional): Entries represent different TS adapters.
report_e_elect (bool, optional): Whether to report electronic energy. Default is ``False``.
Attributes:
project (str): The project's name. Used for naming the working directory.
Expand Down Expand Up @@ -214,6 +215,7 @@ class Scheduler(object):
freq_scale_factor (float): The harmonic frequencies scaling factor.
trsh_ess_jobs (bool): Whether to attempt troubleshooting failed ESS jobs. Default is ``True``.
ts_adapters (list): Entries represent different TS adapters.
report_e_elect (bool): Whether to report electronic energy.
"""

def __init__(self,
Expand Down Expand Up @@ -248,6 +250,7 @@ def __init__(self,
kinetics_adapter: str = 'arkane',
freq_scale_factor: float = 1.0,
ts_adapters: List[str] = None,
report_e_elect: Optional[bool] = False,
) -> None:

self.project = project
Expand Down Expand Up @@ -279,6 +282,7 @@ def __init__(self,
self.ts_adapters = ts_adapters if ts_adapters is not None else default_ts_adapters
self.ts_adapters = [ts_adapter.lower() for ts_adapter in self.ts_adapters]
self.output = dict()
self.report_e_elect = report_e_elect

self.species_dict, self.rxn_dict = dict(), dict()
for species in self.species_list:
Expand Down

0 comments on commit 08a086b

Please sign in to comment.