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
@dataclass
class Interface(ABC):
name: str
area: float
class Surface(ABC):
def __init__(self, name: str, area: float):
self.name = name
self.area = area
@property
@abstractmethod
def U(self) -> float: ...
@property
def HT(self) -> float:
return self.U * self.area
@dataclass
class LayeredInterface(Interface):
layers: list[Layer]
r_surface_1: float
r_surface_2: float
class LayeredSurface(Surface):
def __init__(
self,
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
def U(self) -> float:
@@ -35,9 +47,10 @@ class LayeredInterface(Interface):
return 1 / R
@dataclass
class FixedUInterface(Interface):
u_value: float
class FixedUSurface(Surface):
def __init__(self, name: str, area: float, u_value: float):
super().__init__(name, area)
self.u_value = u_value
@property
def U(self) -> float: