2021-05-26 18:17:23 -04:00
|
|
|
"""
|
|
|
|
Usage helper
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2020 Project Author Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
|
|
|
"""
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
class UsageHelper:
|
|
|
|
usage_to_hft = {
|
|
|
|
'residential': 'residential',
|
|
|
|
'industry': 'industry',
|
|
|
|
'office and administration': 'office and administration',
|
|
|
|
'hotel': 'hotel',
|
|
|
|
'health care': 'health care',
|
|
|
|
'retail': 'retail',
|
|
|
|
'hall': 'hall',
|
|
|
|
'restaurant': 'restaurant',
|
|
|
|
'education': 'education'
|
|
|
|
}
|
|
|
|
hft_default_value = 'residential'
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def hft_from_usage(usage):
|
|
|
|
"""
|
2021-06-03 15:56:59 -04:00
|
|
|
Get HfT usage from the given internal usage key
|
2021-05-26 18:17:23 -04:00
|
|
|
:param usage: str
|
|
|
|
:return: str
|
|
|
|
"""
|
|
|
|
try:
|
|
|
|
return UsageHelper.usage_to_hft[usage]
|
|
|
|
except KeyError:
|
2021-06-03 15:56:59 -04:00
|
|
|
sys.stderr.write('Error: keyword not found. Returned default HfT usage "residential"\n')
|
2021-05-26 18:17:23 -04:00
|
|
|
return UsageHelper.hft_default_value
|