FlexMeasures / flexmeasures

The intelligent & developer-friendly EMS to support real-time energy flexibility apps, rapidly and scalable.
https://flexmeasures.io
Apache License 2.0
133 stars 34 forks source link

Migrate from market_id to consumption_price_sensor #1079

Open nrozanov opened 1 month ago

nrozanov commented 1 month ago

In https://github.com/FlexMeasures/flexmeasures/pull/1059 we are adding consumption_price_sensor attribute to an asset level. But we also have logic that looks for a price sensor with id = market_id attribute on sensor level. We should migrate from market_id logic to consumption_price_sensor. Full logic on how migration should be done has not been formulated yet, but here is a main concern: It is unclear what market_id to use for an asset that has several sensors with market_id set (unsure if it actually happens)

Flix6x commented 1 month ago

Maybe raise an exception during the db upgrade if this happens, and ask to post a GH Issue. I doubt that this situation applies to any FM host in practice.

To clarify, this would only be a problem if those sensors have different market IDs set, right?