Skip to content

Commit

Permalink
fix: code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
salemsd committed Feb 10, 2025
1 parent ba14a7e commit 8effbad
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/antares/craft/model/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def yield_area_ui(self) -> AreaUi:


class Area:
def __init__( # TODO: Find a way to avoid circular imports
def __init__(
self,
name: str,
area_service: BaseAreaService,
Expand Down Expand Up @@ -258,7 +258,7 @@ def ui(self) -> AreaUi:
def create_thermal_cluster(
self, thermal_name: str, properties: Optional[ThermalClusterProperties] = None
) -> ThermalCluster:
thermal: ThermalCluster = self._area_service.create_thermal_cluster(self.id, thermal_name, properties)
thermal = self._area_service.create_thermal_cluster(self.id, thermal_name, properties)
self._thermals[thermal.id] = thermal
return thermal

Expand Down
2 changes: 1 addition & 1 deletion src/antares/craft/model/binding_constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class BindingConstraintProperties(DefaultBindingConstraintProperties):


class BindingConstraint:
def __init__( # TODO: Find a way to avoid circular imports
def __init__(
self,
name: str,
binding_constraint_service: BaseBindingConstraintService,
Expand Down
2 changes: 1 addition & 1 deletion src/antares/craft/model/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def yield_link_ui(self) -> LinkUi:


class Link:
def __init__( # TODO: Find a way to avoid circular imports
def __init__(
self,
area_from: str,
area_to: str,
Expand Down
2 changes: 1 addition & 1 deletion src/antares/craft/model/renewable.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def yield_renewable_cluster_properties(self) -> RenewableClusterProperties:


class RenewableCluster:
def __init__( # TODO: Find a way to avoid circular imports
def __init__(
self,
renewable_service: BaseRenewableService,
area_id: str,
Expand Down
2 changes: 1 addition & 1 deletion src/antares/craft/model/st_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(
area_id: str,
name: str,
properties: Optional[STStorageProperties] = None,
): # TODO: Find a way to avoid circular imports
):
self._area_id: str = area_id
self._storage_service: BaseShortTermStorageService = storage_service
self._name: str = name
Expand Down
2 changes: 1 addition & 1 deletion src/antares/craft/model/thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def __init__(
area_id: str,
name: str,
properties: Optional[ThermalClusterProperties] = None,
): # TODO: Find a way to avoid circular imports
):
self._area_id = area_id
self._thermal_service: BaseThermalService = thermal_service
self._name = name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_renewable_matrix(self, cluster_id: str, area_id: str) -> pd.DataFrame:
)

def _extract_renewable_properties(self, renewable_data: dict[str, Any]) -> RenewableClusterProperties:
# get_type_hints will yield a dict with every property with every local property as key and its type as the value
# get_type_hints will yield a dict with every local property as key and its type as the value
property_types = get_type_hints(RenewableClusterPropertiesLocal)

# the name key is called "name" in renewable_data but "renewable_name" in the properties, that's why we map it
Expand Down

0 comments on commit 8effbad

Please sign in to comment.