Skip to content

Conversation

@Reem-Albadwy
Copy link
Contributor

…l + national)

Pull Request

Description

This PR introduces a new function fetch_be_forecast to retrieve Belgium solar forecast data from Elia open data. The function collects both regional and national forecasts, standardizes column names, and ensures the datetime column is properly converted to UTC.

Related issue: Fixes #127

How Has This Been Tested?

  • Function tested locally by fetching the CSV from Elia.
  • Verified columns: target_datetime_utc, Region, solar_generation_kw.
  • Converted the Datetime column to datetime format in UTC successfully.
  • Verified that both regional and national forecasts are included in the resulting DataFrame.

Checklist

  • My code follows Open Climate Fix coding style guidelines
  • Self-review performed for correctness and readability
  • Function tested locally and verified for correctness
  • Documentation updated (not required for this PR)
  • Additional tests added (not required for this PR)
  • Spelling and grammar checked

return pd.DataFrame()


def fetch_be_forecast() -> pd.DataFrame:
Copy link
Contributor

@peterdudfield peterdudfield Dec 17, 2025

Choose a reason for hiding this comment

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

could you move this into a seperate file please, in the data dir

return df_forecast



Copy link
Contributor

Choose a reason for hiding this comment

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

Would you be able to write a test for this? perhaps an integration test?

@peterdudfield
Copy link
Contributor

Also thank you so much for doing all this.

Does this code pull the regional data too?

@Reem-Albadwy
Copy link
Contributor Author

Also thank you so much for doing all this.

Does this code pull the regional data too?

Hi @peterdudfield, thank you very much for the review — and sorry for the delayed response.

I’ve addressed your feedback in a new pull request (#134):

  • Moved the Belgium logic into a dedicated module under solar_consumer/data/fetch_be_data.py, in line with the existing project structure.
  • Updated the implementation to use the Elia records API with a rolling time-window and retry logic, instead of the CSV export, to make the ingestion more robust.
  • Added an integration test to ensure that the fetcher returns both national ("Belgium") and regional forecasts.

Please let me know if you’d like anything adjusted or simplified further for the new PR — happy to iterate on this based on your feedback.

@peterdudfield
Copy link
Contributor

Thanks @Reem-Albadwy , shall we close this one?

@Reem-Albadwy
Copy link
Contributor Author

Thanks @Reem-Albadwy , shall we close this one?

yes, it is better to close it

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.

Get Belguim data

2 participants