Skip to content

Commit c5ffebf

Browse files
committed
Move templates into storage/exp/templates folder
1 parent 63f2313 commit c5ffebf

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/ert/storage/local_experiment.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,14 @@ def create(
136136
)
137137

138138
if templates:
139+
templates_path = path / "templates"
140+
templates_path.mkdir(parents=True, exist_ok=True)
139141
templates_abs: list[tuple[str, str]] = []
140142
for src, dst in templates:
141143
incoming_template_file_path = Path(src)
142-
template_file_path = Path(path / incoming_template_file_path.name)
144+
template_file_path = Path(
145+
templates_path / incoming_template_file_path.name
146+
)
143147
shutil.copyfile(incoming_template_file_path, template_file_path)
144148
templates_abs.append((str(template_file_path.resolve()), dst))
145149
storage._write_transaction(

src/ert/storage/migration/to10.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ def migrate(path: Path) -> None:
1212
if ert_config.ert_templates:
1313
for experiment in path.glob("experiments/*"):
1414
templates_abs: list[tuple[str, str]] = []
15+
templates_path = experiment / "templates"
16+
templates_path.mkdir(parents=True, exist_ok=True)
1517
for src, dst in ert_config.ert_templates:
1618
incoming_template_file_path = Path(src)
17-
template_file_path = Path(path / incoming_template_file_path.name)
19+
template_file_path = Path(
20+
templates_path / incoming_template_file_path.name
21+
)
1822
shutil.copyfile(incoming_template_file_path, template_file_path)
1923
templates_abs.append((str(template_file_path.resolve()), dst))
2024
with open(experiment / "templates.json", "w", encoding="utf-8") as fout:

0 commit comments

Comments
 (0)