extracted storage type from abstract class

This commit is contained in:
Pilar Monsalvete 2023-08-29 12:34:04 -04:00
parent d4b424357d
commit 7810f8f91d
3 changed files with 21 additions and 13 deletions

View File

@ -17,13 +17,22 @@ class ElectricalStorageSystem(EnergyStorageSystem):
def __init__(self, storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio, def __init__(self, storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio,
rated_output_power, nominal_efficiency, battery_voltage, depth_of_discharge, self_discharge_rate): rated_output_power, nominal_efficiency, battery_voltage, depth_of_discharge, self_discharge_rate):
super().__init__(storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio) super().__init__(storage_id, name, model_name, manufacturer, nominal_capacity, losses_ratio)
self._storage_type = storage_type
self._rated_output_power = rated_output_power self._rated_output_power = rated_output_power
self._nominal_efficiency = nominal_efficiency self._nominal_efficiency = nominal_efficiency
self._battery_voltage = battery_voltage self._battery_voltage = battery_voltage
self._depth_of_discharge = depth_of_discharge self._depth_of_discharge = depth_of_discharge
self._self_discharge_rate = self_discharge_rate self._self_discharge_rate = self_discharge_rate
@property
def storage_type(self):
"""
Get storage type from ['electrical', 'lithium_ion', 'lead_acid', 'NiCd']
:return: string
"""
return self._storage_type
@property @property
def rated_output_power(self): def rated_output_power(self):
""" """

View File

@ -14,12 +14,11 @@ class EnergyStorageSystem(ABC):
Energy Storage System Abstract Class Energy Storage System Abstract Class
""" """
def __init__(self, storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio): def __init__(self, storage_id, name, model_name, manufacturer, nominal_capacity, losses_ratio):
self._storage_id = storage_id self._storage_id = storage_id
self._name = name self._name = name
self._model_name = model_name self._model_name = model_name
self._manufacturer = manufacturer self._manufacturer = manufacturer
self._storage_type = storage_type
self._nominal_capacity = nominal_capacity self._nominal_capacity = nominal_capacity
self._losses_ratio = losses_ratio self._losses_ratio = losses_ratio
@ -55,15 +54,6 @@ class EnergyStorageSystem(ABC):
""" """
return self._manufacturer return self._manufacturer
@property
def storage_type(self):
"""
Get storage type from ['electricity', 'thermal', 'chemical',
'lithium_ion', 'lead_acid', 'NiCd', 'sensible', 'latent']
:return: string
"""
return self._storage_type
@property @property
def nominal_capacity(self): def nominal_capacity(self):
""" """

View File

@ -18,12 +18,21 @@ class ThermalStorageSystem(EnergyStorageSystem):
def __init__(self, storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio, def __init__(self, storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio,
volume, height, layers, maximum_operating_temperature): volume, height, layers, maximum_operating_temperature):
super().__init__(storage_id, name, model_name, manufacturer, storage_type, nominal_capacity, losses_ratio) super().__init__(storage_id, name, model_name, manufacturer, nominal_capacity, losses_ratio)
self._storage_type = storage_type
self._volume = volume self._volume = volume
self._height = height self._height = height
self._layers = layers self._layers = layers
self._maximum_operating_temperature = maximum_operating_temperature self._maximum_operating_temperature = maximum_operating_temperature
@property
def storage_type(self):
"""
Get storage type from ['thermal', 'sensible', 'latent']
:return: string
"""
return self._storage_type
@property @property
def volume(self): def volume(self):
""" """