Skip to content
11 changes: 6 additions & 5 deletions src/queens/drivers/jobscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,18 @@ def __init__(

Args:
parameters (Parameters): Parameters object.
input_templates (str, Path, dict): Path(s) to simulation input template.
jobscript_template (str, Path): Path to jobscript template or read-in jobscript
template.
executable (str, Path): Path to main executable of respective software.
input_templates (str, Path, dict): (Local) path(s) to simulation input template.
jobscript_template (str, Path): (Local) path to jobscript template or read-in jobscript
template.
executable (str, Path): Path to main executable of respective software. Is a remote
path when using the Cluster scheduler.
files_to_copy (list, opt): Files or directories to copy to experiment_dir.
data_processor (obj, opt): Instance of data processor class.
gradient_data_processor (obj, opt): Instance of data processor class for gradient data.
jobscript_file_name (str, opt): Jobscript file name (default: 'jobscript.sh').
extra_options (dict, opt): Extra options to inject into jobscript template.
raise_error_on_jobscript_failure (bool, opt): Whether to raise an error for a non-zero
jobscript exit code.
jobscript exit code.
"""
super().__init__(parameters=parameters, files_to_copy=files_to_copy)
self.input_templates = self.create_input_templates_dict(input_templates)
Expand Down
8 changes: 7 additions & 1 deletion src/queens/utils/config_directories.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ def experiment_directory(
if experiment_base_directory is None:
experiment_base_directory = base_directory()
else:
experiment_base_directory = Path(experiment_base_directory)
# Replace ~ with home directory if necessary
experiment_base_directory_str = str(experiment_base_directory)
if experiment_base_directory_str.startswith("~"):
experiment_base_directory_str = experiment_base_directory_str.replace(
"~", str(Path().home()), 1
)
experiment_base_directory = Path(experiment_base_directory_str)

experiment_dir = experiment_base_directory / experiment_name
return experiment_dir, experiment_dir.exists()
Expand Down
Loading
Loading