ErrorBandCost(bands: Tuple[solarforecastarbiter.datamodel.CostBand, ...])¶
Cost that varies based on the error value. For each error band, one of the other cost functions is applied to the errors within the band. If an error value does not fall within any band ranges, no cost is calculated for that error.
Parameters: bands (tuple of
solarforecastarbiter.datamodel.CostBand) – Specification of the error bands and associated cost functions.
Each error is restricted to a single band/cost function, so the order in bands determines which band is applied in ascending priority. For example, if
bands.error_range = (0, 2)and
bands.error_range == (1, 3), the cost function of bands is applied for all errors from [0, 2] and bands is applied for errors from (2, 3].
__init__(bands: Tuple[solarforecastarbiter.datamodel.CostBand, ...]) → None¶
Construct a dataclass from the given dict, matching keys with the class fields.
Convience wrapper for
dataclasses.replace()to create a new dataclasses from the old with the given keys replaced.
Convert the dataclass into a dictionary suitable for uploading to the API.