complete data model for usage
This commit is contained in:
parent
8f286ad115
commit
e002a41ef9
63
catalog_factories/data_models/usages/appliances.py
Normal file
63
catalog_factories/data_models/usages/appliances.py
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
"""
|
||||||
|
Usage catalog appliances
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2022 Concordia CERC group
|
||||||
|
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||||
|
"""
|
||||||
|
|
||||||
|
from typing import Union, List
|
||||||
|
|
||||||
|
from catalog_factories.data_models.usages.schedule import Schedule
|
||||||
|
|
||||||
|
|
||||||
|
class Appliances:
|
||||||
|
"""
|
||||||
|
Appliances class
|
||||||
|
"""
|
||||||
|
def __init__(self, density, convective_fraction, radiative_fraction, latent_fraction, schedules):
|
||||||
|
self._density = density
|
||||||
|
self._convective_fraction = convective_fraction
|
||||||
|
self._radiative_fraction = radiative_fraction
|
||||||
|
self._latent_fraction = latent_fraction
|
||||||
|
self._schedules = schedules
|
||||||
|
|
||||||
|
@property
|
||||||
|
def density(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get appliances density in Watts per m2
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._density
|
||||||
|
|
||||||
|
@property
|
||||||
|
def convective_fraction(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get convective fraction
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._convective_fraction
|
||||||
|
|
||||||
|
@property
|
||||||
|
def radiative_fraction(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get radiant fraction
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._radiative_fraction
|
||||||
|
|
||||||
|
@property
|
||||||
|
def latent_fraction(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get latent fraction
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._latent_fraction
|
||||||
|
|
||||||
|
@property
|
||||||
|
def schedules(self) -> Union[None, List[Schedule]]:
|
||||||
|
"""
|
||||||
|
Get schedules
|
||||||
|
dataType = fraction
|
||||||
|
:return: None or [Schedule]
|
||||||
|
"""
|
||||||
|
return self._schedules
|
|
@ -1,135 +1,20 @@
|
||||||
"""
|
"""
|
||||||
Usage catalog content
|
Usage catalog usage
|
||||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
Copyright © 2022 Concordia CERC group
|
Copyright © 2022 Concordia CERC group
|
||||||
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||||
"""
|
"""
|
||||||
from typing import Union, List
|
from catalog_factories.data_models.usages.usage import Usage
|
||||||
|
|
||||||
from catalog_factories.data_models.usages.internal_gain import InternalGain
|
|
||||||
from catalog_factories.data_models.usages.ocupancy import Occupancy
|
|
||||||
|
|
||||||
|
|
||||||
class Content:
|
class Content:
|
||||||
def __init__(self, usage,
|
def __init__(self, usages):
|
||||||
hours_day,
|
self._usages = usages
|
||||||
days_year,
|
|
||||||
mechanical_air_change,
|
|
||||||
occupancy,
|
|
||||||
lighting,
|
|
||||||
appliances,
|
|
||||||
thermal_control):
|
|
||||||
self._usage = usage
|
|
||||||
self._hours_day = hours_day
|
|
||||||
self._days_year = days_year
|
|
||||||
self._mechanical_air_change = mechanical_air_change
|
|
||||||
# classes
|
|
||||||
self._occupancy = occupancy
|
|
||||||
self._lighting = lighting
|
|
||||||
self._appliances = appliances
|
|
||||||
self._thermal_control = thermal_control
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def usage(self) -> Union[None, str]:
|
def usages(self) -> [Usage]:
|
||||||
"""
|
"""
|
||||||
Get usage zone usage
|
Get catalog usages
|
||||||
:return: None or str
|
|
||||||
"""
|
"""
|
||||||
return self._usage
|
return self._usages
|
||||||
|
|
||||||
@property
|
|
||||||
def hours_day(self) -> Union[None, float]:
|
|
||||||
"""
|
|
||||||
Get usage zone usage hours per day
|
|
||||||
:return: None or float
|
|
||||||
"""
|
|
||||||
return self._hours_day
|
|
||||||
|
|
||||||
@property
|
|
||||||
def days_year(self) -> Union[None, float]:
|
|
||||||
"""
|
|
||||||
Get usage zone usage days per year
|
|
||||||
:return: None or float
|
|
||||||
"""
|
|
||||||
return self._days_year
|
|
||||||
|
|
||||||
@property
|
|
||||||
def mechanical_air_change(self) -> Union[None, float]:
|
|
||||||
"""
|
|
||||||
Get usage zone mechanical air change in air change per hour (ACH)
|
|
||||||
:return: None or float
|
|
||||||
"""
|
|
||||||
return self._mechanical_air_change
|
|
||||||
|
|
||||||
@mechanical_air_change.setter
|
|
||||||
def mechanical_air_change(self, value):
|
|
||||||
"""
|
|
||||||
Set usage zone mechanical air change in air change per hour (ACH)
|
|
||||||
:param value: float
|
|
||||||
"""
|
|
||||||
if value is not None:
|
|
||||||
self._mechanical_air_change = float(value)
|
|
||||||
|
|
||||||
@property
|
|
||||||
def occupancy(self) -> Union[None, Occupancy]:
|
|
||||||
"""
|
|
||||||
Get occupancy in the usage zone
|
|
||||||
:return: None or Occupancy
|
|
||||||
"""
|
|
||||||
return self._occupancy
|
|
||||||
|
|
||||||
@occupancy.setter
|
|
||||||
def occupancy(self, value):
|
|
||||||
"""
|
|
||||||
Set occupancy in the usage zone
|
|
||||||
:param value: Occupancy
|
|
||||||
"""
|
|
||||||
self._occupancy = value
|
|
||||||
|
|
||||||
@property
|
|
||||||
def lighting(self) -> Union[None, Lighting]:
|
|
||||||
"""
|
|
||||||
Get lighting information
|
|
||||||
:return: None or Lighting
|
|
||||||
"""
|
|
||||||
return self._lighting
|
|
||||||
|
|
||||||
@lighting.setter
|
|
||||||
def lighting(self, value):
|
|
||||||
"""
|
|
||||||
Set lighting information
|
|
||||||
:param value: Lighting
|
|
||||||
"""
|
|
||||||
self._lighting = value
|
|
||||||
|
|
||||||
@property
|
|
||||||
def appliances(self) -> Union[None, Appliances]:
|
|
||||||
"""
|
|
||||||
Get appliances information
|
|
||||||
:return: None or Appliances
|
|
||||||
"""
|
|
||||||
return self._appliances
|
|
||||||
|
|
||||||
@appliances.setter
|
|
||||||
def appliances(self, value):
|
|
||||||
"""
|
|
||||||
Set appliances information
|
|
||||||
:param value: Appliances
|
|
||||||
"""
|
|
||||||
self._appliances = value
|
|
||||||
|
|
||||||
@property
|
|
||||||
def thermal_control(self) -> Union[None, ThermalControl]:
|
|
||||||
"""
|
|
||||||
Get thermal control of this thermal zone
|
|
||||||
:return: None or ThermalControl
|
|
||||||
"""
|
|
||||||
return self._thermal_control
|
|
||||||
|
|
||||||
@thermal_control.setter
|
|
||||||
def thermal_control(self, value):
|
|
||||||
"""
|
|
||||||
Set thermal control for this thermal zone
|
|
||||||
:param value: ThermalControl
|
|
||||||
"""
|
|
||||||
self._thermal_control = value
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
"""
|
"""
|
||||||
InternalGain catalog module
|
Usage catalog internal gain
|
||||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
Copyright © 2022 Concordia CERC group
|
Copyright © 2022 Concordia CERC group
|
||||||
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||||
|
@ -17,3 +17,5 @@ class InternalGain:
|
||||||
self._radiative_fraction = radiative_fraction
|
self._radiative_fraction = radiative_fraction
|
||||||
self._latent_fraction = latent_fraction
|
self._latent_fraction = latent_fraction
|
||||||
self._schedules = schedules
|
self._schedules = schedules
|
||||||
|
|
||||||
|
|
||||||
|
|
60
catalog_factories/data_models/usages/lighting.py
Normal file
60
catalog_factories/data_models/usages/lighting.py
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
"""
|
||||||
|
Usage catalog lighting
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2022 Concordia CERC group
|
||||||
|
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||||
|
"""
|
||||||
|
|
||||||
|
from typing import Union, List
|
||||||
|
|
||||||
|
from catalog_factories.data_models.usages.schedule import Schedule
|
||||||
|
|
||||||
|
|
||||||
|
class Lighting:
|
||||||
|
def __init__(self, density, convective_fraction, radiative_fraction, latent_fraction, schedules):
|
||||||
|
self._density = density
|
||||||
|
self._convective_fraction = convective_fraction
|
||||||
|
self._radiative_fraction = radiative_fraction
|
||||||
|
self._latent_fraction = latent_fraction
|
||||||
|
self._schedules = schedules
|
||||||
|
|
||||||
|
@property
|
||||||
|
def density(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get lighting density in Watts per m2
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._density
|
||||||
|
|
||||||
|
@property
|
||||||
|
def convective_fraction(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get convective fraction
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._convective_fraction
|
||||||
|
|
||||||
|
@property
|
||||||
|
def radiative_fraction(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get radiant fraction
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._radiative_fraction
|
||||||
|
|
||||||
|
@property
|
||||||
|
def latent_fraction(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get latent fraction
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._latent_fraction
|
||||||
|
|
||||||
|
@property
|
||||||
|
def schedules(self) -> Union[None, List[Schedule]]:
|
||||||
|
"""
|
||||||
|
Get schedules
|
||||||
|
dataType = fraction
|
||||||
|
:return: None or [Schedule]
|
||||||
|
"""
|
||||||
|
return self._schedules
|
|
@ -6,6 +6,9 @@ Project Coder Guille Gutierrez Morote Guillermo.GutierrezMorote@concordia.ca
|
||||||
"""
|
"""
|
||||||
from typing import Union, List
|
from typing import Union, List
|
||||||
|
|
||||||
|
from catalog_factories.data_models.usages.schedule import Schedule
|
||||||
|
|
||||||
|
|
||||||
class Occupancy:
|
class Occupancy:
|
||||||
"""
|
"""
|
||||||
Occupancy class
|
Occupancy class
|
||||||
|
|
76
catalog_factories/data_models/usages/schedule.py
Normal file
76
catalog_factories/data_models/usages/schedule.py
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
"""
|
||||||
|
Usage catalog schedule
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2022 Concordia CERC group
|
||||||
|
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||||
|
"""
|
||||||
|
|
||||||
|
from typing import Union, List
|
||||||
|
|
||||||
|
|
||||||
|
class Schedule:
|
||||||
|
"""
|
||||||
|
Schedule class
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, schedule_type, values, data_type, time_step, time_range, day_types):
|
||||||
|
self._type = schedule_type
|
||||||
|
self._values = values
|
||||||
|
self._data_type = data_type
|
||||||
|
self._time_step = time_step
|
||||||
|
self._time_range = time_range
|
||||||
|
self._day_types = day_types
|
||||||
|
|
||||||
|
@property
|
||||||
|
def type(self) -> Union[None, str]:
|
||||||
|
"""
|
||||||
|
Get schedule type
|
||||||
|
:return: None or str
|
||||||
|
"""
|
||||||
|
return self._type
|
||||||
|
|
||||||
|
@property
|
||||||
|
def values(self):
|
||||||
|
"""
|
||||||
|
Get schedule values
|
||||||
|
:return: [Any]
|
||||||
|
"""
|
||||||
|
return self._values
|
||||||
|
|
||||||
|
@property
|
||||||
|
def data_type(self) -> Union[None, str]:
|
||||||
|
"""
|
||||||
|
Get schedule data type from:
|
||||||
|
['any_number', 'fraction', 'on_off', 'temperature', 'humidity', 'control_type']
|
||||||
|
:return: None or str
|
||||||
|
"""
|
||||||
|
return self._data_type
|
||||||
|
|
||||||
|
@property
|
||||||
|
def time_step(self) -> Union[None, str]:
|
||||||
|
"""
|
||||||
|
Get schedule time step from:
|
||||||
|
['second', 'minute', 'hour', 'day', 'week', 'month']
|
||||||
|
:return: None or str
|
||||||
|
"""
|
||||||
|
return self._time_step
|
||||||
|
|
||||||
|
@property
|
||||||
|
def time_range(self) -> Union[None, str]:
|
||||||
|
"""
|
||||||
|
Get schedule time range from:
|
||||||
|
['minute', 'hour', 'day', 'week', 'month', 'year']
|
||||||
|
:return: None or str
|
||||||
|
"""
|
||||||
|
return self._time_range
|
||||||
|
|
||||||
|
@property
|
||||||
|
def day_types(self) -> Union[None, List[str]]:
|
||||||
|
"""
|
||||||
|
Get schedule day types, as many as needed from:
|
||||||
|
['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'holiday', 'winter_design_day',
|
||||||
|
'summer_design_day']
|
||||||
|
:return: None or [str]
|
||||||
|
"""
|
||||||
|
return self._day_types
|
||||||
|
|
77
catalog_factories/data_models/usages/thermal_control.py
Normal file
77
catalog_factories/data_models/usages/thermal_control.py
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
"""
|
||||||
|
Usage catalog thermal control
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2022 Concordia CERC group
|
||||||
|
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||||
|
"""
|
||||||
|
from typing import Union, List
|
||||||
|
from catalog_factories.data_models.usages.schedule import Schedule
|
||||||
|
|
||||||
|
|
||||||
|
class ThermalControl:
|
||||||
|
"""
|
||||||
|
ThermalControl class
|
||||||
|
"""
|
||||||
|
def __init__(self, mean_heating_set_point,
|
||||||
|
heating_set_back,
|
||||||
|
mean_cooling_set_point,
|
||||||
|
hvac_availability_schedules,
|
||||||
|
heating_set_point_schedules,
|
||||||
|
cooling_set_point_schedules):
|
||||||
|
self._mean_heating_set_point = mean_heating_set_point
|
||||||
|
self._heating_set_back = heating_set_back
|
||||||
|
self._mean_cooling_set_point = mean_cooling_set_point
|
||||||
|
self._hvac_availability_schedules = hvac_availability_schedules
|
||||||
|
self._heating_set_point_schedules = heating_set_point_schedules
|
||||||
|
self._cooling_set_point_schedules = cooling_set_point_schedules
|
||||||
|
|
||||||
|
@property
|
||||||
|
def mean_heating_set_point(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get heating set point defined for a thermal zone in Celsius
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._mean_heating_set_point
|
||||||
|
|
||||||
|
@property
|
||||||
|
def heating_set_back(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get heating set back defined for a thermal zone in Celsius
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._heating_set_back
|
||||||
|
|
||||||
|
@property
|
||||||
|
def mean_cooling_set_point(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get cooling set point defined for a thermal zone in Celsius
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._mean_cooling_set_point
|
||||||
|
|
||||||
|
@property
|
||||||
|
def hvac_availability_schedules(self) -> Union[None, List[Schedule]]:
|
||||||
|
"""
|
||||||
|
Get the availability of the conditioning system defined for a thermal zone
|
||||||
|
dataType = on/off
|
||||||
|
:return: None or [Schedule]
|
||||||
|
"""
|
||||||
|
return self._hvac_availability_schedules
|
||||||
|
|
||||||
|
@property
|
||||||
|
def heating_set_point_schedules(self) -> Union[None, List[Schedule]]:
|
||||||
|
"""
|
||||||
|
Get heating set point schedule defined for a thermal zone in Celsius
|
||||||
|
dataType = temperature
|
||||||
|
:return: None or [Schedule]
|
||||||
|
"""
|
||||||
|
return self._heating_set_point_schedules
|
||||||
|
|
||||||
|
@property
|
||||||
|
def cooling_set_point_schedules(self) -> Union[None, List[Schedule]]:
|
||||||
|
"""
|
||||||
|
Get cooling set point schedule defined for a thermal zone in Celsius
|
||||||
|
dataType = temperature
|
||||||
|
:return: None or [Schedule]
|
||||||
|
"""
|
||||||
|
return self._cooling_set_point_schedules
|
106
catalog_factories/data_models/usages/usage.py
Normal file
106
catalog_factories/data_models/usages/usage.py
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
"""
|
||||||
|
Usage catalog usage
|
||||||
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||||
|
Copyright © 2022 Concordia CERC group
|
||||||
|
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||||
|
"""
|
||||||
|
from typing import Union, List
|
||||||
|
|
||||||
|
from catalog_factories.data_models.usages.appliances import Appliances
|
||||||
|
from catalog_factories.data_models.usages.internal_gain import InternalGain
|
||||||
|
from catalog_factories.data_models.usages.lighting import Lighting
|
||||||
|
from catalog_factories.data_models.usages.ocupancy import Occupancy
|
||||||
|
from catalog_factories.data_models.usages.thermal_control import ThermalControl
|
||||||
|
|
||||||
|
|
||||||
|
class Usage:
|
||||||
|
def __init__(self, usage,
|
||||||
|
hours_day,
|
||||||
|
days_year,
|
||||||
|
mechanical_air_change,
|
||||||
|
occupancy,
|
||||||
|
lighting,
|
||||||
|
appliances,
|
||||||
|
thermal_control):
|
||||||
|
self._usage = usage
|
||||||
|
self._hours_day = hours_day
|
||||||
|
self._days_year = days_year
|
||||||
|
self._mechanical_air_change = mechanical_air_change
|
||||||
|
# classes
|
||||||
|
self._occupancy = occupancy
|
||||||
|
self._lighting = lighting
|
||||||
|
self._appliances = appliances
|
||||||
|
self._thermal_control = thermal_control
|
||||||
|
|
||||||
|
@property
|
||||||
|
def usage(self) -> Union[None, str]:
|
||||||
|
"""
|
||||||
|
Get usage zone usage
|
||||||
|
:return: None or str
|
||||||
|
"""
|
||||||
|
return self._usage
|
||||||
|
|
||||||
|
@property
|
||||||
|
def hours_day(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get usage zone usage hours per day
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._hours_day
|
||||||
|
|
||||||
|
@property
|
||||||
|
def days_year(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get usage zone usage days per year
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._days_year
|
||||||
|
|
||||||
|
@property
|
||||||
|
def mechanical_air_change(self) -> Union[None, float]:
|
||||||
|
"""
|
||||||
|
Get usage zone mechanical air change in air change per hour (ACH)
|
||||||
|
:return: None or float
|
||||||
|
"""
|
||||||
|
return self._mechanical_air_change
|
||||||
|
|
||||||
|
@property
|
||||||
|
def occupancy(self) -> Union[None, Occupancy]:
|
||||||
|
"""
|
||||||
|
Get occupancy in the usage zone
|
||||||
|
:return: None or Occupancy
|
||||||
|
"""
|
||||||
|
return self._occupancy
|
||||||
|
|
||||||
|
@property
|
||||||
|
def lighting(self) -> Union[None, Lighting]:
|
||||||
|
"""
|
||||||
|
Get lighting information
|
||||||
|
:return: None or Lighting
|
||||||
|
"""
|
||||||
|
return self._lighting
|
||||||
|
|
||||||
|
@lighting.setter
|
||||||
|
def lighting(self, value):
|
||||||
|
"""
|
||||||
|
Set lighting information
|
||||||
|
:param value: Lighting
|
||||||
|
"""
|
||||||
|
self._lighting = value
|
||||||
|
|
||||||
|
@property
|
||||||
|
def appliances(self) -> Union[None, Appliances]:
|
||||||
|
"""
|
||||||
|
Get appliances information
|
||||||
|
:return: None or Appliances
|
||||||
|
"""
|
||||||
|
return self._appliances
|
||||||
|
|
||||||
|
@property
|
||||||
|
def thermal_control(self) -> Union[None, ThermalControl]:
|
||||||
|
"""
|
||||||
|
Get thermal control of this thermal zone
|
||||||
|
:return: None or ThermalControl
|
||||||
|
"""
|
||||||
|
return self._thermal_control
|
||||||
|
|
Loading…
Reference in New Issue
Block a user