Skip to content

EPEX Predictor: mark predicted prices as estimate - #36358

Merged
andig merged 1 commit into
feat/forecast-estimatefrom
tariff-epex-predictor-estimate
Nov 17, 2026
Merged

andig merged 1 commit into
feat/forecast-estimatefrom
tariff-epex-predictor-estimate

Conversation

@andig

@andig andig commented Nov 17, 2026

Copy link
Copy Markdown
Member

Follow-up for #36138. The API returns a top-level knownUntil with the start of the last published EPEX slot; every slot after it is a prediction. The template maps startsAt > knownUntil to estimate: true. One-line change, no API changes needed.

Checked live for DE: the last known slot starts 22:45Z, the first estimate starts 23:00Z.

🤖 Generated with Claude Code

@andig andig added the tariffs Specific tariff support label Nov 17, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Nov 17, 2026
@andig
andig merged commit 6ea85c0 into feat/forecast-estimate Nov 17, 2026
18 checks passed
@andig
andig deleted the tariff-epex-predictor-estimate branch November 17, 2026 08:39

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="templates/definition/tariff/epex-predictor.yaml" line_range="41" />
<code_context>
         "end": (.startsAt | strptime("%Y-%m-%dT%H:%M:%SZ") | mktime + 900 | strftime("%Y-%m-%dT%H:%M:%SZ")),
-        "value": .total
+        "value": .total,
+        "estimate": (.startsAt > $known)
       }] | tostring
</code_context>
<issue_to_address>
**Final prices shown as estimates**

When a self-hosted or older API response omits `knownUntil`, `$known` is null and jq's type ordering makes every string `.startsAt > null` true, so every slot is marked as an estimate and finalized prices are shown as predictions.

Guard the comparison so slots are marked as estimates only when `knownUntil` is present.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

"end": (.startsAt | strptime("%Y-%m-%dT%H:%M:%SZ") | mktime + 900 | strftime("%Y-%m-%dT%H:%M:%SZ")),
"value": .total
"value": .total,
"estimate": (.startsAt > $known)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Final prices shown as estimates

When a self-hosted or older API response omits knownUntil, $known is null and jq's type ordering makes every string .startsAt > null true, so every slot is marked as an estimate and finalized prices are shown as predictions.

Guard the comparison so slots are marked as estimates only when knownUntil is present.

Prompt for AI agents
In `templates/definition/tariff/epex-predictor.yaml` at line 41:

**Final prices shown as estimates**

When a self-hosted or older API response omits `knownUntil`, `$known` is null and jq's type ordering makes every string `.startsAt > null` true, so every slot is marked as an estimate and finalized prices are shown as predictions.

Guard the comparison so slots are marked as estimates only when `knownUntil` is present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tariffs Specific tariff support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant