2020-06-09 14:07:47 -04:00
|
|
|
"""
|
|
|
|
Configuration helper
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
2022-04-08 09:35:33 -04:00
|
|
|
Copyright © 2022 Concordia CERC group
|
|
|
|
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
2020-06-09 14:07:47 -04:00
|
|
|
"""
|
2020-06-05 12:24:03 -04:00
|
|
|
import configparser
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
2020-06-11 16:22:58 -04:00
|
|
|
class ConfigurationHelper:
|
2020-06-11 15:45:11 -04:00
|
|
|
"""
|
|
|
|
Configuration class
|
|
|
|
"""
|
2020-06-05 12:24:03 -04:00
|
|
|
def __init__(self):
|
2020-06-15 14:59:53 -04:00
|
|
|
config_file = Path(Path(__file__).parent.parent / 'config/configuration.ini').resolve()
|
2020-06-05 12:24:03 -04:00
|
|
|
self._config = configparser.ConfigParser()
|
|
|
|
self._config.read(config_file)
|
|
|
|
|
2020-06-22 14:35:40 -04:00
|
|
|
@property
|
2021-09-22 07:25:53 -04:00
|
|
|
def max_location_distance_for_shared_walls(self) -> float:
|
2020-06-22 14:35:40 -04:00
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get configured maximal distance between attributes to consider that they may share walls in meters
|
2021-09-22 07:25:53 -04:00
|
|
|
:return: 5.0
|
2020-06-22 14:35:40 -04:00
|
|
|
"""
|
2020-10-28 13:57:56 -04:00
|
|
|
return self._config.getfloat('buildings', 'max_location_distance_for_shared_walls')
|
2020-12-01 07:33:23 -05:00
|
|
|
|
|
|
|
@property
|
|
|
|
def min_coordinate(self) -> float:
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get configured minimal coordinate value
|
2021-09-22 07:25:53 -04:00
|
|
|
:return: -1.7976931348623157e+308
|
2020-12-01 07:33:23 -05:00
|
|
|
"""
|
|
|
|
return self._config.getfloat('buildings', 'min_coordinate')
|
2021-03-25 09:11:42 -04:00
|
|
|
|
|
|
|
@property
|
|
|
|
def max_coordinate(self) -> float:
|
|
|
|
"""
|
2021-08-30 14:39:24 -04:00
|
|
|
Get configured maximal coordinate value
|
2021-09-22 07:25:53 -04:00
|
|
|
:return: 1.7976931348623157e+308
|
2021-03-25 09:11:42 -04:00
|
|
|
"""
|
2021-10-25 13:28:43 -04:00
|
|
|
return self._config.getfloat('buildings', 'max_coordinate').real
|
2021-11-11 17:28:28 -05:00
|
|
|
|
|
|
|
@property
|
|
|
|
def comnet_lighting_latent(self) -> float:
|
|
|
|
"""
|
|
|
|
Get configured latent ratio of internal gains do to lighting used for Comnet (ASHRAE) standard
|
|
|
|
:return: 0
|
|
|
|
"""
|
|
|
|
return self._config.getfloat('buildings', 'comnet_lighting_latent').real
|
|
|
|
|
|
|
|
@property
|
|
|
|
def comnet_lighting_convective(self) -> float:
|
|
|
|
"""
|
|
|
|
Get configured convective ratio of internal gains do to lighting used for Comnet (ASHRAE) standard
|
|
|
|
:return: 0.5
|
|
|
|
"""
|
|
|
|
return self._config.getfloat('buildings', 'comnet_lighting_convective').real
|
|
|
|
|
|
|
|
@property
|
|
|
|
def comnet_lighting_radiant(self) -> float:
|
|
|
|
"""
|
|
|
|
Get configured radiant ratio of internal gains do to lighting used for Comnet (ASHRAE) standard
|
|
|
|
:return: 0.5
|
|
|
|
"""
|
|
|
|
return self._config.getfloat('buildings', 'comnet_lighting_radiant').real
|
|
|
|
|
|
|
|
@property
|
|
|
|
def comnet_plugs_latent(self) -> float:
|
|
|
|
"""
|
|
|
|
Get configured latent ratio of internal gains do to electrical appliances used for Comnet (ASHRAE) standard
|
|
|
|
:return: 0
|
|
|
|
"""
|
|
|
|
return self._config.getfloat('buildings', 'comnet_plugs_latent').real
|
|
|
|
|
|
|
|
@property
|
|
|
|
def comnet_plugs_convective(self) -> float:
|
|
|
|
"""
|
|
|
|
Get configured convective ratio of internal gains do to electrical appliances used for Comnet (ASHRAE) standard
|
|
|
|
:return: 0.75
|
|
|
|
"""
|
|
|
|
return self._config.getfloat('buildings', 'comnet_plugs_convective').real
|
|
|
|
|
|
|
|
@property
|
|
|
|
def comnet_plugs_radiant(self) -> float:
|
|
|
|
"""
|
|
|
|
Get configured radiant ratio of internal gains do to electrical appliances used for Comnet (ASHRAE) standard
|
|
|
|
:return: 0.25
|
|
|
|
"""
|
|
|
|
return self._config.getfloat('buildings', 'comnet_plugs_radiant').real
|
|
|
|
|
|
|
|
@property
|
|
|
|
def comnet_occupancy_sensible_convective(self) -> float:
|
|
|
|
"""
|
|
|
|
Get configured convective ratio of the sensible part of internal gains do to occupancy
|
|
|
|
used for Comnet (ASHRAE) standard
|
|
|
|
:return: 0.9
|
|
|
|
"""
|
|
|
|
return self._config.getfloat('buildings', 'comnet_occupancy_sensible_convective').real
|
|
|
|
|
|
|
|
@property
|
|
|
|
def comnet_occupancy_sensible_radiant(self) -> float:
|
|
|
|
"""
|
|
|
|
Get configured radiant ratio of the sensible part of internal gains do to occupancy
|
|
|
|
used for Comnet (ASHRAE) standard
|
|
|
|
:return: 0.1
|
|
|
|
"""
|
|
|
|
return self._config.getfloat('buildings', 'comnet_occupancy_sensible_radiant').real
|
2022-03-08 19:19:52 -05:00
|
|
|
|
|
|
|
@property
|
|
|
|
def convective_heat_transfer_coefficient_interior(self) -> float:
|
|
|
|
"""
|
|
|
|
Get configured convective heat transfer coefficient for surfaces inside the building
|
|
|
|
:return: 3.5
|
|
|
|
"""
|
|
|
|
return self._config.getfloat('buildings', 'convective_heat_transfer_coefficient_interior').real
|
|
|
|
|
|
|
|
@property
|
|
|
|
def convective_heat_transfer_coefficient_exterior(self) -> float:
|
|
|
|
"""
|
|
|
|
Get configured convective heat transfer coefficient for surfaces outside the building
|
|
|
|
:return: 20
|
|
|
|
"""
|
|
|
|
return self._config.getfloat('buildings', 'convective_heat_transfer_coefficient_exterior').real
|