2021-05-26 18:17:23 -04:00
|
|
|
"""
|
|
|
|
Schedules helper
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|
|
|
contributors Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
|
|
|
"""
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
class SchedulesHelper:
|
|
|
|
usage_to_comnet = {
|
|
|
|
'residential': 'C-12 Residential',
|
|
|
|
'industry': 'C-10 Warehouse',
|
|
|
|
'office and administration': 'C-5 Office',
|
|
|
|
'hotel': 'C-3 Hotel',
|
|
|
|
'health care': 'C-2 Health',
|
|
|
|
'retail': 'C-8 Retail',
|
|
|
|
'hall': 'C-8 Retail',
|
|
|
|
'restaurant': 'C-7 Restaurant',
|
|
|
|
'education': 'C-9 School'
|
|
|
|
}
|
|
|
|
comnet_default_value = 'C-12 Residential'
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def comnet_from_usage(usage):
|
|
|
|
"""
|
2021-06-01 18:31:50 -04:00
|
|
|
Get Comnet usages from the given internal usages key
|
2021-05-26 18:17:23 -04:00
|
|
|
:param usage: str
|
|
|
|
:return: str
|
|
|
|
"""
|
|
|
|
try:
|
|
|
|
return SchedulesHelper.usage_to_comnet[usage]
|
|
|
|
except KeyError:
|
|
|
|
sys.stderr.write('Error: keyword not found. Returned default Comnet schedules "residential"\n')
|
|
|
|
return SchedulesHelper.comnet_default_value
|