Skip to content

added forecast saving option for config, adjusted forecast tests#801

Open
reinecfi wants to merge 3 commits into
mainfrom
save_forecast
Open

added forecast saving option for config, adjusted forecast tests#801
reinecfi wants to merge 3 commits into
mainfrom
save_forecast

Conversation

@reinecfi
Copy link
Copy Markdown
Contributor

@reinecfi reinecfi commented Apr 24, 2026

Related Issue

Closes #797
Closes #800 (other parts fixed by PR #792)

Description

This change adds the possibility to save forecasts and improves forecaster tests.

Checklist

  • Documentation updated (docstrings, READMEs, user guides, inline comments, doc folder updates etc.)
  • New unit/integration tests added (if applicable)
  • Changes noted in release notes (if any)
  • Consent to release this PR's code under the GNU Affero General Public License v3.0

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 73.46939% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.49%. Comparing base (1224215) to head (f6c815a).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
assume/scenario/loader_csv.py 68.42% 12 Missing ⚠️
assume/common/forecast_algorithms.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #801      +/-   ##
==========================================
- Coverage   80.79%   80.49%   -0.31%     
==========================================
  Files          56       56              
  Lines        8670     9047     +377     
==========================================
+ Hits         7005     7282     +277     
- Misses       1665     1765     +100     
Flag Coverage Δ
pytest 80.49% <73.46%> (-0.31%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@reinecfi reinecfi requested a review from a team April 30, 2026 13:19
Comment thread assume/common/forecast_algorithms.py Outdated
Comment on lines +386 to +387
NOTE: Elastic demands are not supported currently
"""
Copy link
Copy Markdown
Collaborator

@mthede mthede May 7, 2026

Choose a reason for hiding this comment

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

What do you mean with "are not supported currently"?
Are those demands not included at all or are those demands approximated as inelastic demands? When using it I'd want to know wheter the naive residual load forecast is rather under- or overestimated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Adjusted the wording here. The forecast will underestimate the residual load if elastic demand is present.

Comment thread assume/common/forecast_algorithms.py Outdated
across all connected lines as the node's congestion signal.

Returns an empty dict if grid data (buses/lines) is unavailable.
NOTE: Elastic demands are not supported currently
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here, see above

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

More or less like above, but since some demand is ignored, the forecast should be smaller (which can lead to a smaller or bigger congestion in absolute terms, depending whether the net load is positive or negative).
Not sure if adding a comment on this will be more confusing than helpful. Especially as this is a naive forecast.

Comment thread assume/common/forecast_algorithms.py Outdated
)
return {}

# TODO: Add support for elastic demand (currently error of only elastic demands)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is an error thrown? How would I figure out what's wrong and how to fix it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just forgot to remove the TODO here. The if clause circumvents the problem. Currently you are not notified. Maybe one could/should add a warning here?

Comment thread docs/source/unit_forecasts.rst
Copy link
Copy Markdown
Collaborator

@mthede mthede left a comment

Choose a reason for hiding this comment

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

Hi Finn, thanks for the nice feature of saving the forecasts! That's a great way to check whether the intended values were provided to the units.

I was at first confused by the naming and defaults of the config parameters. Then I realized that we don't really have full documentation of the top-level config options, other than in Notebook 02.

Maybe it's worth documenting the behavior at one place and link to the specific forecaster details in the docs?

Other than those clarifications and documentations, it looks good :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Price forecast with elastic demand has issue Include option to save forecast and reuse it

2 participants