-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconstants.py
More file actions
129 lines (113 loc) · 3.16 KB
/
constants.py
File metadata and controls
129 lines (113 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
"""
Some Enums to avoid hard coding strings elsewhere.
For readability, maintainability, and to reduce typos.
"""
#########################################
# Enumerators for CANOE data sets
#########################################
from enum import Enum
from typing import Set, List
class SortableEnum(Enum):
"""
An Enum that supports less-than comparisons based on value.
"""
def __lt__(self, other):
if not isinstance(other, self.__class__):
return NotImplemented
return self.value < other.value
class Region(SortableEnum):
"""
Viable regions in CANOE data sets.
"""
ALBERTA = 'AB'
BRITISH_COLUMBIA = 'BC'
MANITOBA = 'MB'
NEW_BRUNSWICK = 'NB'
NEWFOUNDLAND_AND_LABRADOR = 'NLLAB'
NOVA_SCOTIA = 'NS'
ONTARIO = 'ON'
PRINCE_EDWARD_ISLAND = 'PEI'
QUEBEC = 'QC'
SASKATCHEWAN = 'SK'
USA = 'USA'
NONE = ''
class Sector(SortableEnum):
"""
Viable sectors in CANOE data sets.
"""
AGRICULTURE = 'AGRI'
COMMERCIAL = 'COM'
ELECTRICITY = 'ELC'
FUEL = 'FUEL'
INDUSTRY = 'IND'
RESIDENTIAL = 'RES'
TRANSPORTATION = 'TRP'
class Variant(SortableEnum):
"""
Viable sector variants in CANOE data sets.
"""
HIGH_RESOLUTION = 'HR'
CURRENT_MEASURES = 'CM'
NET_ZERO = 'NZ'
class Feature(SortableEnum):
"""
Viable additional features in CANOE data sets.
"""
DEMAND = 'DEM'
ENDOGENOUS_INTERTIE = 'EINT'
BOUNDARY_INTERTIE = 'BINT'
NONE = ''
class Level(SortableEnum):
"""
Sector resolution levels for UI
"""
HIGH_RESOLUTION = 'HIGH'
LOW_RESOLUTION = 'LOW'
EXCLUDED = '-'
#########################################
# UI constants
#########################################
LOW_SCENARIOS: List[str] = [
"Current Measures",
"Global Net Zero"
]
"""UI naming for low resolution scenarios"""
DEFAULT_LOW: str = 'Current Measures'
"""Default low resolution scenario (UI name)"""
TABLE_SECTORS: List[Sector] = sorted(
s.value for s in [
Sector.COMMERCIAL,
Sector.ELECTRICITY,
Sector.INDUSTRY,
Sector.RESIDENTIAL,
Sector.TRANSPORTATION
]
)
"""Sectors that are included in UI options matrix"""
TABLE_REGIONS: List[Region] = sorted(
r.value for r in [
Region.ALBERTA,
Region.BRITISH_COLUMBIA,
Region.MANITOBA,
Region.NEW_BRUNSWICK,
Region.NEWFOUNDLAND_AND_LABRADOR,
Region.NOVA_SCOTIA,
Region.ONTARIO,
Region.PRINCE_EDWARD_ISLAND,
Region.QUEBEC,
Region.SASKATCHEWAN
]
)
"""Regions that are included in UI options matrix"""
#########################################
# Database processing constants
#########################################
INDEX_TABLES: Set[str] = {
'CommodityType','Operator','TechnologyType','TimePeriodType',
'DataQualityCredibility','DataQualityGeography',
'DataQualityStructure','DataQualityTechnology','DataQualityTime',
'TechnologyLabel','CommodityLabel','DataSourceLabel'
}
"""SQLite tables that are handled by the schema and need not be transferred"""
LTT_DEFAULT: int = 40
"""Default lifetime for technologies in Temoa if not specified elsewhere"""