system_assignation/helpers/configuration_helper.py
Pilar e9dd9c2221 eliminated many parameters from configuration.ini that will now depend on the workflow
added example iso 52016-1:2017
added new weather format defined in iso 52016-1:2017 (xls)
2021-01-11 17:11:50 -05:00

34 lines
950 B
Python

"""
Configuration helper
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import configparser
from pathlib import Path
class ConfigurationHelper:
"""
Configuration class
"""
def __init__(self):
config_file = Path(Path(__file__).parent.parent / 'config/configuration.ini').resolve()
self._config = configparser.ConfigParser()
self._config.read(config_file)
@property
def max_location_distance_for_shared_walls(self):
"""
Configured maximal distance between attributes to consider that they may share walls in meters
:return: float
"""
return self._config.getfloat('buildings', 'max_location_distance_for_shared_walls')
@property
def min_coordinate(self) -> float:
"""
Configured minimal coordinate value
:return: float
"""
return self._config.getfloat('buildings', 'min_coordinate')