flexmeasures icon indicating copy to clipboard operation
flexmeasures copied to clipboard

Default data source setting for computed data

Open nhoening opened this issue 2 years ago • 3 comments

The default data source, for data made by scripts, is now "Seita".

This is not what users want, of course. It should be "FlexMeasures" per default, and ideally a config setting, which can easily be set to the name of the Energy Service Company (ESCo) running FlexMeasures.

Issue #506 is of interest here, too. But their implementation should not interfere, I expect.

As for migrating existing data, I'm not sure we have a good solution. Usually, I'd expect existing users also to use their own company name as source. And for our own data, we'd like to keep "Seita", actually. I'd mention in the release notes that people might want to run an update statement, should they want to rename. Probably on the data source itself.

nhoening avatar Sep 21 '22 20:09 nhoening

Places with hard-coded "Seita" data source for scheduling:

  • flexmeasures/api/v1_3/implementations.py l. 147f
  • flexmeasures/api/v1_3/tests/test_api_v1_3.py l. 93
  • flexmeasures/api/v3_0/sensors.py l. 521
  • flexmeasures/api/v3_0/tests/test_sensor_schedules.py l. 71
  • flexmeasures/data/services/scheduling.py l. 148
  • flexmeasures/data/tests/test_scheduling_jobs.py l. 44
  • flexmeasures/data/tests/test_scheduling_jobs_fresh_db.py l. 41 & 61

That's probably all for that use case. Best way to start is to change what make_schedule (in services/scheduling.py) uses, then clean up what falls apart elsewhere.

The data source for forecasting scripts is also something with "Seita". For these, I suggest grepping the source code.

nhoening avatar Sep 21 '22 20:09 nhoening

We have since introduced the concept of authorship for algorithms (first in the Scheduler class, see the __author__ property), from which the data source is derived. The data source is derived in get_data_source_info(), and this could be a good place to implement a lookup of a dedicated config setting. But.. it also begs the question of whether we still see a need to explicitly support using something other than the algorithm author when assigning an author to the data that said algorithm generates. After all, an arguably cleaner way an ESCo could accomplish this is by registering their own (copied) scheduling algorithm with themselves set as author. Could be something to ask a wider audience in the next TSC?

Flix6x avatar Apr 09 '23 18:04 Flix6x

We decided the default data source name will come from a dedicated config setting, defaulting to "FlexMeasures".

Flix6x avatar Apr 24 '23 20:04 Flix6x