Skip to content

Commit

Permalink
docs(api-thermal): correct thermal manager doctrings
Browse files Browse the repository at this point in the history
  • Loading branch information
hdinia committed Oct 19, 2023
1 parent 0d8bd45 commit d55f315
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions antarest/study/business/areas/thermal_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
@camel_case_model
class ThermalClusterInput(Thermal860Properties, metaclass=AllOptionalMetaclass):
"""
Model representing the form used to EDIT an existing short-term storage.
Model representing the data structure required to edit an existing thermal cluster within a study.
"""


class ThermalClusterCreation(ThermalClusterInput):
"""
Model representing the form used to CREATE a new short-term storage.
Model representing the data structure required to create a new thermal cluster within a study.
"""

# noinspection Pydantic
Expand All @@ -41,7 +41,7 @@ def validate_name(cls, name: t.Optional[str]) -> str:
Validator to check if the name is not empty.
"""
if not name:
raise ValueError("'name' must not be empty")
raise ValueError("name must not be empty")
return name

def to_config(self, study_version: t.Union[str, int]) -> ThermalConfigType:
Expand All @@ -52,7 +52,7 @@ def to_config(self, study_version: t.Union[str, int]) -> ThermalConfigType:
@camel_case_model
class ThermalClusterOutput(Thermal860Config, metaclass=AllOptionalMetaclass):
"""
Model representing the form used to display the details of a short-term storage entry.
Model representing the output data structure to display the details of a thermal cluster within a study.
"""


Expand All @@ -68,10 +68,8 @@ def create_thermal_output(

class ThermalManager:
"""
A class used in the `StudyService` to implement endpoints related to Thermal Clusters.
This class provides methods to interact with and manage thermal clusters within a study.
It allows for creating, retrieving, updating, and deleting thermal clusters.
Manager class implementing endpoints related to Thermal Clusters within a study.
Provides methods for creating, retrieving, updating, and deleting thermal clusters.
Attributes:
storage_service: The service for accessing study storage.
Expand Down Expand Up @@ -122,17 +120,17 @@ def get_clusters(
area_id: str,
) -> t.Sequence[ThermalClusterOutput]:
"""
Get all clusters for an area.
Retrieve all thermal clusters from a specified area within a study.
Args:
study: The study where the clusters will be retrieved from.
area_id: The ID of the area where the clusters will be retrieved from.
study: Study from which to retrieve the clusters.
area_id: ID of the area containing the clusters.
Returns:
A sequence of all clusters for the specified area.
A list of thermal clusters within the specified area.
Raises:
If the specified area does not have any clusters.
ClusterConfigNotFound: If no clusters are found in the specified area.
"""

file_study = self._get_file_study(study)
Expand Down

0 comments on commit d55f315

Please sign in to comment.