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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
| 2026-04-15 21:58:59 INFO: Loaded 6 secrets from ../data/secrets.json
2026-04-15 21:58:59 INFO: Validating configuration with ConfigurationV0
2026-04-15 21:58:59 info: Day Ahead Optimalisering versie: 2026.04.2
2026-04-15 21:58:59 info: Day Ahead Optimalisering gestart op: 15-04-2026 21:58:59
2026-04-15 21:58:59 info: Day Ahead Optimalisatie gestart: 15-04-2026 21:58:59 taak: train_ml_predictions
2026-04-15 21:58:59 info: KNMI-weerstation: 278 HEINO
2026-04-15 21:58:59 info: Er zijn nog geen winddata van knmi aanwezig
2026-04-15 21:59:00 info: Er zijn data van het KNMI binnengekomen vanaf 2023-04-14 00:00:00+02:00 tot en met 2026-04-09 23:00:00+02:00
2026-04-15 22:00:32 fout: Er is een fout opgetreden, zie de fout-tracering
Traceback (most recent call last):
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
self.dialect.do_execute(
~~~~~~~~~~~~~~~~~~~~~~~^
cursor, str_statement, effective_parameters, context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
cursor.execute(statement, parameters)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 151, in execute
query = self.mogrify(query, args)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 129, in mogrify
query = query % self._escape_args(args, conn)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 104, in _escape_args
return {key: conn.literal(val) for (key, val) in args.items()}
~~~~~~~~~~~~^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/connections.py", line 542, in literal
return self.escape(obj, self.encoders)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/connections.py", line 535, in escape
return converters.escape_item(obj, self.charset, mapping=mapping)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/converters.py", line 25, in escape_item
val = encoder(val, mapping)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/converters.py", line 56, in escape_float
raise ProgrammingError("%s can not be used with MySQL" % s)
pymysql.err.ProgrammingError: nan can not be used with MySQL
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/dao/prog/da_base.py", line 694, in run_task_function
getattr(self, run_task["function"])()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/root/dao/prog/da_base.py", line 644, in train_ml_predictions
solar_predictor.run_train()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/root/dao/prog/solar_predictor.py", line 979, in run_train
weather_data = self.get_weatherdata(start=start)
File "/root/dao/prog/solar_predictor.py", line 895, in get_weatherdata
self.import_knmi_df(start, end)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/root/dao/prog/solar_predictor.py", line 854, in import_knmi_df
self.get_and_save_knmi_data(start, latest_dt, ["FH"])
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/prog/solar_predictor.py", line 824, in get_and_save_knmi_data
self.db_da.savedata(save_df, tablename="values")
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/lib/db_manager.py", line 308, in savedata
connection.execute(insert_value)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
return meth(
self,
distilled_parameters,
execution_options or NO_OPTIONS,
)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/sql/elements.py", line 527, in _execute_on_connection
return connection._execute_clauseelement(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
self, distilled_params, execution_options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement
ret = self._execute_context(
dialect,
...<8 lines>...
cache_hit=cache_hit,
)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
return self._exec_single_context(
~~~~~~~~~~~~~~~~~~~~~~~~~^
dialect, context, statement, parameters
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
self._handle_dbapi_exception(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
e, str_statement, effective_parameters, cursor, context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
self.dialect.do_execute(
~~~~~~~~~~~~~~~~~~~~~~~^
cursor, str_statement, effective_parameters, context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
cursor.execute(statement, parameters)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 151, in execute
query = self.mogrify(query, args)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 129, in mogrify
query = query % self._escape_args(args, conn)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 104, in _escape_args
return {key: conn.literal(val) for (key, val) in args.items()}
~~~~~~~~~~~~^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/connections.py", line 542, in literal
return self.escape(obj, self.encoders)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/connections.py", line 535, in escape
return converters.escape_item(obj, self.charset, mapping=mapping)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/converters.py", line 25, in escape_item
val = encoder(val, mapping)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/converters.py", line 56, in escape_float
raise ProgrammingError("%s can not be used with MySQL" % s)
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) nan can not be used with MySQL
[SQL: INSERT INTO `values` (variabel, time, value) VALUES (%(variabel)s, %(time)s, %(value)s)]
[parameters: {'variabel': 23, 'time': 1740513600, 'value': nan}]
(Background on this error at: https://sqlalche.me/e/20/f405)
Traceback (most recent call last):
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
self.dialect.do_execute(
~~~~~~~~~~~~~~~~~~~~~~~^
cursor, str_statement, effective_parameters, context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
cursor.execute(statement, parameters)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 151, in execute
query = self.mogrify(query, args)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 129, in mogrify
query = query % self._escape_args(args, conn)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 104, in _escape_args
return {key: conn.literal(val) for (key, val) in args.items()}
~~~~~~~~~~~~^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/connections.py", line 542, in literal
return self.escape(obj, self.encoders)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/connections.py", line 535, in escape
return converters.escape_item(obj, self.charset, mapping=mapping)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/converters.py", line 25, in escape_item
val = encoder(val, mapping)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/converters.py", line 56, in escape_float
raise ProgrammingError("%s can not be used with MySQL" % s)
pymysql.err.ProgrammingError: nan can not be used with MySQL
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/dao/webserver/../prog/day_ahead.py", line 4709, in <module>
main()
~~~~^^
File "/root/dao/webserver/../prog/day_ahead.py", line 4703, in main
da_calc.run_task_function("train_ml_predictions")
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/prog/da_base.py", line 694, in run_task_function
getattr(self, run_task["function"])()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/root/dao/prog/da_base.py", line 644, in train_ml_predictions
solar_predictor.run_train()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/root/dao/prog/solar_predictor.py", line 979, in run_train
weather_data = self.get_weatherdata(start=start)
File "/root/dao/prog/solar_predictor.py", line 895, in get_weatherdata
self.import_knmi_df(start, end)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/root/dao/prog/solar_predictor.py", line 854, in import_knmi_df
self.get_and_save_knmi_data(start, latest_dt, ["FH"])
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/prog/solar_predictor.py", line 824, in get_and_save_knmi_data
self.db_da.savedata(save_df, tablename="values")
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/lib/db_manager.py", line 308, in savedata
connection.execute(insert_value)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1419, in execute
return meth(
self,
distilled_parameters,
execution_options or NO_OPTIONS,
)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/sql/elements.py", line 527, in _execute_on_connection
return connection._execute_clauseelement(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
self, distilled_params, execution_options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1641, in _execute_clauseelement
ret = self._execute_context(
dialect,
...<8 lines>...
cache_hit=cache_hit,
)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1846, in _execute_context
return self._exec_single_context(
~~~~~~~~~~~~~~~~~~~~~~~~~^
dialect, context, statement, parameters
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1986, in _exec_single_context
self._handle_dbapi_exception(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
e, str_statement, effective_parameters, cursor, context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 2363, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/base.py", line 1967, in _exec_single_context
self.dialect.do_execute(
~~~~~~~~~~~~~~~~~~~~~~~^
cursor, str_statement, effective_parameters, context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/sqlalchemy/engine/default.py", line 952, in do_execute
cursor.execute(statement, parameters)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 151, in execute
query = self.mogrify(query, args)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 129, in mogrify
query = query % self._escape_args(args, conn)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/cursors.py", line 104, in _escape_args
return {key: conn.literal(val) for (key, val) in args.items()}
~~~~~~~~~~~~^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/connections.py", line 542, in literal
return self.escape(obj, self.encoders)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/connections.py", line 535, in escape
return converters.escape_item(obj, self.charset, mapping=mapping)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/converters.py", line 25, in escape_item
val = encoder(val, mapping)
File "/root/dao/venv/day_ahead/lib/python3.13/site-packages/pymysql/converters.py", line 56, in escape_float
raise ProgrammingError("%s can not be used with MySQL" % s)
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) nan can not be used with MySQL
[SQL: INSERT INTO `values` (variabel, time, value) VALUES (%(variabel)s, %(time)s, %(value)s)]
[parameters: {'variabel': 23, 'time': 1740513600, 'value': nan}]
(Background on this error at: https://sqlalche.me/e/20/f405) |