Skip to content

Commit 21ce2c0

Browse files
authored
Improve Configuration and Prediction Usability (#220)
* Update utilities in utils submodule. * Add base configuration modules. * Add server base configuration modules. * Add devices base configuration modules. * Add optimization base configuration modules. * Add utils base configuration modules. * Add prediction abstract and base classes plus tests. * Add PV forecast to prediction submodule. The PV forecast modules are adapted from the class_pvforecast module and replace it. * Add weather forecast to prediction submodule. The modules provide classes and methods to retrieve, manage, and process weather forecast data from various sources. Includes are structured representations of weather data and utilities for fetching forecasts for specific locations and time ranges. BrightSky and ClearOutside are currently supported. * Add electricity price forecast to prediction submodule. * Adapt fastapi server to base config and add fasthtml server. * Add ems to core submodule. * Adapt genetic to config. * Adapt visualize to config. * Adapt common test fixtures to config. * Add load forecast to prediction submodule. * Add core abstract and base classes. * Adapt single test optimization to config. * Adapt devices to config. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
1 parent 0d03b31 commit 21ce2c0

9 files changed

+16145
-396
lines changed

docs/akkudoktoreos/openapi.json

+4,937-381
Large diffs are not rendered by default.
+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"config_file_path": null,
3+
"config_folder_path": null,
4+
"data_cache_path": null,
5+
"data_cache_subpath": null,
6+
"data_folder_path": null,
7+
"data_output_path": null,
8+
"data_output_subpath": null,
9+
"elecprice_provider": null,
10+
"elecpriceimport_file_path": null,
11+
"latitude": null,
12+
"load0_import_file_path": null,
13+
"load0_name": null,
14+
"load0_provider": null,
15+
"load1_import_file_path": null,
16+
"load1_name": null,
17+
"load1_provider": null,
18+
"load2_import_file_path": null,
19+
"load2_name": null,
20+
"load2_provider": null,
21+
"load3_import_file_path": null,
22+
"load3_name": null,
23+
"load3_provider": null,
24+
"load4_import_file_path": null,
25+
"load4_name": null,
26+
"load4_provider": null,
27+
"loadakkudoktor_year_energy": null,
28+
"longitude": null,
29+
"optimization_ev_available_charge_rates_percent": [],
30+
"optimization_hours": 24,
31+
"optimization_penalty": null,
32+
"prediction_historic_hours": 48,
33+
"prediction_hours": 48,
34+
"pvforecast0_albedo": null,
35+
"pvforecast0_inverter_model": null,
36+
"pvforecast0_inverter_paco": null,
37+
"pvforecast0_loss": null,
38+
"pvforecast0_module_model": null,
39+
"pvforecast0_modules_per_string": null,
40+
"pvforecast0_mountingplace": "free",
41+
"pvforecast0_optimal_surface_tilt": false,
42+
"pvforecast0_optimalangles": false,
43+
"pvforecast0_peakpower": null,
44+
"pvforecast0_pvtechchoice": "crystSi",
45+
"pvforecast0_strings_per_inverter": null,
46+
"pvforecast0_surface_azimuth": 180,
47+
"pvforecast0_surface_tilt": 0,
48+
"pvforecast0_trackingtype": 0,
49+
"pvforecast0_userhorizon": null,
50+
"pvforecast1_albedo": null,
51+
"pvforecast1_inverter_model": null,
52+
"pvforecast1_inverter_paco": null,
53+
"pvforecast1_loss": 0,
54+
"pvforecast1_module_model": null,
55+
"pvforecast1_modules_per_string": null,
56+
"pvforecast1_mountingplace": "free",
57+
"pvforecast1_optimal_surface_tilt": false,
58+
"pvforecast1_optimalangles": false,
59+
"pvforecast1_peakpower": null,
60+
"pvforecast1_pvtechchoice": "crystSi",
61+
"pvforecast1_strings_per_inverter": null,
62+
"pvforecast1_surface_azimuth": 180,
63+
"pvforecast1_surface_tilt": 0,
64+
"pvforecast1_trackingtype": 0,
65+
"pvforecast1_userhorizon": null,
66+
"pvforecast2_albedo": null,
67+
"pvforecast2_inverter_model": null,
68+
"pvforecast2_inverter_paco": null,
69+
"pvforecast2_loss": 0,
70+
"pvforecast2_module_model": null,
71+
"pvforecast2_modules_per_string": null,
72+
"pvforecast2_mountingplace": "free",
73+
"pvforecast2_optimal_surface_tilt": false,
74+
"pvforecast2_optimalangles": false,
75+
"pvforecast2_peakpower": null,
76+
"pvforecast2_pvtechchoice": "crystSi",
77+
"pvforecast2_strings_per_inverter": null,
78+
"pvforecast2_surface_azimuth": 180,
79+
"pvforecast2_surface_tilt": 0,
80+
"pvforecast2_trackingtype": 0,
81+
"pvforecast2_userhorizon": null,
82+
"pvforecast3_albedo": null,
83+
"pvforecast3_inverter_model": null,
84+
"pvforecast3_inverter_paco": null,
85+
"pvforecast3_loss": 0,
86+
"pvforecast3_module_model": null,
87+
"pvforecast3_modules_per_string": null,
88+
"pvforecast3_mountingplace": "free",
89+
"pvforecast3_optimal_surface_tilt": false,
90+
"pvforecast3_optimalangles": false,
91+
"pvforecast3_peakpower": null,
92+
"pvforecast3_pvtechchoice": "crystSi",
93+
"pvforecast3_strings_per_inverter": null,
94+
"pvforecast3_surface_azimuth": 180,
95+
"pvforecast3_surface_tilt": 0,
96+
"pvforecast3_trackingtype": 0,
97+
"pvforecast3_userhorizon": null,
98+
"pvforecast4_albedo": null,
99+
"pvforecast4_inverter_model": null,
100+
"pvforecast4_inverter_paco": null,
101+
"pvforecast4_loss": 0,
102+
"pvforecast4_module_model": null,
103+
"pvforecast4_modules_per_string": null,
104+
"pvforecast4_mountingplace": "free",
105+
"pvforecast4_optimal_surface_tilt": false,
106+
"pvforecast4_optimalangles": false,
107+
"pvforecast4_peakpower": null,
108+
"pvforecast4_pvtechchoice": "crystSi",
109+
"pvforecast4_strings_per_inverter": null,
110+
"pvforecast4_surface_azimuth": 180,
111+
"pvforecast4_surface_tilt": 0,
112+
"pvforecast4_trackingtype": 0,
113+
"pvforecast4_userhorizon": null,
114+
"pvforecast_provider": null,
115+
"pvforecastimport_file_path": null,
116+
"server_fastapi_host": "0.0.0.0",
117+
"server_fastapi_port": 8503,
118+
"server_fasthtml_host": "0.0.0.0",
119+
"server_fasthtml_port": 8504,
120+
"weather_provider": null,
121+
"weatherimport_file_path": null
122+
}

src/akkudoktoreos/default.config.json

-15
This file was deleted.

tests/testdata/EOS.config.json

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"config_file_path": null,
3+
"config_folder_path": null,
4+
"data_cache_path": null,
5+
"data_cache_subpath": null,
6+
"data_folder_path": null,
7+
"data_output_path": null,
8+
"data_output_subpath": null,
9+
"elecprice_provider": null,
10+
"elecpriceimport_file_path": null,
11+
"latitude": null,
12+
"load0_import_file_path": null,
13+
"load0_name": null,
14+
"load0_provider": null,
15+
"load1_import_file_path": null,
16+
"load1_name": null,
17+
"load1_provider": null,
18+
"load2_import_file_path": null,
19+
"load2_name": null,
20+
"load2_provider": null,
21+
"load3_import_file_path": null,
22+
"load3_name": null,
23+
"load3_provider": null,
24+
"load4_import_file_path": null,
25+
"load4_name": null,
26+
"load4_provider": null,
27+
"loadakkudoktor_year_energy": null,
28+
"longitude": null,
29+
"optimization_ev_available_charge_rates_percent": [],
30+
"optimization_hours": 24,
31+
"optimization_penalty": null,
32+
"prediction_historic_hours": 48,
33+
"prediction_hours": 48,
34+
"pvforecast0_albedo": null,
35+
"pvforecast0_inverter_model": null,
36+
"pvforecast0_inverter_paco": null,
37+
"pvforecast0_loss": null,
38+
"pvforecast0_module_model": null,
39+
"pvforecast0_modules_per_string": null,
40+
"pvforecast0_mountingplace": "free",
41+
"pvforecast0_optimal_surface_tilt": false,
42+
"pvforecast0_optimalangles": false,
43+
"pvforecast0_peakpower": null,
44+
"pvforecast0_pvtechchoice": "crystSi",
45+
"pvforecast0_strings_per_inverter": null,
46+
"pvforecast0_surface_azimuth": 180,
47+
"pvforecast0_surface_tilt": 0,
48+
"pvforecast0_trackingtype": 0,
49+
"pvforecast0_userhorizon": null,
50+
"pvforecast1_albedo": null,
51+
"pvforecast1_inverter_model": null,
52+
"pvforecast1_inverter_paco": null,
53+
"pvforecast1_loss": 0,
54+
"pvforecast1_module_model": null,
55+
"pvforecast1_modules_per_string": null,
56+
"pvforecast1_mountingplace": "free",
57+
"pvforecast1_optimal_surface_tilt": false,
58+
"pvforecast1_optimalangles": false,
59+
"pvforecast1_peakpower": null,
60+
"pvforecast1_pvtechchoice": "crystSi",
61+
"pvforecast1_strings_per_inverter": null,
62+
"pvforecast1_surface_azimuth": 180,
63+
"pvforecast1_surface_tilt": 0,
64+
"pvforecast1_trackingtype": 0,
65+
"pvforecast1_userhorizon": null,
66+
"pvforecast2_albedo": null,
67+
"pvforecast2_inverter_model": null,
68+
"pvforecast2_inverter_paco": null,
69+
"pvforecast2_loss": 0,
70+
"pvforecast2_module_model": null,
71+
"pvforecast2_modules_per_string": null,
72+
"pvforecast2_mountingplace": "free",
73+
"pvforecast2_optimal_surface_tilt": false,
74+
"pvforecast2_optimalangles": false,
75+
"pvforecast2_peakpower": null,
76+
"pvforecast2_pvtechchoice": "crystSi",
77+
"pvforecast2_strings_per_inverter": null,
78+
"pvforecast2_surface_azimuth": 180,
79+
"pvforecast2_surface_tilt": 0,
80+
"pvforecast2_trackingtype": 0,
81+
"pvforecast2_userhorizon": null,
82+
"pvforecast3_albedo": null,
83+
"pvforecast3_inverter_model": null,
84+
"pvforecast3_inverter_paco": null,
85+
"pvforecast3_loss": 0,
86+
"pvforecast3_module_model": null,
87+
"pvforecast3_modules_per_string": null,
88+
"pvforecast3_mountingplace": "free",
89+
"pvforecast3_optimal_surface_tilt": false,
90+
"pvforecast3_optimalangles": false,
91+
"pvforecast3_peakpower": null,
92+
"pvforecast3_pvtechchoice": "crystSi",
93+
"pvforecast3_strings_per_inverter": null,
94+
"pvforecast3_surface_azimuth": 180,
95+
"pvforecast3_surface_tilt": 0,
96+
"pvforecast3_trackingtype": 0,
97+
"pvforecast3_userhorizon": null,
98+
"pvforecast4_albedo": null,
99+
"pvforecast4_inverter_model": null,
100+
"pvforecast4_inverter_paco": null,
101+
"pvforecast4_loss": 0,
102+
"pvforecast4_module_model": null,
103+
"pvforecast4_modules_per_string": null,
104+
"pvforecast4_mountingplace": "free",
105+
"pvforecast4_optimal_surface_tilt": false,
106+
"pvforecast4_optimalangles": false,
107+
"pvforecast4_peakpower": null,
108+
"pvforecast4_pvtechchoice": "crystSi",
109+
"pvforecast4_strings_per_inverter": null,
110+
"pvforecast4_surface_azimuth": 180,
111+
"pvforecast4_surface_tilt": 0,
112+
"pvforecast4_trackingtype": 0,
113+
"pvforecast4_userhorizon": null,
114+
"pvforecast_provider": null,
115+
"pvforecastimport_file_path": null,
116+
"server_fastapi_host": "0.0.0.0",
117+
"server_fastapi_port": 8503,
118+
"server_fasthtml_host": "0.0.0.0",
119+
"server_fasthtml_port": 8504,
120+
"weather_provider": null,
121+
"weatherimport_file_path": null
122+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"meta":{"start_timestamp":1733871600000,"end_timestamp":1733958000000,"start":"2024-12-10T23:00:00.000Z","end":"2024-12-11T23:00:00.000Z"},"values":[{"start_timestamp":1733871600000,"end_timestamp":1733875200000,"marketprice":115.94,"unit":"Eur/MWh","start":"2024-12-10T23:00:00.000Z","end":"2024-12-11T00:00:00.000Z","marketpriceEurocentPerKWh":11.59},{"start_timestamp":1733875200000,"end_timestamp":1733878800000,"marketprice":108.22,"unit":"Eur/MWh","start":"2024-12-11T00:00:00.000Z","end":"2024-12-11T01:00:00.000Z","marketpriceEurocentPerKWh":10.82},{"start_timestamp":1733878800000,"end_timestamp":1733882400000,"marketprice":107.31,"unit":"Eur/MWh","start":"2024-12-11T01:00:00.000Z","end":"2024-12-11T02:00:00.000Z","marketpriceEurocentPerKWh":10.73},{"start_timestamp":1733882400000,"end_timestamp":1733886000000,"marketprice":106.17,"unit":"Eur/MWh","start":"2024-12-11T02:00:00.000Z","end":"2024-12-11T03:00:00.000Z","marketpriceEurocentPerKWh":10.62},{"start_timestamp":1733886000000,"end_timestamp":1733889600000,"marketprice":108.69,"unit":"Eur/MWh","start":"2024-12-11T03:00:00.000Z","end":"2024-12-11T04:00:00.000Z","marketpriceEurocentPerKWh":10.87},{"start_timestamp":1733889600000,"end_timestamp":1733893200000,"marketprice":125.31,"unit":"Eur/MWh","start":"2024-12-11T04:00:00.000Z","end":"2024-12-11T05:00:00.000Z","marketpriceEurocentPerKWh":12.53},{"start_timestamp":1733893200000,"end_timestamp":1733896800000,"marketprice":163.42,"unit":"Eur/MWh","start":"2024-12-11T05:00:00.000Z","end":"2024-12-11T06:00:00.000Z","marketpriceEurocentPerKWh":16.34},{"start_timestamp":1733896800000,"end_timestamp":1733900400000,"marketprice":295.5,"unit":"Eur/MWh","start":"2024-12-11T06:00:00.000Z","end":"2024-12-11T07:00:00.000Z","marketpriceEurocentPerKWh":29.55},{"start_timestamp":1733900400000,"end_timestamp":1733904000000,"marketprice":368.97,"unit":"Eur/MWh","start":"2024-12-11T07:00:00.000Z","end":"2024-12-11T08:00:00.000Z","marketpriceEurocentPerKWh":36.9},{"start_timestamp":1733904000000,"end_timestamp":1733907600000,"marketprice":377.12,"unit":"Eur/MWh","start":"2024-12-11T08:00:00.000Z","end":"2024-12-11T09:00:00.000Z","marketpriceEurocentPerKWh":37.71},{"start_timestamp":1733907600000,"end_timestamp":1733911200000,"marketprice":348.64,"unit":"Eur/MWh","start":"2024-12-11T09:00:00.000Z","end":"2024-12-11T10:00:00.000Z","marketpriceEurocentPerKWh":34.86},{"start_timestamp":1733911200000,"end_timestamp":1733914800000,"marketprice":379.99,"unit":"Eur/MWh","start":"2024-12-11T10:00:00.000Z","end":"2024-12-11T11:00:00.000Z","marketpriceEurocentPerKWh":38},{"start_timestamp":1733914800000,"end_timestamp":1733918400000,"marketprice":385.87,"unit":"Eur/MWh","start":"2024-12-11T11:00:00.000Z","end":"2024-12-11T12:00:00.000Z","marketpriceEurocentPerKWh":38.59},{"start_timestamp":1733918400000,"end_timestamp":1733922000000,"marketprice":404.91,"unit":"Eur/MWh","start":"2024-12-11T12:00:00.000Z","end":"2024-12-11T13:00:00.000Z","marketpriceEurocentPerKWh":40.49},{"start_timestamp":1733922000000,"end_timestamp":1733925600000,"marketprice":371.96,"unit":"Eur/MWh","start":"2024-12-11T13:00:00.000Z","end":"2024-12-11T14:00:00.000Z","marketpriceEurocentPerKWh":37.2},{"start_timestamp":1733925600000,"end_timestamp":1733929200000,"marketprice":380.94,"unit":"Eur/MWh","start":"2024-12-11T14:00:00.000Z","end":"2024-12-11T15:00:00.000Z","marketpriceEurocentPerKWh":38.09},{"start_timestamp":1733929200000,"end_timestamp":1733932800000,"marketprice":437.87,"unit":"Eur/MWh","start":"2024-12-11T15:00:00.000Z","end":"2024-12-11T16:00:00.000Z","marketpriceEurocentPerKWh":43.79},{"start_timestamp":1733932800000,"end_timestamp":1733936400000,"marketprice":445.08,"unit":"Eur/MWh","start":"2024-12-11T16:00:00.000Z","end":"2024-12-11T17:00:00.000Z","marketpriceEurocentPerKWh":44.51},{"start_timestamp":1733936400000,"end_timestamp":1733940000000,"marketprice":359.92,"unit":"Eur/MWh","start":"2024-12-11T17:00:00.000Z","end":"2024-12-11T18:00:00.000Z","marketpriceEurocentPerKWh":35.99},{"start_timestamp":1733940000000,"end_timestamp":1733943600000,"marketprice":341.25,"unit":"Eur/MWh","start":"2024-12-11T18:00:00.000Z","end":"2024-12-11T19:00:00.000Z","marketpriceEurocentPerKWh":34.13},{"start_timestamp":1733943600000,"end_timestamp":1733947200000,"marketprice":206.82,"unit":"Eur/MWh","start":"2024-12-11T19:00:00.000Z","end":"2024-12-11T20:00:00.000Z","marketpriceEurocentPerKWh":20.68},{"start_timestamp":1733947200000,"end_timestamp":1733950800000,"marketprice":171.2,"unit":"Eur/MWh","start":"2024-12-11T20:00:00.000Z","end":"2024-12-11T21:00:00.000Z","marketpriceEurocentPerKWh":17.12},{"start_timestamp":1733950800000,"end_timestamp":1733954400000,"marketprice":150,"unit":"Eur/MWh","start":"2024-12-11T21:00:00.000Z","end":"2024-12-11T22:00:00.000Z","marketpriceEurocentPerKWh":15},{"start_timestamp":1733954400000,"end_timestamp":1733958000000,"marketprice":135.96,"unit":"Eur/MWh","start":"2024-12-11T22:00:00.000Z","end":"2024-12-11T23:00:00.000Z","marketpriceEurocentPerKWh":13.6}]}

tests/testdata/import_input_1.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"load0_mean": [
3+
676.71, 876.19, 527.13, 468.88, 531.38, 517.95, 483.15, 472.28, 1011.68, 995.00,
4+
1053.07, 1063.91, 1320.56, 1132.03, 1163.67, 1176.82, 1216.22, 1103.78, 1129.12,
5+
1178.71, 1050.98, 988.56, 912.38, 704.61, 516.37, 868.05, 694.34, 608.79, 556.31,
6+
488.89, 506.91, 804.89, 1141.98, 1056.97, 992.46, 1155.99, 827.01, 1257.98, 1232.67,
7+
871.26, 860.88, 1158.03, 1222.72, 1221.04, 949.99, 987.01, 733.99, 592.97
8+
],
9+
"elecprice_marketprice": [
10+
0.3384, 0.3318, 0.3284, 0.3283, 0.3289, 0.3334, 0.3290,
11+
0.3302, 0.3042, 0.2430, 0.2280, 0.2212, 0.2093, 0.1879,
12+
0.1838, 0.2004, 0.2198, 0.2270, 0.2997, 0.3195, 0.3081,
13+
0.2969, 0.2921, 0.2780, 0.3384, 0.3318, 0.3284, 0.3283,
14+
0.3289, 0.3334, 0.3290, 0.3302, 0.3042, 0.2430, 0.2280,
15+
0.2212, 0.2093, 0.1879, 0.1838, 0.2004, 0.2198, 0.2270,
16+
0.2997, 0.3195, 0.3081, 0.2969, 0.2921, 0.2780
17+
],
18+
"pvforecast_ac_power": [
19+
0, 0, 0, 0, 0, 0, 0, 8.05, 352.91, 728.51, 930.28, 1043.25, 1106.74, 1161.69,
20+
6018.82, 5519.07, 3969.88, 3017.96, 1943.07, 1007.17, 319.67, 7.88, 0, 0, 0, 0,
21+
0, 0, 0, 0, 0, 5.04, 335.59, 705.32, 1121.12, 1604.79, 2157.38, 1433.25, 5718.49,
22+
4553.96, 3027.55, 2574.46, 1720.4, 963.4, 383.3, 0, 0, 0
23+
],
24+
"weather_temp_air": [
25+
18.3, 17.8, 16.9, 16.2, 15.6, 15.1, 14.6, 14.2, 14.3, 14.8, 15.7, 16.7,
26+
17.4, 18.0, 18.6, 19.2, 19.1, 18.7, 18.5, 17.7, 16.2, 14.6, 13.6, 13.0,
27+
12.6, 12.2, 11.7, 11.6, 11.3, 11.0, 10.7, 10.2, 11.4, 14.4, 16.4, 18.3,
28+
19.5, 20.7, 21.9, 22.7, 23.1, 23.1, 22.8, 21.8, 20.2, 19.1, 18.0, 17.4
29+
]
30+
}

0 commit comments

Comments
 (0)