Skip to content

Commit 2bf6dcc

Browse files
committed
Adding energy to the local solar component.
1 parent 46f0e65 commit 2bf6dcc

File tree

7 files changed

+89
-93
lines changed

7 files changed

+89
-93
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ Flask/build
66
Flask/application/modelling/data/luomi/output/*
77
Electron/app/model
88
Flask/*.pyc
9-
*.pyc
9+
*.pyc
10+
*.idea*

Flask/application/api.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,20 +250,19 @@ def test_run_sim(params):
250250
elif model == 'mike':
251251
wrapper = MikeWrapper()
252252
else:
253-
raise Exception("Model was neither mike nor luomi: "+ str(model))
253+
raise Exception("Model was neither mike nor luomi: " + str(model))
254254

255255
wrapper.load(params)
256256
wrapper.create_objects()
257257
results = wrapper.run(status_callback)
258258

259259
print("api.test_run_sim()", "Model Results", json.dumps(results, indent=1))
260260

261-
emit('status_channel',{'data':{'status':'finished'}})
261+
emit('status_channel', {'data': {'status': 'finished'}})
262262
emit('chart_results_channel', {"data": results})
263263
status_callback("Modelling Complete")
264264

265265

266-
267266
def status_callback(message):
268267
# my_status = "Status: " + message
269268
# print("--- Status Callback", message)
@@ -287,9 +286,6 @@ def status_callback(message):
287286
}
288287
)
289288

290-
291-
292-
293289

294290
if __name__ == 'main':
295291
socketio.run(app, debug=True)
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
timestamp,Participant 1,Participant 2,Participant 3,Participant 4,Participant 5,Participant 6,Participant 7,Participant 8,Participant 9,Participant 10,Participant 11
2-
26/02/2017 3:30,0.265,0.051,5.58,0.096,0.556,0.23,0.147,0.145,0.0,0.08,0.121
3-
26/02/2017 4:00,0.158,0.016,7.392,0.095,0.6809999999999999,0.205,0.132,0.255,0.0,0.035,0.10099999999999999
4-
26/02/2017 4:30,0.168,0.035,6.96,0.061,0.713,0.31,0.153,0.159,0.0,0.094,0.08900000000000001
5-
26/02/2017 5:00,0.168,0.043,6.292000000000001,0.091,0.684,0.218,0.13699999999999998,0.537,0.0,0.253,0.077
6-
26/02/2017 5:30,0.17,0.011000000000000001,7.18,0.065,0.6829999999999999,0.273,0.159,0.304,0.0,0.127,0.081
7-
26/02/2017 6:00,0.433,0.043,5.78,0.081,0.7040000000000001,0.2,0.125,1.351,0.001,0.035,0.08199999999999999
8-
26/02/2017 6:30,0.155,0.035,6.62,0.084,0.708,0.265,0.037000000000000005,0.005,0.0,0.038,0.07400000000000001
9-
26/02/2017 7:00,0.158,0.013000000000000001,6.0520000000000005,0.086,0.7070000000000001,0.205,0.0,0.0,0.0,0.040999999999999995,0.11900000000000001
10-
26/02/2017 7:30,0.165,0.047,5.66,0.10099999999999999,0.71,0.5579999999999999,0.0,0.0,0.0,0.035,0.098
11-
26/02/2017 8:00,0.165,0.028999999999999998,7.652,0.08,0.711,0.22,0.0,0.0,0.0,0.187,0.102
12-
26/02/2017 8:30,0.17,0.019,7.06,0.105,0.71,0.228,0.0,0.0,0.0,0.043,0.073
13-
26/02/2017 9:00,0.165,0.048,7.92,0.08,0.708,0.21,0.0,0.0,0.001,0.036000000000000004,0.08800000000000001
14-
26/02/2017 9:30,0.16,0.022000000000000002,6.372000000000001,0.102,0.546,0.25,0.0,0.0,0.0,0.036000000000000004,0.079
15-
26/02/2017 10:00,0.158,0.028999999999999998,7.412000000000001,0.08,1.202,0.212,0.0,0.0,0.0,0.039,0.081
16-
26/02/2017 10:30,0.165,0.05,7.38,0.078,1.01,0.24,0.0,0.033,0.001,0.040999999999999995,0.109
17-
26/02/2017 11:00,0.17,0.064,9.32,0.08,0.9990000000000001,0.21,0.0,0.0,0.0,0.035,0.106
18-
26/02/2017 11:30,0.168,0.07200000000000001,9.3,0.065,0.995,0.245,0.0,0.0,0.001,0.038,0.11599999999999999
19-
26/02/2017 12:00,0.17300000000000001,0.066,10.12,0.531,0.9740000000000001,0.23800000000000002,0.0,0.0,0.0,0.043,0.075
20-
26/02/2017 12:30,0.163,0.013000000000000001,9.14,0.9,0.9740000000000001,0.198,0.0,0.0,0.0,0.035,0.09
21-
26/02/2017 13:00,0.43,0.062,7.88,0.9390000000000001,0.9890000000000001,0.27,0.0,0.0,0.0,0.038,0.07
22-
26/02/2017 13:30,0.163,0.02,7.032,0.894,1.0070000000000001,0.22,0.0,0.0,0.001,0.043,0.092
23-
26/02/2017 14:00,0.17300000000000001,0.044000000000000004,7.02,0.903,1.05,0.223,0.0,0.0,0.0,0.036000000000000004,0.085
24-
26/02/2017 14:30,0.175,0.038,6.76,0.903,0.978,0.5,0.0,0.0,0.0,0.038,0.125
25-
26/02/2017 15:00,0.17300000000000001,0.026000000000000002,7.52,0.894,0.983,0.28,0.0,0.0,0.0,0.043,0.10300000000000001
26-
26/02/2017 15:30,0.165,0.055,6.772,0.9179999999999999,0.9840000000000001,0.198,0.0,0.0,0.0,0.036000000000000004,0.10800000000000001
27-
26/02/2017 16:00,0.163,0.013999999999999999,7.332000000000001,0.8759999999999999,0.987,0.253,0.0,0.0,0.0,0.038,0.077
28-
26/02/2017 16:30,0.163,0.055,7.24,0.258,1.004,0.253,0.0,0.035,0.0,0.043,0.083
29-
26/02/2017 17:00,0.168,0.027000000000000003,7.66,0.054000000000000006,0.968,0.28300000000000003,0.0,0.073,0.0,0.036000000000000004,0.08199999999999999
30-
26/02/2017 17:30,0.175,0.035,7.98,0.096,0.953,0.27,0.013999999999999999,0.20600000000000002,0.0,0.038,0.078
31-
26/02/2017 18:00,0.17,0.047,7.247999999999999,0.091,0.951,0.2,0.032,0.369,0.0,0.043,0.114
32-
26/02/2017 18:30,0.21,0.013000000000000001,7.38,0.086,0.9279999999999999,0.253,0.14800000000000002,0.897,0.0,0.036000000000000004,0.10800000000000001
33-
26/02/2017 19:00,0.268,0.057999999999999996,6.48,0.054000000000000006,0.7829999999999999,0.233,0.159,0.371,0.0,0.038,0.126
34-
26/02/2017 19:30,0.268,0.024,7.1,0.068,0.55,0.233,0.14300000000000002,0.24100000000000002,0.0,0.042,0.084
35-
26/02/2017 20:00,0.54,0.034,8.36,0.068,0.5529999999999999,0.205,0.158,0.239,0.0,0.036000000000000004,0.092
36-
26/02/2017 20:30,0.273,0.047,7.76,0.051,0.8959999999999999,0.278,0.13699999999999998,0.261,0.0,0.038,0.075
37-
26/02/2017 21:00,0.273,0.013000000000000001,6.172000000000001,0.076,0.535,0.18,0.159,0.22399999999999998,0.0,0.042,0.083
38-
26/02/2017 21:30,0.275,0.05,6.34,0.045,0.56,0.568,0.239,0.8190000000000001,0.0,0.036000000000000004,0.08199999999999999
39-
26/02/2017 22:00,0.275,0.03,6.492000000000001,0.07200000000000001,0.5670000000000001,0.212,0.18600000000000003,0.248,0.001,0.036000000000000004,0.10400000000000001
1+
timestamp,Participant 1
2+
26/02/2017 3:30,0.051
3+
26/02/2017 4:00,0.016
4+
26/02/2017 4:30,0.035
5+
26/02/2017 5:00,0.043
6+
26/02/2017 5:30,0.011000000000000001
7+
26/02/2017 6:00,0.043
8+
26/02/2017 6:30,0.035
9+
26/02/2017 7:00,0.013000000000000001
10+
26/02/2017 7:30,0.047
11+
26/02/2017 8:00,0.028999999999999998
12+
26/02/2017 8:30,0.019
13+
26/02/2017 9:00,0.048
14+
26/02/2017 9:30,0.022000000000000002
15+
26/02/2017 10:00,0.028999999999999998
16+
26/02/2017 10:30,0.05
17+
26/02/2017 11:00,0.064
18+
26/02/2017 11:30,0.07200000000000001
19+
26/02/2017 12:00,0.066
20+
26/02/2017 12:30,0.013000000000000001
21+
26/02/2017 13:00,0.062
22+
26/02/2017 13:30,0.02
23+
26/02/2017 14:00,0.044000000000000004
24+
26/02/2017 14:30,0.038
25+
26/02/2017 15:00,0.026000000000000002
26+
26/02/2017 15:30,0.055
27+
26/02/2017 16:00,0.013999999999999999
28+
26/02/2017 16:30,0.055
29+
26/02/2017 17:00,0.027000000000000003
30+
26/02/2017 17:30,0.035
31+
26/02/2017 18:00,0.047
32+
26/02/2017 18:30,0.013000000000000001
33+
26/02/2017 19:00,0.057999999999999996
34+
26/02/2017 19:30,0.024
35+
26/02/2017 20:00,0.034
36+
26/02/2017 20:30,0.047
37+
26/02/2017 21:00,0.013000000000000001
38+
26/02/2017 21:30,0.05
39+
26/02/2017 22:00,0.03
Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
timestamp,Participant 1,Participant 2,Participant 3,Participant 4,Participant 5,Participant 6,Participant 7,Participant 8,Participant 9,Participant 10,Participant 11
2-
26/02/2017 3:30,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
3-
26/02/2017 4:00,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
4-
26/02/2017 4:30,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
5-
26/02/2017 5:00,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
6-
26/02/2017 5:30,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
7-
26/02/2017 6:00,0.003553005,0.003553005,0.003553005,0.003553005,0.003553005,0.003553005,0.003553005,0.003553005,0.003553005,0.003553005,0.003553005
8-
26/02/2017 6:30,0.023523041,0.023523041,0.023523041,0.023523041,0.023523041,0.023523041,0.023523041,0.023523041,0.023523041,0.023523041,0.023523041
9-
26/02/2017 7:00,0.063444426,0.063444426,0.063444426,0.063444426,0.063444426,0.063444426,0.063444426,0.063444426,0.063444426,0.063444426,0.063444426
10-
26/02/2017 7:30,0.10172237099999999,0.10172237099999999,0.10172237099999999,0.10172237099999999,0.10172237099999999,0.10172237099999999,0.10172237099999999,0.10172237099999999,0.10172237099999999,0.10172237099999999,0.10172237099999999
11-
26/02/2017 8:00,0.132877758,0.132877758,0.132877758,0.132877758,0.132877758,0.132877758,0.132877758,0.132877758,0.132877758,0.132877758,0.132877758
12-
26/02/2017 8:30,0.155646496,0.155646496,0.155646496,0.155646496,0.155646496,0.155646496,0.155646496,0.155646496,0.155646496,0.155646496,0.155646496
13-
26/02/2017 9:00,0.195606224,0.195606224,0.195606224,0.195606224,0.195606224,0.195606224,0.195606224,0.195606224,0.195606224,0.195606224,0.195606224
14-
26/02/2017 9:30,0.21376504,0.21376504,0.21376504,0.21376504,0.21376504,0.21376504,0.21376504,0.21376504,0.21376504,0.21376504,0.21376504
15-
26/02/2017 10:00,0.230492471,0.230492471,0.230492471,0.230492471,0.230492471,0.230492471,0.230492471,0.230492471,0.230492471,0.230492471,0.230492471
16-
26/02/2017 10:30,0.265317402,0.265317402,0.265317402,0.265317402,0.265317402,0.265317402,0.265317402,0.265317402,0.265317402,0.265317402,0.265317402
17-
26/02/2017 11:00,0.283608925,0.283608925,0.283608925,0.283608925,0.283608925,0.283608925,0.283608925,0.283608925,0.283608925,0.283608925,0.283608925
18-
26/02/2017 11:30,0.275362531,0.275362531,0.275362531,0.275362531,0.275362531,0.275362531,0.275362531,0.275362531,0.275362531,0.275362531,0.275362531
19-
26/02/2017 12:00,0.276618717,0.276618717,0.276618717,0.276618717,0.276618717,0.276618717,0.276618717,0.276618717,0.276618717,0.276618717,0.276618717
20-
26/02/2017 12:30,0.26093375399999996,0.26093375399999996,0.26093375399999996,0.26093375399999996,0.26093375399999996,0.26093375399999996,0.26093375399999996,0.26093375399999996,0.26093375399999996,0.26093375399999996,0.26093375399999996
21-
26/02/2017 13:00,0.246004392,0.246004392,0.246004392,0.246004392,0.246004392,0.246004392,0.246004392,0.246004392,0.246004392,0.246004392,0.246004392
22-
26/02/2017 13:30,0.24648402600000002,0.24648402600000002,0.24648402600000002,0.24648402600000002,0.24648402600000002,0.24648402600000002,0.24648402600000002,0.24648402600000002,0.24648402600000002,0.24648402600000002,0.24648402600000002
23-
26/02/2017 14:00,0.219712813,0.219712813,0.219712813,0.219712813,0.219712813,0.219712813,0.219712813,0.219712813,0.219712813,0.219712813,0.219712813
24-
26/02/2017 14:30,0.19128016899999997,0.19128016899999997,0.19128016899999997,0.19128016899999997,0.19128016899999997,0.19128016899999997,0.19128016899999997,0.19128016899999997,0.19128016899999997,0.19128016899999997,0.19128016899999997
25-
26/02/2017 15:00,0.15310075199999998,0.15310075199999998,0.15310075199999998,0.15310075199999998,0.15310075199999998,0.15310075199999998,0.15310075199999998,0.15310075199999998,0.15310075199999998,0.15310075199999998,0.15310075199999998
26-
26/02/2017 15:30,0.138380662,0.138380662,0.138380662,0.138380662,0.138380662,0.138380662,0.138380662,0.138380662,0.138380662,0.138380662,0.138380662
27-
26/02/2017 16:00,0.13468988099999998,0.13468988099999998,0.13468988099999998,0.13468988099999998,0.13468988099999998,0.13468988099999998,0.13468988099999998,0.13468988099999998,0.13468988099999998,0.13468988099999998,0.13468988099999998
28-
26/02/2017 16:30,0.111056339,0.111056339,0.111056339,0.111056339,0.111056339,0.111056339,0.111056339,0.111056339,0.111056339,0.111056339,0.111056339
29-
26/02/2017 17:00,0.077142938,0.077142938,0.077142938,0.077142938,0.077142938,0.077142938,0.077142938,0.077142938,0.077142938,0.077142938,0.077142938
30-
26/02/2017 17:30,0.04358589,0.04358589,0.04358589,0.04358589,0.04358589,0.04358589,0.04358589,0.04358589,0.04358589,0.04358589,0.04358589
31-
26/02/2017 18:00,0.01380429,0.01380429,0.01380429,0.01380429,0.01380429,0.01380429,0.01380429,0.01380429,0.01380429,0.01380429,0.01380429
32-
26/02/2017 18:30,0.001296576,0.001296576,0.001296576,0.001296576,0.001296576,0.001296576,0.001296576,0.001296576,0.001296576,0.001296576,0.001296576
33-
26/02/2017 19:00,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
1+
timestamp,Participant 1
2+
26/02/2017 3:30,0.0
3+
26/02/2017 4:00,0.0
4+
26/02/2017 4:30,0.0
5+
26/02/2017 5:00,0.0
6+
26/02/2017 5:30,0.0
7+
26/02/2017 6:00,0.003553005
8+
26/02/2017 6:30,0.023523041
9+
26/02/2017 7:00,0.063444426
10+
26/02/2017 7:30,0.10172237099999999
11+
26/02/2017 8:00,0.132877758
12+
26/02/2017 8:30,0.155646496
13+
26/02/2017 9:00,0.195606224
14+
26/02/2017 9:30,0.21376504
15+
26/02/2017 10:00,0.230492471
16+
26/02/2017 10:30,0.265317402
17+
26/02/2017 11:00,0.283608925
18+
26/02/2017 11:30,0.275362531
19+
26/02/2017 12:00,0.276618717
20+
26/02/2017 12:30,0.26093375399999996
21+
26/02/2017 13:00,0.246004392
22+
26/02/2017 13:30,0.24648402600000002
23+
26/02/2017 14:00,0.219712813
24+
26/02/2017 14:30,0.19128016899999997
25+
26/02/2017 15:00,0.15310075199999998
26+
26/02/2017 15:30,0.138380662
27+
26/02/2017 16:00,0.13468988099999998
28+
26/02/2017 16:30,0.111056339
29+
26/02/2017 17:00,0.077142938
30+
26/02/2017 17:30,0.04358589
31+
26/02/2017 18:00,0.01380429
32+
26/02/2017 18:30,0.001296576
33+
26/02/2017 19:00,0.0

Flask/application/modelling/luomi_model/tariffs.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import datetime
44
import io
55

6+
67
class Tariffs():
78

89
def __init__(self, tariff_config_dict):
910
self.config = tariff_config_dict
10-
print("What you're looking for",self.config['retail']['daily_charge'])
11+
print("What you're looking for", self.config['retail']['daily_charge'])
1112

1213
def get_variable_retail_tariff(self, date_time, retail_tariff_type):
1314
# Get data from df
@@ -18,14 +19,14 @@ def get_variable_retail_tariff(self, date_time, retail_tariff_type):
1819
block_1_charge = float(self.config['retail']['block_1_tariff'])
1920
block_2_charge = float(self.config['retail']['block_2_tariff'])
2021

21-
peak_start_time = float(self.config['tou_times'][1])
22+
peak_start_time = float(self.config['tou_times'][1])
2223
peak_end_time = float(self.config['tou_times'][2])
23-
peak_start_time_2 = float(self.config['tou_times'][1]) #Making these the same - just going to have one peak for the moment but leaving the option for 2.
24-
peak_end_time_2 = float(self.config['tou_times'][2])
25-
shoulder_start_time = float(self.config['tou_times'][0])
24+
peak_start_time_2 = float(self.config['tou_times'][1]) # Making these the same - just going to have one peak for the moment but leaving the option for 2.
25+
peak_end_time_2 = float(self.config['tou_times'][2])
26+
shoulder_start_time = float(self.config['tou_times'][0])
2627
shoulder_end_time = float(self.config['tou_times'][1])
2728
shoulder_start_time_2 = float(self.config['tou_times'][2])
28-
shoulder_end_time_2 = float(self.config['tou_times'][3])
29+
shoulder_end_time_2 = float(self.config['tou_times'][3])
2930
block_1_volume = float(self.config['retail']['block_1_volume'])
3031
block_2_volume = float(self.config['retail']['block_2_volume'])
3132

Flask/application/modelling/ui_interfaces/luomi.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,15 @@ def load_network_name(self, ui_inputs):
8484
def load_central_services(self, ui_inputs):
8585
key = "central_services"
8686
if key in ui_inputs:
87-
print(ui_inputs[key])
87+
# print(ui_inputs[key])
8888
self.ui_central_battery.load(ui_inputs[key])
8989

9090
def load_tariffs(self, ui_inputs):
9191
# key = "model_tariffs"
9292
# if key in ui_inputs:
9393
# self.ui_tariffs.load(ui_inputs[key])
94-
self.ui_tariffs = ui_inputs['tariffs'] #This just grabs the new tariffs object from the ui inputs
94+
self.ui_tariffs = ui_inputs['tariffs'] # This just grabs the new tariffs object from the ui inputs
95+
# print('\n\n\n', self.ui_tariffs, '\n\n\n')
9596

9697
def load_participants(self, ui_inputs):
9798
key = "model_participants"
@@ -104,7 +105,6 @@ def load_data_sources(self, ui_inputs):
104105
start, end = self.find_time_periods(ui_inputs[key])
105106
self.time_periods = util.generate_dates_in_range(start, end, 30)
106107

107-
108108
def create_objects(self):
109109

110110
self.model_network = Luomi_Network(self.network_name)
@@ -126,9 +126,8 @@ def create_objects(self):
126126

127127
self.model_tariffs = Luomi_Tariffs(self.ui_tariffs)
128128

129-
print("parameters.py/create_luomi_objects","Made LUOMI Objects without error")
129+
print("parameters.py/create_luomi_objects", "Made LUOMI Objects without error")
130130

131-
132131
def run(self, status):
133132
info_tag = ""
134133
# print("RUN_LUOMI_TIME_PERIODS", self.time_periods)
@@ -141,7 +140,6 @@ def run(self, status):
141140

142141
return parsed_results
143142

144-
145143
# Might move this later.
146144
def find_time_periods(self, frontend_data):
147145

Vue/app/src/pages/inputs/ModelTariffs.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@
112112
</div>
113113
<div class="container-content">
114114
<div class="tariffs">
115-
<!-- <div class="input">
115+
<div class="input">
116116
Energy <input v-model="input_data.tariffs.local_solar.energy"/> <span class="units">($/kWh)</span>
117-
</div> -->
117+
</div>
118118
<div class="input">
119119
Retail <input v-model="input_data.tariffs.local_solar.retail"/> <span class="units">($/kWh)</span>
120120
</div>

0 commit comments

Comments
 (0)