Skip to content

Commit

Permalink
chore(services): drop the raise NotImplementedError in the abstract…
Browse files Browse the repository at this point in the history
… methods (useless)
  • Loading branch information
laurent-laporte-pro committed Apr 19, 2024
1 parent a724248 commit 44be685
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions antarest/study/common/studystorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def create(self, metadata: T) -> T:
Returns: new study information
"""
raise NotImplementedError()

@abstractmethod
def get(
Expand All @@ -46,7 +45,6 @@ def get(
Returns: study data formatted in json
"""
raise NotImplementedError()

@abstractmethod
def aggregate_areas_data(
Expand Down Expand Up @@ -74,7 +72,6 @@ def aggregate_areas_data(
Returns: the areas aggregated data in a JSON format
"""
raise NotImplementedError()

@abstractmethod
def aggregate_links_data(
Expand All @@ -100,7 +97,6 @@ def aggregate_links_data(
Returns: the links aggregated data in a JSON format
"""
raise NotImplementedError()

@abstractmethod
def exists(self, metadata: T) -> bool:
Expand All @@ -112,7 +108,6 @@ def exists(self, metadata: T) -> bool:
Returns: true if study presents in disk, false else.
"""
raise NotImplementedError()

@abstractmethod
def copy(self, src_meta: T, dest_name: str, groups: t.Sequence[str], with_outputs: bool = False) -> T:
Expand All @@ -128,7 +123,6 @@ def copy(self, src_meta: T, dest_name: str, groups: t.Sequence[str], with_output
Returns:
The newly created study.
"""
raise NotImplementedError()

@abstractmethod
def patch_update_study_metadata(self, study: T, metadata: StudyMetadataPatchDTO) -> StudyMetadataDTO:
Expand All @@ -141,7 +135,6 @@ def patch_update_study_metadata(self, study: T, metadata: StudyMetadataPatchDTO)
Returns: study metadata
"""
raise NotImplementedError()

@abstractmethod
def import_output(
Expand All @@ -158,11 +151,10 @@ def import_output(
output_name: Optional name suffix to append to the output name
Returns: None
"""
raise NotImplementedError()

@abstractmethod
def get_study_information(self, metadata: T) -> StudyMetadataDTO:
raise NotImplementedError()
"""Get study information."""

@abstractmethod
def get_raw(
Expand All @@ -180,7 +172,6 @@ def get_raw(
Returns: the config and study tree object
"""
raise NotImplementedError()

@abstractmethod
def get_study_sim_result(self, metadata: T) -> t.List[StudySimResultDTO]:
Expand All @@ -193,7 +184,6 @@ def get_study_sim_result(self, metadata: T) -> t.List[StudySimResultDTO]:
Returns:
study output data
"""
raise NotImplementedError()

@abstractmethod
def set_reference_output(self, metadata: T, output_id: str, status: bool) -> None:
Expand All @@ -205,7 +195,6 @@ def set_reference_output(self, metadata: T, output_id: str, status: bool) -> Non
output_id: the id of output to set the reference status.
status: true to set it as reference, false to unset it.
"""
raise NotImplementedError()

@abstractmethod
def delete(self, metadata: T) -> None:
Expand All @@ -217,7 +206,6 @@ def delete(self, metadata: T) -> None:
Returns:
"""
raise NotImplementedError()

@abstractmethod
def delete_output(self, metadata: T, output_id: str) -> None:
Expand All @@ -230,7 +218,6 @@ def delete_output(self, metadata: T, output_id: str) -> None:
Returns:
"""
raise NotImplementedError()

@abstractmethod
def get_study_path(self, metadata: Study) -> Path:
Expand All @@ -242,7 +229,6 @@ def get_study_path(self, metadata: Study) -> Path:
Returns: study path
"""
raise NotImplementedError()

def _check_study_exists(self, metadata: Study) -> None:
"""
Expand Down Expand Up @@ -270,7 +256,6 @@ def export_study(self, metadata: T, target: Path, outputs: bool = True) -> Path:
Returns:
Path: The path to the created ZIP file containing the study files.
"""
raise NotImplementedError()

@abstractmethod
def export_output(self, metadata: T, output_id: str, target: Path) -> None:
Expand All @@ -284,7 +269,6 @@ def export_output(self, metadata: T, output_id: str, target: Path) -> None:
Returns: zip file with study files compressed inside
"""
raise NotImplementedError()

@abstractmethod
def export_study_flat(
Expand All @@ -305,7 +289,6 @@ def export_study_flat(
output_list_filter: list of outputs to keep (None indicate all outputs).
denormalize: denormalize the study (replace matrix links by real matrices).
"""
raise NotImplementedError()

@abstractmethod
def get_synthesis(self, metadata: T, params: t.Optional[RequestParameters] = None) -> FileStudyTreeConfigDTO:
Expand All @@ -317,16 +300,16 @@ def get_synthesis(self, metadata: T, params: t.Optional[RequestParameters] = Non
Returns: FileStudyTreeConfigDTO
"""
raise NotImplementedError()

@abstractmethod
def initialize_additional_data(self, study: T) -> bool:
raise NotImplementedError()
"""Initialize additional data for a study."""

@abstractmethod
def archive_study_output(self, study: T, output_id: str) -> bool:
raise NotImplementedError()
"""Archive a study output."""

# noinspection SpellCheckingInspection
@abstractmethod
def unarchive_study_output(self, study: T, output_id: str, keep_src_zip: bool) -> bool:
raise NotImplementedError()
"""Un-archive a study output."""

0 comments on commit 44be685

Please sign in to comment.