solarforecastarbiter.datamodel.Report

class solarforecastarbiter.datamodel.Report(report_parameters: solarforecastarbiter.datamodel.ReportParameters, raw_report: Union[None, solarforecastarbiter.datamodel.RawReport] = None, status: str = 'pending', report_id: str = '', provider: str = '', outages: Tuple[solarforecastarbiter.datamodel.TimePeriod, ...] = (), __version__: int = 0)[source]

Class for keeping track of report metadata and the raw report that can later be rendered to HTML or PDF. Functions in main take a Report object with raw_report set to None, generate the report, and return another Report object with raw_report set to a RawReport object that can be rendered.

Parameters:
  • report_parameters (ReportParameters) – Metadata required to specify and generate the report.
  • raw_report (RawReport or None) – Once computed, the raw report should be stored here
  • status (str) – Status of the report
  • report_id (str) – ID of the report in the API
  • provider (str, optional) – Provider of the Report information.
  • outages (Tuple[TimePeriod, ..], optional) – List of report outage periods.
  • __version__ (str) – Should be used to version reports to ensure even older reports can be properly rendered
__init__(report_parameters: solarforecastarbiter.datamodel.ReportParameters, raw_report: Union[None, solarforecastarbiter.datamodel.RawReport] = None, status: str = 'pending', report_id: str = '', provider: str = '', outages: Tuple[solarforecastarbiter.datamodel.TimePeriod, ...] = (), __version__: int = 0) → None

Methods

__init__(report_parameters, raw_report, …)
from_dict(input_dict[, raise_on_extra]) Construct a dataclass from the given dict, matching keys with the class fields.
replace(**kwargs) Convience wrapper for dataclasses.replace() to create a new dataclasses from the old with the given keys replaced.
to_dict() Convert the dataclass into a dictionary suitable for uploading to the API.

Attributes

outages
provider
raw_report
report_id
status