Commit 3d0c0fe
committed
fix(#303): address PR review comments
- Normalize trailing 'Z' in ISO timestamps before fromisoformat() for
Python 3.9/3.10 compatibility
- Use floor division (// 3600) for hour_offset so negative deltas
between -1h and 0h stay negative and get skipped correctly
- Scan all forecast list entries for expected keys instead of only
checking the first element (avoids skipping valid data if first
entry is malformed)
- Cache _base_hour_start in _hour_str() helper to prevent flaky tests
near hour boundaries
- Fix misleading docstring in test_auto_detect_none_unit_defaults_to_wh1 parent 2f7bb9e commit 3d0c0fe
2 files changed
Lines changed: 25 additions & 11 deletions
File tree
- src/batcontrol/forecastsolar
- tests
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
476 | | - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
477 | 480 | | |
478 | 481 | | |
479 | 482 | | |
| |||
492 | 495 | | |
493 | 496 | | |
494 | 497 | | |
495 | | - | |
496 | | - | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
497 | 503 | | |
498 | 504 | | |
499 | 505 | | |
500 | 506 | | |
501 | 507 | | |
502 | 508 | | |
503 | 509 | | |
504 | | - | |
| 510 | + | |
| 511 | + | |
505 | 512 | | |
506 | 513 | | |
507 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
579 | 585 | | |
580 | 586 | | |
581 | 587 | | |
| |||
733 | 739 | | |
734 | 740 | | |
735 | 741 | | |
736 | | - | |
737 | | - | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
738 | 745 | | |
739 | 746 | | |
740 | 747 | | |
| |||
0 commit comments