forked from s_ranjbar/city_retrofit
Partial implementation of usage catalog
This commit is contained in:
parent
1fbb99a5d6
commit
6db6f731d6
10
catalog_factories/data_models/usages/content.py
Normal file
10
catalog_factories/data_models/usages/content.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
"""
|
||||
Usage catalog content
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||
"""
|
||||
|
||||
class Content:
|
||||
def __init__(self):
|
||||
pass
|
23
catalog_factories/usage/comnet_catalog.py
Normal file
23
catalog_factories/usage/comnet_catalog.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
"""
|
||||
Comnet usage catalog
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
||||
"""
|
||||
from catalog_factories.catalog import Catalog
|
||||
from catalog_factories.data_models.usages.content import Content
|
||||
|
||||
|
||||
class ComnetCatalog(Catalog):
|
||||
def __init__(self, path):
|
||||
pass
|
||||
|
||||
def names(self, category=None):
|
||||
pass
|
||||
|
||||
def entries(self, category=None):
|
||||
pass
|
||||
|
||||
def get_entry(self, name):
|
||||
pass
|
||||
|
|
@ -7,10 +7,28 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|||
|
||||
from pathlib import Path
|
||||
from typing import TypeVar
|
||||
from catalog_factories.construction.nrel_catalog import NrelCatalog
|
||||
from catalog_factories.usage.comnet_catalog import ComnetCatalog
|
||||
Catalog = TypeVar('Catalog')
|
||||
|
||||
|
||||
class ConstructionCatalogFactory:
|
||||
def __init__(self):
|
||||
pass
|
||||
class UsageCatalogFactory:
|
||||
def __init__(self, file_type, base_path=None):
|
||||
if base_path is None:
|
||||
base_path = Path(Path(__file__).parent.parent / 'data/usage')
|
||||
self._catalog_type = '_' + file_type.lower()
|
||||
self._path = base_path
|
||||
|
||||
@property
|
||||
def _comnet(self):
|
||||
"""
|
||||
Retrieve Comnet catalog
|
||||
"""
|
||||
return ComnetCatalog(self._path)
|
||||
|
||||
@property
|
||||
def catalog(self) -> Catalog:
|
||||
"""
|
||||
Enrich the city given to the class using the class given handler
|
||||
:return: Catalog
|
||||
"""
|
||||
return getattr(self, self._catalog_type, lambda: None)
|
Loading…
Reference in New Issue
Block a user