Feat/register account for data source#13
Conversation
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the weather plugin’s modeling utilities to ensure a dedicated account exists for the weather provider data source, splits the “raw provider” source from “derived FlexMeasures” source types, and adds tests to validate the new behavior.
Changes:
- Add
get_or_create_weather_accountand (when supported) link created Sources to this Account. - Create the raw provider Source as type
market, while keeping derived data under aforecaster(or legacy equivalent) Source. - Add tests for account registration and source creation/linking behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
flexmeasures_weather/utils/modeling.py |
Adds dedicated account creation and conditionally associates it to Sources; changes raw source type to market. |
flexmeasures_weather/utils/tests/test_modeling.py |
Adds tests covering account creation and source/account linkage (with compatibility branching). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
|
I tested this manually end to end against a local FlexMeasures checkout on Manual test steps:
What I verified:
This confirms the new account-linked source behavior works as intended for both the raw provider source and the derived FlexMeasures source. |
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
|
@Flix6x I applied the same explicit FlexMeasures 0.32.0 version check as in flexmeasures-entsoe pr, and updated the tests to follow the version branches with |
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Summary
forecasteron newer FlexMeasures,forecasting scripton older versions)FlexMeasures >= 0.32Manual Testing
flexmeasuresbranchfeat/sensor-data-source-filteringflexmeasuresandflexmeasures-weatherin the same virtualenvflexmeasures db upgradeagainst the target databasecubeandearthdistanceflexmeasures weather register-weather-sensor --name "temperature" --latitude 30 --longitude 40flexmeasures weather register-weather-sensor --name "wind speed" --latitude 30 --longitude 40flexmeasures weather register-weather-sensor --name "irradiance" --latitude 30 --longitude 40flexmeasures weather get-weather-forecasts --location 30,40OpenWeatherMapexistsOpenWeatherMapexists with typeforecasterand is linked to theOpenWeatherMapaccountFlexMeasures OpenWeatherMapexists with typeforecasterand is linked to the same accountcloses #12