Conversation
7a037ff to
e951e8a
Compare
There was a problem hiding this comment.
Pull request overview
Updates the SpotHinta electricity pricing model to better handle partial-day datasets by suppressing derived statistics (average/high/low) when a full day of intervals isn’t available, aligning results with the API’s actual completeness.
Changes:
- Pass
resolutionfrom the client intoElectricity.from_dict()and store it on the model. - Treat “today”/“tomorrow” prices as empty unless the expected number of intervals for the day is present.
- Add tests + a new fixture covering partial-data scenarios for 15-minute resolution.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
spothinta_api/spothinta.py |
Passes resolution through to model construction so completeness logic can key off resolution. |
spothinta_api/models.py |
Adds resolution to Electricity and gates “today/tomorrow” price sets on interval completeness. |
tests/test_models.py |
Adds tests for partial tomorrow/today behavior at 15-minute resolution. |
tests/fixtures/energy-15-minut-partial-tomorrow.json |
Introduces a fixture with full “today” data and partial “tomorrow” data. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cfdba80 to
71aa692
Compare
If today or tomorrow has only partial price data, don't return any averages or highest/lowest price, because it's not possible to return something that makes sense if we don't have prices for the whole day.
71aa692 to
4e0bc07
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
db6f46f to
08157f1
Compare
08157f1 to
a4b2448
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
If today or tomorrow has only partial price data, don't return any averages or highest/lowest price, because it's not possible to return something that makes sense if we don't have prices for the whole day.