Skip to content

Commit e8ce91a

Browse files
authored
Consolidating Ouput (#853)
ARC has had a very complex output and requires knowledge of how to navigate the folder structure and files in order to find the data you need. This consolidation is an attempt to bring all that information to one place in an easy to read format. Additionally it is paves the path for ease of use with TCKDB
2 parents 881a614 + 1e374ec commit e8ce91a

27 files changed

Lines changed: 3707 additions & 116 deletions

arc/job/adapters/ts/orca_neb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
input_filenames, output_filenames, servers, submit_filenames, orca_neb_settings = \
3333
settings['input_filenames'], settings['output_filenames'], settings['servers'], settings['submit_filenames'], \
34-
settings['orca_neb_settings']
34+
settings.get('orca_neb_settings', {})
3535

3636

3737
input_template = """
@@ -328,6 +328,7 @@ def process_run(self):
328328
if os.path.isfile(self.local_path_to_output_file):
329329
tsg.initial_xyz = parse_geometry(self.local_path_to_output_file)
330330
tsg.execution_time = self.final_time - self.initial_time
331+
tsg.log_path = self.local_path_to_output_file
331332
tsg.success = True
332333
self.reactions[0].ts_species.ts_guesses.append(tsg)
333334

arc/level.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,12 @@ def assign_frequency_scale_factor(level: Union[str, Level]) -> Optional[int]:
459459
"""
460460
freq_scale_factors = read_yaml_file(os.path.join(ARC_PATH, 'data', 'freq_scale_factors.yml'))['freq_scale_factors']
461461
if isinstance(level, str):
462-
if level in freq_scale_factors:
463-
return freq_scale_factors[level]
462+
entry = freq_scale_factors.get(level)
463+
if entry is not None:
464+
return entry['factor'] if isinstance(entry, dict) else entry
464465
level = Level(repr=level)
465466
level_str = str(level)
466-
if level_str in freq_scale_factors:
467-
return freq_scale_factors[level_str]
467+
entry = freq_scale_factors.get(level_str)
468+
if entry is not None:
469+
return entry['factor'] if isinstance(entry, dict) else entry
468470
return None

arc/main.py

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
from arc.level import Level, assign_frequency_scale_factor
3535
from arc.job.factory import _registered_job_adapters
3636
from arc.job.ssh import SSHClient
37-
from arc.processor import process_arc_project
37+
from arc.output import write_output_yml
38+
from arc.processor import process_arc_project, resolve_neb_level
3839
from arc.reaction import ARCReaction
3940
from arc.scheduler import Scheduler
4041
from arc.species.converter import str_to_xyz
@@ -637,6 +638,35 @@ def execute(self) -> dict:
637638
skip_nmd=self.skip_nmd,
638639
)
639640

641+
# Determine whether the user supplied the scale factor explicitly, or ARC looked it up.
642+
_freq_level_for_lookup = self.composite_method if self.composite_method is not None else self.freq_level
643+
_yml_scale = assign_frequency_scale_factor(level=_freq_level_for_lookup) if _freq_level_for_lookup is not None else None
644+
_user_provided_scale = (_yml_scale is None or _yml_scale != self.freq_scale_factor)
645+
646+
neb_level = resolve_neb_level(self.ts_adapters)
647+
648+
try:
649+
write_output_yml(
650+
project=self.project,
651+
project_directory=self.project_directory,
652+
species_dict=self.scheduler.species_dict,
653+
reactions=self.scheduler.rxn_list,
654+
output_dict=self.output,
655+
opt_level=self.opt_level,
656+
freq_level=self.freq_level,
657+
sp_level=self.sp_level,
658+
neb_level=neb_level,
659+
composite_method=self.composite_method,
660+
freq_scale_factor=self.freq_scale_factor,
661+
freq_scale_factor_user_provided=_user_provided_scale,
662+
bac_type=self.bac_type,
663+
arkane_level_of_theory=self.arkane_level_of_theory,
664+
irc_requested=self.job_types.get('irc', True),
665+
t0=self.t0,
666+
)
667+
except Exception as e:
668+
logger.error(f'Could not write output.yml: {e}')
669+
640670
status_dict = self.summary()
641671
log_footer(execution_time=self.execution_time)
642672
return status_dict
@@ -1174,10 +1204,10 @@ def check_arkane_level_of_theory(self):
11741204
if self.arkane_level_of_theory is None:
11751205
self.arkane_level_of_theory = self.composite_method if self.composite_method is not None \
11761206
else self.sp_level if self.sp_level is not None else None
1177-
if self.arkane_level_of_theory is not None and self.bac_type is not None:
1178-
check_arkane_bacs(sp_level=self.arkane_level_of_theory, bac_type=self.bac_type, raise_error=self.compute_thermo)
1179-
else:
1207+
if self.arkane_level_of_theory is None:
11801208
logger.warning('Could not determine a level of theory to be used for Arkane!')
1209+
elif self.bac_type is not None:
1210+
check_arkane_bacs(sp_level=self.arkane_level_of_theory, bac_type=self.bac_type, raise_error=self.compute_thermo)
11811211

11821212
def backup_restart(self):
11831213
"""

0 commit comments

Comments
 (0)