hub/imports/usage_factory.py
Pilar 1d4841df83 city_objects_clusters are now city_objects
test_sensors_factory.py passes
2021-06-03 15:56:59 -04:00

31 lines
898 B
Python

"""
UsageFactory retrieve the specific usage module for the given region
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from pathlib import Path
from imports.usage.hft_usage_parameters import HftUsageParameters
class UsageFactory:
"""
UsageFactory class
"""
def __init__(self, handler, city, base_path=Path(Path(__file__).parent.parent / 'data/usage')):
self._handler = '_' + handler.lower().replace(' ', '_')
self._city = city
self._base_path = base_path
def _hft(self):
HftUsageParameters(self._city, self._base_path).enrich_buildings()
def _other_usage_library_format(self):
raise Exception('Not implemented')
def enrich(self):
"""
Enrich the city with the usage information
:return: None
"""
getattr(self, self._handler, lambda: None)()