diff --git a/linerate/model.py b/linerate/model.py index f1d2958..d93a7eb 100644 --- a/linerate/model.py +++ b/linerate/model.py @@ -37,11 +37,11 @@ class Cigre601(ThermalModel): def __init__( - self, - span: Span, - weather: Weather, - time: Date, - max_reynolds_number: Real = 4000, # Max value of the angle correction in CIGRE601 + self, + span: Span, + weather: Weather, + time: Date, + max_reynolds_number: Real = 4000, # Max value of the angle correction in CIGRE601 ): super().__init__(span, weather) self.time = time @@ -55,7 +55,7 @@ def compute_resistance(self, conductor_temperature: Celsius, current: Ampere) -> @_copy_method_docstring(ThermalModel) def compute_joule_heating( - self, conductor_temperature: Celsius, current: Ampere + self, conductor_temperature: Celsius, current: Ampere ) -> WattPerMeter: return super().compute_joule_heating( conductor_temperature=conductor_temperature, current=current @@ -63,7 +63,7 @@ def compute_joule_heating( @_copy_method_docstring(ThermalModel) def compute_solar_heating( - self, conductor_temperature: Celsius, current: Ampere + self, conductor_temperature: Celsius, current: Ampere ) -> WattPerMeter: alpha_s = self.span.conductor.solar_absorptivity F = self.span.ground_albedo @@ -97,7 +97,7 @@ def compute_solar_heating( @_copy_method_docstring(ThermalModel) def compute_convective_cooling( - self, conductor_temperature: Celsius, current: Ampere + self, conductor_temperature: Celsius, current: Ampere ) -> WattPerMeter: D = self.span.conductor.conductor_diameter d = self.span.conductor.outer_layer_strand_diameter @@ -153,14 +153,14 @@ def compute_convective_cooling( @_copy_method_docstring(ThermalModel) def compute_radiative_cooling( - self, conductor_temperature: Celsius, current: Ampere + self, conductor_temperature: Celsius, current: Ampere ) -> WattPerMeter: return super().compute_radiative_cooling( conductor_temperature=conductor_temperature, current=current ) def compute_temperature_gradient( - self, conductor_temperature: Celsius, current: Ampere + self, conductor_temperature: Celsius, current: Ampere ) -> Celsius: r"""Estimate the difference between the core temperature and the surface temperature. @@ -191,11 +191,11 @@ def compute_temperature_gradient( class IEEE738(ThermalModel): def __init__( - self, - span: Span, - weather: Weather, - time: Date, - max_reynolds_number: Real = 50_000, # Max Reynolds number for forced convection + self, + span: Span, + weather: Weather, + time: Date, + max_reynolds_number: Real = 50_000, # Max Reynolds number for forced convection ): super().__init__(span, weather) self.time = time @@ -209,7 +209,7 @@ def compute_resistance(self, conductor_temperature: Celsius, current: Ampere) -> @_copy_method_docstring(ThermalModel) def compute_joule_heating( - self, conductor_temperature: Celsius, current: Ampere + self, conductor_temperature: Celsius, current: Ampere ) -> WattPerMeter: return super().compute_joule_heating( conductor_temperature=conductor_temperature, current=current @@ -217,7 +217,7 @@ def compute_joule_heating( @_copy_method_docstring(ThermalModel) def compute_solar_heating( - self, conductor_temperature: Celsius, current: Ampere + self, conductor_temperature: Celsius, current: Ampere ) -> WattPerMeter: alpha_s = self.span.conductor.solar_absorptivity # alpha in IEEE phi = self.span.latitude # Lat in IEEE @@ -240,7 +240,7 @@ def compute_solar_heating( @_copy_method_docstring(ThermalModel) def compute_convective_cooling( - self, conductor_temperature: Celsius, current: Ampere + self, conductor_temperature: Celsius, current: Ampere ) -> WattPerMeter: D = self.span.conductor.conductor_diameter # D_0 in IEEE y = self.span.conductor_altitude # H_e in IEEE @@ -267,7 +267,7 @@ def compute_convective_cooling( @_copy_method_docstring(ThermalModel) def compute_radiative_cooling( - self, conductor_temperature: Celsius, current: Ampere + self, conductor_temperature: Celsius, current: Ampere ) -> WattPerMeter: return super().compute_radiative_cooling( conductor_temperature=conductor_temperature, current=current diff --git a/linerate/models/cigre207.py b/linerate/models/cigre207.py index 7d865e6..8af5969 100644 --- a/linerate/models/cigre207.py +++ b/linerate/models/cigre207.py @@ -1,6 +1,5 @@ from abc import abstractmethod -from linerate.types import Span, Weather from linerate.equations import ( cigre207, cigre601, @@ -12,7 +11,8 @@ solar_heating, ) from linerate.equations.math import switch_cos_sin -from linerate.models.thermal_model import _copy_method_docstring, ThermalModel +from linerate.models.thermal_model import ThermalModel, _copy_method_docstring +from linerate.types import Span, Weather from linerate.units import Ampere, Celsius, Date, OhmPerMeter, WattPerMeter diff --git a/linerate/models/thermal_model.py b/linerate/models/thermal_model.py index 3ebd139..fcf004c 100644 --- a/linerate/models/thermal_model.py +++ b/linerate/models/thermal_model.py @@ -2,17 +2,9 @@ from typing import Dict from linerate import solver -from linerate.equations import ( - joule_heating, - radiative_cooling, -) +from linerate.equations import joule_heating, radiative_cooling from linerate.types import Span, Weather -from linerate.units import ( - Ampere, - Celsius, - OhmPerMeter, - WattPerMeter, -) +from linerate.units import Ampere, Celsius, OhmPerMeter, WattPerMeter def _copy_method_docstring(parent_class):