solarforecastarbiter.datamodel.Aggregate

class solarforecastarbiter.datamodel.Aggregate(name: str, description: str, variable: str, aggregate_type: str, interval_length: pandas._libs.tslibs.timedeltas.Timedelta, interval_label: str, timezone: str, observations: Tuple[solarforecastarbiter.datamodel.AggregateObservation, ...], aggregate_id: str = '', provider: str = '', extra_parameters: str = '', interval_value_type: str = 'interval_mean')[source]

Class for keeping track of Aggregate metadata. Aggregates always have interval_value_type of ‘interval_mean’.

Parameters:
  • name (str) – Name of the Aggregate, e.g. Utility X Solar PV
  • description (str) – A description of what the aggregate is.
  • variable (str) – Variable name, e.g. power, GHI. Each allowed variable has an associated pre-defined unit. All observations that make up the Aggregate must also have this variable.
  • aggregate_type (str) – The aggregation function that will be applied to observations. Generally, this will be ‘sum’ although one might be interested, for example, in the ‘mean’ irradiance of some observations. May be an aggregate function string supported by Pandas. Common options include (‘sum’, ‘mean’, ‘min’, ‘max’, ‘median’, ‘std’).
  • interval_length (pandas.Timedelta) – The length of time between consecutive data points, e.g. 5 minutes, 1 hour. This must be >= the interval lengths of any Observations that will make up the Aggregate.
  • interval_label (str) – Indicates if a time labels the beginning or the ending of an interval average.
  • timezone (str) – IANA timezone of the Aggregate, e.g. Etc/GMT+8
  • aggregate_id (str, optional) – UUID of the Aggregate in the API
  • provider (str, optional) – Provider of the Aggregate information.
  • extra_parameters (str, optional) – Any extra parameters for the Aggregate.
  • observations (tuple of AggregateObservation) – The Observations that contribute to the Aggregate
__init__(name: str, description: str, variable: str, aggregate_type: str, interval_length: pandas._libs.tslibs.timedeltas.Timedelta, interval_label: str, timezone: str, observations: Tuple[solarforecastarbiter.datamodel.AggregateObservation, ...], aggregate_id: str = '', provider: str = '', extra_parameters: str = '', interval_value_type: str = 'interval_mean') → None

Methods

__init__(name, description, variable, …)
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
extra_parameters
interval_value_type
provider