-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsession_data.py
More file actions
107 lines (79 loc) · 3.72 KB
/
Copy pathsession_data.py
File metadata and controls
107 lines (79 loc) · 3.72 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
class ProjectData():
def __init__(self):
self.name = ''
# Results from calculating bill for a set of load profiles with a given tariff. Stored on a case name basis.
self.network_results_by_case = {}
self.retail_results_by_case = {}
self.wholesale_results_by_case = {}
# Tariff for a given case, stored on a case name basis.
self.network_tariffs_by_case = {}
self.retail_tariffs_by_case = {}
# The source file name which describes were the load data came from for a given case, stored on a case name
# basis.
self.load_file_name_by_case = {}
# Number of users for a given case.
self.load_n_users_by_case = {}
# The filtering used for a given case, stored on a case name basis.
self.filter_options_by_case = {}
# The filtering used for a given case, stored on a case name basis.
self.customer_keys_by_case = {}
# Demographic info of load profiles used.
self.demographic_info_by_case = {}
# Wholesale price info
self.wholesale_price_info_by_case = {}
# End user tech info
self.end_user_tech_details_by_case = {}
# Add original data that cannot be deleted (this allows for us to restore to original load data)
self.original_data = [
'test_data',
'AG300_G_2010',
'AG300_G_2011',
'AG300_G_2012',
'AG300_N_2010',
'AG300_N_2011',
'AG300_N_2012',
'SGSC2013',
]
self.original_solar_data = [
'solar_profile',
]
class InMemoryData:
def __init__(self):
# Dictionaries for storing data associated with the current state of the program.
self.raw_data = {} # Data as loaded from feather files, stored in dict on a file name basis
# 1) raw data is filtered by percentage of allowed missing data
self.filter_missing_data = None
# 2) filter_missing_data is downsampled by user defined percentage
self.downsample_data = None
# 3) downsample_data is filtered by demographic
self.filtered_data = None
self.is_filtered = False # Flag to indicate if filtering has been applied
# 4) filtered_data is used to calculate user load profiles after end-user-tech (solar/battery/demand response)
self.end_user_tech_data = {'load_profiles': [],
'solar_profiles': [],
'dr_profiles': [],
'battery_profiles': [],
'final_net_profiles': [],
}
self.raw_data_name = None
# Chart data for the load plots, only storing data for non filtered data as filtering can change between plot
# updates.
# Stored on a file name basis.
self.raw_charts = {}
# Load profiles after any filtering, for a given case, stored on a case name basis.
self.load_by_case = {}
# Load message by case name
self.load_message_name_by_case = {}
# Current demographic info after filter.
self.filtered_demo_info = None
# End user technology sample.
self.end_user_tech_sample = None
self.end_user_tech_sample_applied = False
self.end_user_tech_profiles = None
self.end_user_tech_details = None
# Filtering options applied to get the current filtered data.
self.filter_state = None
self.solar_profile_data = {} # Data as loaded from feather files, stored in dict on a file name basis
self.network_load = None
# Data subset to save/load.
self.project_data = ProjectData()