Change the dataclass Interface into a regular class Surface.

Done for all subclasses of Interface too. This is a preparation for
later abstraction.
This commit is contained in:
2026-06-08 14:22:33 +02:00
parent 68b6084150
commit 2bda913270
+25 -12
View File
@@ -12,21 +12,33 @@ class Layer:
return self.thickness / self.thermal_coefficient return self.thickness / self.thermal_coefficient
@dataclass class Surface(ABC):
class Interface(ABC): def __init__(self, name: str, area: float):
name: str self.name = name
area: float self.area = area
@property @property
@abstractmethod @abstractmethod
def U(self) -> float: ... def U(self) -> float: ...
@property
def HT(self) -> float:
return self.U * self.area
@dataclass
class LayeredInterface(Interface): class LayeredSurface(Surface):
layers: list[Layer] def __init__(
r_surface_1: float self,
r_surface_2: float name: str,
area: float,
layers: list[Layer],
r_surface_1: float,
r_surface_2: float,
):
super().__init__(name, area)
self.layers = layers
self.r_surface_1 = r_surface_1
self.r_surface_2 = r_surface_2
@property @property
def U(self) -> float: def U(self) -> float:
@@ -35,9 +47,10 @@ class LayeredInterface(Interface):
return 1 / R return 1 / R
@dataclass class FixedUSurface(Surface):
class FixedUInterface(Interface): def __init__(self, name: str, area: float, u_value: float):
u_value: float super().__init__(name, area)
self.u_value = u_value
@property @property
def U(self) -> float: def U(self) -> float: