solarforecastarbiter.datamodel.TimeOfDayCost

class solarforecastarbiter.datamodel.TimeOfDayCost(times: Tuple[datetime.time, ...], cost: Tuple[float, ...], aggregation: str, net: bool, fill: str, timezone: str = None)[source]

Cost values based on the time of day.

Parameters:
  • times (tuple of datetime.time) – The times to associate with each cost value
  • cost (tuple of float) – The cost per unit error of the forecasted variable for each time. Must have the same length as times.
  • aggregation (str) – Aggregation method to use after calculating cost for the error series. Currently only ‘sum’ or ‘mean’ are available.
  • net (bool) – If True, compute the ‘net’ aggregate error instead of first calcuating the absolute error before performing the aggregation.
  • fill (str) – Fill method to apply for times between those specified in times. Options are ‘forward’ or ‘backward’.
  • timezone (str, default None) – IANA timezone string to use when constructing datetimes. If None, the timezone of the observations is used, which is the report timezone when calculated in a report.
__init__(times: Tuple[datetime.time, ...], cost: Tuple[float, ...], aggregation: str, net: bool, fill: str, timezone: str = None) → None

Methods

__init__(times, …], cost, …], …)
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

timezone