Commit aa1deef
committed
fix: handle DST transitions in I90 datetime parsing
Two changes to I90Sheet._preprocess and _normalize_datetime_columns:
1. DST column format: I90 files on DST days use range headers like
"00-01", "01-02", "02-03a", "02-03b" instead of sequential integers.
Added detection for this format (first column starts with "0") and
assign sequential 1-based indices, letting the period count (23/25
for hourly, 92/100 for QH) encode the DST information.
2. UTC-first datetime construction: replaced tz_localize('Europe/Madrid',
ambiguous='infer') with anchoring midnight in Europe/Madrid, converting
to UTC, then adding period offsets. This eliminates DST ambiguity
entirely — each period maps to a unique UTC instant regardless of
fall-back (repeated hour) or spring-forward (missing hour).
Tested with fall-back (2022-10-30: 25h/100QH), spring-forward
(2022-03-27: 23h), and normal days (24h).1 parent b85d4fd commit aa1deef
1 file changed
Lines changed: 32 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
174 | 178 | | |
175 | 179 | | |
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
180 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
181 | 196 | | |
182 | 197 | | |
183 | 198 | | |
| |||
251 | 266 | | |
252 | 267 | | |
253 | 268 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
260 | 281 | | |
261 | 282 | | |
262 | 283 | | |
| |||
0 commit comments