solarforecastarbiter.datamodel.MetricResult¶
-
class
solarforecastarbiter.datamodel.
MetricResult
(name: str, forecast_id: str, values: Tuple[solarforecastarbiter.datamodel.MetricValue, ...], observation_id: Optional[str] = None, aggregate_id: Optional[str] = None, is_summary: bool = False)[source]¶ Class for storing the results of many metric calculations for a single observation and forecast pair.
Parameters: - name (str) – A descriptive name for the MetricResult.
- forecast_id (str) – UUID of the forecast being analyzed.
- values (tuple of :py:class: solarforecastarbiter.datamodel.MetricValue) –
- observation_id (str or None) – UUID of the observation being analyzed.
- aggregate_id (str or None) – UUID of the aggregate being analyzed.
- is_summary (bool) – If this metric result represents summary statistics of the observation and forecasts timeseries.
Notes
Only one of aggregate_id or observation_id may be set.
Raises: ValueError
– When both aggregate_id and observation_id are not None, or when both are None.-
__init__
(name: str, forecast_id: str, values: Tuple[solarforecastarbiter.datamodel.MetricValue, ...], observation_id: Optional[str] = None, aggregate_id: Optional[str] = None, is_summary: bool = False) → None¶
Methods
__init__
(name, forecast_id, values, …], …)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
aggregate_id
is_summary
observation_id