|
2 | 2 |
|
3 | 3 | import math
|
4 | 4 | import os
|
| 5 | +import shutil |
5 | 6 | import warnings
|
6 | 7 | from collections import defaultdict
|
7 | 8 | from collections.abc import Iterable
|
@@ -410,6 +411,24 @@ def save_parameters(
|
410 | 411 | # which parameters are being written whithin the data array
|
411 | 412 | pass
|
412 | 413 |
|
| 414 | + def save_experiment_data( |
| 415 | + self, |
| 416 | + experiment_path: Path, |
| 417 | + ) -> None: |
| 418 | + templates: dict[str, str] = {} |
| 419 | + for group_name, params in self.groups.items(): |
| 420 | + for param in params: |
| 421 | + if param.template_file is not None: |
| 422 | + templates[group_name] = param.template_file |
| 423 | + break |
| 424 | + |
| 425 | + for template_file in templates.values(): |
| 426 | + incoming_template_file_path = Path(template_file) |
| 427 | + template_file_path = Path( |
| 428 | + experiment_path / incoming_template_file_path.name |
| 429 | + ) |
| 430 | + shutil.copyfile(incoming_template_file_path, template_file_path) |
| 431 | + |
413 | 432 | def save_updated_parameters_and_copy_remaining(
|
414 | 433 | self,
|
415 | 434 | source_ensemble: Ensemble,
|
@@ -502,7 +521,6 @@ def write_to_runpath(
|
502 | 521 | if param.template_file is not None and param.output_file is not None:
|
503 | 522 | outfiles[group_name] = (param.template_file, param.output_file)
|
504 | 523 | break
|
505 |
| - print(f"DEBUG {outfiles} {data}") |
506 | 524 | for group_name, (template_file, output_file) in outfiles.items():
|
507 | 525 | target_file = substitute_runpath_name(
|
508 | 526 | output_file, real_nr, ensemble.iteration
|
|
0 commit comments