solarforecastarbiter.datamodel.CostBand

class solarforecastarbiter.datamodel.CostBand(error_range: Tuple[float, float], cost_function: str, cost_function_parameters: Union[solarforecastarbiter.datamodel.TimeOfDayCost, solarforecastarbiter.datamodel.DatetimeCost, solarforecastarbiter.datamodel.ConstantCost])[source]

Cost specification for one error band

Parameters:
  • error_range (tuple(float, float)) – Bounds of the error to apply the specified cost function to. Inf and -Inf are valid range points, and the error may be positive or negative. Inclusion/exclusion of endpoints is determined by ordering in solarforecastarbiter.datamodel.ErrorBandCost.
  • cost_function (str) – One of ‘timeofday’, ‘datetime’, or ‘constant’. Specifies which cost model should be used to calculate the cost in this band.
  • cost_function_parameters (solarforecastarbiter.datamodel.ConstantCost or solarforecastarbiter.TimeOfDayCost or solarforecastarbiter.DatetimeCost) – Parameters for the selected cost function.
__init__(error_range: Tuple[float, float], cost_function: str, cost_function_parameters: Union[solarforecastarbiter.datamodel.TimeOfDayCost, solarforecastarbiter.datamodel.DatetimeCost, solarforecastarbiter.datamodel.ConstantCost]) → None

Methods

__init__(error_range, float], cost_function, …)
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.