reVX.plexos.plexos_plants.PlexosPlants

class PlexosPlants(plexos_table, sc_table, mymean_fpath, dist_percentile=90, dist_thresh_km=None, lcoe_col='total_lcoe', lcoe_thresh=1.3, offshore=False, max_workers=None, plants_per_worker=40, points_per_worker=400)[source]

Bases: Plants

Class to identify and fill Plants

Parameters:
  • plexos_table (pandas.DataFrame) – Parsed and clean PLEXOS table

  • sc_table (str | pandas.DataFrame) – Supply Curve table .csv or pre-loaded pandas DataFrame

  • mymean_fpath (str) – Path to reV multi-year-mean .h5 file (preferred) or annual reV generation output .h5 file. If annual, the plant buildouts might change from year to year (bad!).

  • offshore (bool, optional) – Include offshore points, by default False

  • dist_percentile (int, optional) – Percentile to use to compute distance threshold using sc_gid to SubStation distance , by default 90

  • dist_thresh_km (float | None) – Optional absolute distance threshold in km that will override the dist_percentile input.

  • lcoe_col (str, optional) – LCOE column to sort by, by default ‘total_lcoe’

  • lcoe_thresh (float, optional) – LCOE threshold multiplier, exclude sc_gids above threshold, by default 1.3

  • offshore (bool, optional) – Include offshore points, by default False

  • max_workers (int, optional) – Number of workers to use for plant identification, 1 == serial, > 1 == parallel, None == parallel using all available cpus, by default None

  • plants_per_worker (int, optional) – Number of plants to identify on each worker, by default 40

  • points_per_worker (int, optional) – Number of points to create on each worker, by default 400

Methods

dump([out_fpath])

Create plants meta data from filled plants DataFrames:

load(plants_fpath)

Load pre-filled plants from disc

save(plexos_table, sc_table, mymean_fpath, ...)

Identify, fill, and then save plants to disc

Attributes

plant_builds

List of plant builds

plant_capacity

Plant capacities in MW

plant_ids

Plant ids

plant_table

Plants meta data table

plants

Dictionary matching plants to plant ids

sc_points

Supply Curve Points

property plant_table

Plants meta data table

Returns:

pandas.DataFrame

property plant_capacity

Plant capacities in MW

Returns:

ndarray

property sc_points

Supply Curve Points

Returns:

SupplyCurvePoints

dump(out_fpath=None)[source]
Create plants meta data from filled plants DataFrames:
  • Location (lat, lon)

  • final capacity (MW)

  • sc_gids

  • res_gids

  • res gid_counts

Parameters:

out_fpath (str, optional) – .csv path to save plant meta data too, by default None

Returns:

plants_meta (pandas.DataFrame) – Location (lat, lon), final capacity (MW), and associated sc_gids, res_gids, and res gid_counts for all plants

classmethod save(plexos_table, sc_table, mymean_fpath, out_fpath, dist_percentile=90, lcoe_col='total_lcoe', lcoe_thresh=1.3, offshore=False, max_workers=None, plants_per_worker=40, points_per_worker=400)[source]

Identify, fill, and then save plants to disc

Parameters:
  • plexos_table (pandas.DataFrame) – Parsed and clean PLEXOS table

  • sc_table (str | pandas.DataFrame) – Supply Curve table .csv or pre-loaded pandas DataFrame

  • mymean_fpath (str) – Path to reV multi-year-mean .h5 file (preferred) or annual reV generation output .h5 file. If annual, the plant buildouts might change from year to year (bad!).

  • out_fpath (str) – .csv path to save plant meta data too

  • offshore (bool, optional) – Include offshore points, by default False

  • dist_percentile (int, optional) – Percentile to use to compute distance threshold using sc_gid to SubStation distance , by default 90

  • lcoe_col (str, optional) – LCOE column to sort by, by default ‘total_lcoe’

  • lcoe_thresh (float, optional) – LCOE threshold multiplier, exclude sc_gids above threshold, by default 1.3

  • offshore (bool, optional) – Include offshore points, by default False

  • max_workers (int, optional) – Number of workers to use for plant identification, 1 == serial, > 1 == parallel, None == parallel using all available cpus, by default None

  • plants_per_worker (int, optional) – Number of plants to identify on each worker, by default 40

  • points_per_worker (int, optional) – Number of points to create on each worker, by default 400

classmethod load(plants_fpath)

Load pre-filled plants from disc

Parameters:

plants_fpath (str | DataFrame) – DataFrame or path to .csv containing pre-filled plants

Returns:

Plants – Initialized Plants instance with pre-filled plants

property plant_builds

List of plant builds

Returns:

dict

property plant_ids

Plant ids

Returns:

list

property plants

Dictionary matching plants to plant ids

Returns:

dict