flexmeasures.data.services.reporting
Logic for queueing and running reporting jobs.
Functions
- flexmeasures.data.services.reporting.create_reporting_job(reporter: Reporter, queue: str = 'reporting') Job
Queue a job that computes a report and saves the results to the database.
The reporter’s (loaded) parameters are re-serialized into the job, and the reporter itself travels as its data source ID (which stores its config), so the job is fully deserializable by the worker.
- flexmeasures.data.services.reporting.run_report_job(data_source_id: int, parameters: dict, automation_id: int | None = None) list[dict]
Compute a report (with the data generator stored on the given data source) and save the results to the database.
This function is meant to be run by a worker processing the reporting queue. If the report was triggered by an automation, the end of the report window is recorded upon success, so the automation’s next default window starts there.