diff --git a/antarest/study/common/studystorage.py b/antarest/study/common/studystorage.py index 682b01d753..c6357d9123 100644 --- a/antarest/study/common/studystorage.py +++ b/antarest/study/common/studystorage.py @@ -273,10 +273,13 @@ def unarchive_study_output( raise NotImplementedError() def unarchive(self, study: T) -> None: + """ + Unarchived a study + Args: + study: StudyFactory + """ raise NotImplementedError() - # def export_study_flat(self, **kwargs) -> None: - # raise NotImplementedError() def export_study_flat( self, path_study: Path, @@ -285,4 +288,13 @@ def export_study_flat( output_src_path: Optional[Path] = None, output_list_filter: Optional[List[str]] = None, ) -> None: + """ + Export study to destination + Args: + path_study: source path. + dst_path: destination path. + outputs: list of outputs to keep. + output_src_path: list of source outputs path + output_list_filter:list of outputs to keep + """ raise NotImplementedError() diff --git a/antarest/study/service.py b/antarest/study/service.py index 41200430cd..1df14f461d 100644 --- a/antarest/study/service.py +++ b/antarest/study/service.py @@ -2166,7 +2166,7 @@ def unarchive(self, uuid: str, params: RequestParameters) -> str: def unarchive_task(notifier: TaskUpdateNotifier) -> TaskResult: study_to_archive = self.get_study(uuid) - self.storage_service.raw_study_service.unarchive(study_to_archive) + self.storage_service.raw_study_service.unarchived(study_to_archive) study_to_archive.archived = False os.unlink( diff --git a/antarest/study/storage/abstract_storage_service.py b/antarest/study/storage/abstract_storage_service.py index a7d7c84168..34f919ef41 100644 --- a/antarest/study/storage/abstract_storage_service.py +++ b/antarest/study/storage/abstract_storage_service.py @@ -67,11 +67,9 @@ def export_study_flat( Args: path_study: Study source path dest: Destination path. - study_factory: StudyFactory, outputs: List of outputs to keep. output_list_filter: List of outputs to keep (None indicate all outputs). - output_src_path: Denormalize the study (replace matrix links by real matrices). - + output_src_path: list of source outputs path. """ start_time = time.time() output_src_path = output_src_path or path_study / "output" diff --git a/antarest/study/storage/rawstudy/raw_study_service.py b/antarest/study/storage/rawstudy/raw_study_service.py index 1263af3704..6c48c754b0 100644 --- a/antarest/study/storage/rawstudy/raw_study_service.py +++ b/antarest/study/storage/rawstudy/raw_study_service.py @@ -412,7 +412,7 @@ def archive(self, study: RawStudy) -> Path: self.cache.invalidate(study.id) return new_study_path - def unarchive(self, study: RawStudy) -> None: + def unarchived(self, study: RawStudy) -> None: with open( self.get_archive_path(study), "rb", diff --git a/antarest/study/storage/variantstudy/variant_study_service.py b/antarest/study/storage/variantstudy/variant_study_service.py index 1776f0af82..c82982f152 100644 --- a/antarest/study/storage/variantstudy/variant_study_service.py +++ b/antarest/study/storage/variantstudy/variant_study_service.py @@ -839,21 +839,6 @@ def _generate( if last_executed_command_index is None: if isinstance(parent_study, VariantStudy): - # self._safe_generation(parent_study) - # self.export_study_flat( - # metadata=parent_study, - # dst_path=dst_path, - # outputs=False, - # denormalize=False, - # ) - # else: - # self.raw_study_service.export_study_flat( - # metadata=parent_study, - # dst_path=dst_path, - # outputs=False, - # denormalize=False, - # ) - self._safe_generation(parent_study) path_study = Path(parent_study.path) snapshot_path = path_study / SNAPSHOT_RELATIVE_PATH @@ -867,7 +852,7 @@ def _generate( else: path_study = Path(parent_study.path) if parent_study.archived: - self.raw_study_service.unarchive(parent_study) + self.raw_study_service.unarchived(parent_study) try: self.raw_study_service.export_study_flat( path_study=path_study,