reVX.plexos.rev_reeds_plexos.RevReedsPlexosManager
- class RevReedsPlexosManager(plexos_nodes, rev_sc, reeds_build, cf_fpath, forecast_fpath=None, wait=300, db_host='gds_edit.nrel.gov', db_user=None, db_pass=None, db_port=5432)[source]
Bases:
object
rev-reeds-plexos job manager.
- Parameters:
plexos_nodes (str | pd.DataFrame) – Plexos node meta data (CSV/SHP file path or database.schema.name)
rev_sc (str | pd.DataFrame) – reV supply curve results (CSV file path or database.schema.name)
reeds_build (str | pd.DataFrame) – REEDS buildout results (CSV file path or database.schema.name) ReEDS buildout with rows for built capacity (MW) at each reV SC point. This should have columns: reeds_year, built_capacity, and sc_gid (corresponding to the reV supply curve point gid). Some cleaning of the column names will be performed for legacy tables but these are the column headers that are desired. This input can also include “plexos_node_gid” which will explicitly assign a supply curve point buildout to a single plexos node. If included, all points must be assigned to plexos nodes.
cf_fpath (str) – File path to capacity factor file (reV gen output) to get profiles from.
forecast_fpath (str | None) – Forecasted capacity factor .h5 file path (reV results). If not None, the supply curve res_gids are mapped to sites in the cf_fpath, then the coordinates from cf_fpath are mapped to the nearest neighbor sites in the forecast_fpath, where the final generation profiles are retrieved from.
wait (int) – Integer seconds to wait for DB connection to become available before raising exception.
db_host (str) – Database host name.
db_user (str) – Your database user name.
db_pass (str) – Database password (None if your password is cached).
db_port (int) – Database port.
Methods
main
(plexos_nodes, rev_sc, reeds_build, cf_fpath)Run the Plexos pipeline for a single extent.
run
(job, out_dir[, scenario, cf_year, ...])Run plexos node aggregation for a job file input.
- classmethod main(plexos_nodes, rev_sc, reeds_build, cf_fpath, forecast_fpath=None, agg_kwargs=None, wait=300, db_host='gds_edit.nrel.gov', db_user=None, db_pass=None, db_port=5432)[source]
Run the Plexos pipeline for a single extent.
- Parameters:
plexos_nodes (str | pd.DataFrame) – Plexos node meta data (CSV/SHP file path or database.schema.name)
rev_sc (str | pd.DataFrame) – reV supply curve results (CSV file path or database.schema.name)
reeds_build (str | pd.DataFrame) – REEDS buildout results (CSV file path or database.schema.name) ReEDS buildout with rows for built capacity (MW) at each reV SC point. This should have columns: reeds_year, built_capacity, and sc_gid (corresponding to the reV supply curve point gid). Some cleaning of the column names will be performed for legacy tables but these are the column headers that are desired. This input can also include “plexos_node_gid” which will explicitly assign a supply curve point buildout to a single plexos node. If included, all points must be assigned to plexos nodes.
cf_fpath (str) – File path to capacity factor file (reV gen output) to get profiles from.
forecast_fpath (str | None) – Forecasted capacity factor .h5 file path (reV results). If not None, the supply curve res_gids are mapped to sites in the cf_fpath, then the coordinates from cf_fpath are mapped to the nearest neighbor sites in the forecast_fpath, where the final generation profiles are retrieved from.
agg_kwargs (dict) – Optional additional kwargs for the aggregation run.
wait (int) – Integer seconds to wait for DB connection to become available before raising exception.
db_host (str) – Database host name.
db_user (str) – Your database user name.
db_pass (str) – Database password (None if your password is cached).
db_port (int) – Database port.
- Returns:
meta (pd.DataFrame) – Plexos node meta data.
time_index (pd.Datetimeindex) – Time index.
profiles (np.ndarray) – Plexos node generation profiles.
- classmethod run(job, out_dir, scenario=None, cf_year=2012, build_years=(2024, 2050), plexos_columns=None, force_full_build=False, force_shape_map=False)[source]
Run plexos node aggregation for a job file input.
- Parameters:
job (str | pd.DataFrame) – CSV file with plexos aggregation job config. Needs the following columns: (scenario, group, cf_fpath, reeds_build, rev_sc, plexos_nodes)
out_dir (str) – Path to an output directory.
scenario (str | None) – Optional filter to run plexos aggregation for just one scenario in the job.
cf_year (str) – Year of the cf_fpath resource year (will be inserted if {} is in cf_fpath).
build_years (list | tuple | int) – REEDS years to run scenarios for.
plexos_columns (list | None) – Additional columns from the plexos_nodes input to pass through to the output meta data.
force_full_build (bool) – Flag to ensure the full requested buildout is built at each SC point. If True, the remainder of the requested build will always be built at the last resource gid in the sc point.
force_shape_map (bool) – Flag to force the mapping of supply curve points to the plexos node shape file input (if a shape file is input) via nearest neighbor to shape centroid.