reVX.plexos.base.BaseProfileAggregation

class BaseProfileAggregation[source]

Bases: ABC

Base framework to aggregate rev generation profiles to plants or plexos nodes.

Placeholder for concrete initialization

Methods

convert_bespoke_sc(df, gid_column)

Convert a bespoke supply curve table to reference resource gids (res_gids) based on the bespoke generation outputs that are on the supply curve grid not the resource grid

export(meta, time_index, profiles, out_fpath)

Export generation profiles to h5 and plexos-formatted csv

get_unique_plant_names(table, name_col[, ...])

Get a list of ordered unique plant names

tz_convert_profiles(profiles, timezone)

Convert profiles to local time and forward/back fill missing data.

Attributes

available_res_gids

Resource gids available in the cf file.

forecast_map

An array mapping the reV "actuals" generation data to forecast data of a different resolution (if input).

node_map

Nearest neighbor output mapping rev supply curve points to plants or plexos nodes.

time_index

Get the generation profile time index.

tz_alias

Get a short 3-char tz alias if the timezone is common in the US (pst, mst, cst, est)

property time_index

Get the generation profile time index.

Returns:

time_index (pd.Datetimeindex) – Pandas datetime index sourced from the capacity factor data.

property tz_alias

Get a short 3-char tz alias if the timezone is common in the US (pst, mst, cst, est)

Returns:

str

property available_res_gids

Resource gids available in the cf file.

Returns:

res_gids (np.ndarray) – Array of resource GIDs available in the cf file.

property node_map

Nearest neighbor output mapping rev supply curve points to plants or plexos nodes.

Returns:

np.ndarray

property forecast_map

An array mapping the reV “actuals” generation data to forecast data of a different resolution (if input). This is an (n, 1) array where n is the number of “actuals” generation data points. So self.forecast_map[9] yields the forecast index that corresponds to index 9 in the cf_fpath reV generation output.

Returns:

np.ndarray | None

static tz_convert_profiles(profiles, timezone)[source]

Convert profiles to local time and forward/back fill missing data.

Parameters:
  • profiles (np.ndarray) – Profiles of shape (time, n_plants) in UTC

  • timezone (str) – Timezone for output generation profiles. This is a string that will be passed to pytz.timezone() e.g. US/Pacific, US/Mountain, US/Central, US/Eastern, or UTC. For a list of all available timezones, see pytz.all_timezones

Returns:

profiles (np.ndarray) – Profiles of shape (time, n_plants) in timezone

static get_unique_plant_names(table, name_col, tech_tag=None)[source]

Get a list of ordered unique plant names

Parameters:
  • table (pd.DataFrame) – Plexos / plant meta data table where every row is a plant

  • name_col (str) – Column label in table. Exception will be raised if not found.

  • tech_tag (str) – Technology tag to append to plant names like “pv” or “wind”

Returns:

names (list | None) – List of unique plant names

static convert_bespoke_sc(df, gid_column)[source]

Convert a bespoke supply curve table to reference resource gids (res_gids) based on the bespoke generation outputs that are on the supply curve grid not the resource grid

Parameters:
  • table (pd.DataFrame) – rev_sc and reeds_build inner joined on supply curve gid.

  • gid_column (str) – String to use for sc_gid.

Returns:

table (pd.DataFrame) – Modified so that the “res_gids” points to the supply curve gids in the bespoke file so that the resource generation profiles will be taken based on the bespoke indexing.

export(meta, time_index, profiles, out_fpath)[source]

Export generation profiles to h5 and plexos-formatted csv

Parameters:
  • plant_meta (pd.DataFrame) – Plant / plexos node meta data with built capacities and mappings to the resource used.

  • time_index (pd.datetimeindex) – Time index for the profiles.

  • profiles (np.ndarray) – Generation profile timeseries in MW at each plant / plexos node.

  • out_fpath (str, optional) – Path to .h5 file into which plant buildout should be saved. A plexos-formatted csv will also be written in the same directory. By default None.