solarforecastarbiter.datamodel.MetricValue

class solarforecastarbiter.datamodel.MetricValue(category: str, metric: str, index: str, value: float)[source]

Class for storing the result of a single metric calculation.

Parameters:
  • category (str) – The category of the metric value, e.g. total, monthly, hourly.
  • metric (str) – The metric that was calculated.
  • index (str) – The index of the metric value, e.g. ‘1-12’ for monthly metrics or 0-23 for hourly.
  • value (float) – The value calculated for the metric.
__init__(category: str, metric: str, index: str, value: float) → None

Methods

__init__(category, metric, index, value)
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.