reV.supply_curve.supply_curve.SupplyCurve
- class SupplyCurve(sc_points, trans_table, sc_features=None, sc_capacity_col='capacity_ac_mw', poi_info=None)[source]
Bases:
object
ReV LCOT calculation and SupplyCurve sorting class.
reV
supply curve computes the transmission costs associated with each supply curve point output byreV
supply curve aggregation. Transmission costs can either be computed competitively (where total capacity remaining on the transmission grid is tracked and updated after each new connection) or non-competitively (where the cheapest connections for each supply curve point are allowed regardless of the remaining transmission grid capacity). In both cases, the permutation of transmission costs between supply curve points and transmission grid features should be computed using the reVX Least Cost Transmission Paths utility.- Parameters:
sc_points (str | pandas.DataFrame) – Path to CSV or JSON or DataFrame containing supply curve point summary. Can also be a filepath to a
reV
bespoke HDF5 output file where themeta
dataset has the same format as the supply curve aggregation output.Note
If executing
reV
from the command line, this input can also be"PIPELINE"
to parse the output of the previous pipeline step and use it as input to this call. However, note that duplicate executions of any preceding commands within the pipeline may invalidate this parsing, meaning the sc_points input will have to be specified manually.trans_table (str | pandas.DataFrame | list) – Path to CSV or JSON or DataFrame containing supply curve transmission mapping. This can also be a list of transmission tables with different line voltage (capacity) ratings. See the reVX Least Cost Transmission Paths utility to generate these input tables.
sc_features (str | pandas.DataFrame, optional) – Path to CSV or JSON or DataFrame containing additional supply curve features (e.g. transmission multipliers, regions, etc.). These features will be merged to the sc_points input table on ALL columns that both have in common. If
None
, no extra supply curve features are added. By default,None
.sc_capacity_col (str, optional) – Name of capacity column in trans_sc_table. The values in this column determine the size of transmission lines built. The transmission capital costs per MW and the reinforcement costs per MW will be returned in terms of these capacity values. Note that if this column != “capacity”, then “capacity” must also be included in trans_sc_table since those values match the “mean_cf” data (which is used to calculate LCOT and Total LCOE). This input can be used to, e.g., size transmission lines based on solar AC capacity (
sc_capacity_col="capacity_ac"
). By default,"capacity"
.poi_info (str | pandas.DataFrame, optional) – Path to CSV or DataFrame containing POI point connection summary. This table should have at least the following columns:
“POI_limit” or “ac_cap”: POI connection capacity (MW)
- “POI_name”: String identifier for the POI used to
merge with the
"end"
column from the trans_table input
“POI_cost_MW”: Connection cost for this POI, in $/MW.
This input is required if you are running
poi_sort
. By default,None
.
Examples
Standard outputs in addition to the values provided in sc_points, produced by
reV.supply_curve.sc_aggregation.SupplyCurveAggregation
:- transmission_multiplierint | float
Transmission cost multiplier that scales the line cost but not the tie-in cost in the calculation of LCOT.
- trans_gidint
Unique transmission feature identifier that each supply curve point was connected to.
- trans_capacityfloat
Total capacity (not available capacity) of the transmission feature that each supply curve point was connected to. Default units are MW.
- trans_typestr
Tranmission feature type that each supply curve point was connected to (e.g. Transline, Substation).
- trans_cap_cost_per_mwfloat
Capital cost of connecting each supply curve point to their respective transmission feature. This value includes line cost with transmission_multiplier and the tie-in cost. Default units are $/MW.
- dist_kmfloat
Distance in km from supply curve point to transmission connection.
- lcotfloat
Levelized cost of connecting to transmission ($/MWh).
- total_lcoefloat
Total LCOE of each supply curve point (mean_lcoe + lcot) ($/MWh).
- total_lcoe_frictionfloat
Total LCOE of each supply curve point considering the LCOE friction scalar from the aggregation step (mean_lcoe_friction + lcot) ($/MWh).
Methods
add_sum_cols
(table, sum_cols)Add a summation column to table.
compute_total_lcoe
(fcr[, ...])Compute LCOT and total LCOE for all sc point to transmission feature connections
full_sort
(fcr[, transmission_costs, ...])run full supply curve sorting
poi_sort
(fcr[, max_cap_tie_in_cost_per_mw, ...])run POI-based supply curve sorting
run
(out_fpath, fixed_charge_rate[, simple, ...])Run Supply Curve Transmission calculations.
run_poi
(out_fpath, fixed_charge_rate[, ...])Run POI Supply Curve sort calculations
simple_sort
(fcr[, transmission_costs, ...])Run simple supply curve sorting that does not take into account available capacity
- compute_total_lcoe(fcr, transmission_costs=None, avail_cap_frac=1, line_limited=False, connectable=True, max_workers=None, consider_friction=True, trans_table=None)[source]
Compute LCOT and total LCOE for all sc point to transmission feature connections
- Parameters:
fcr (float) – Fixed charge rate, used to compute LCOT
transmission_costs (str | dict, optional) – Transmission feature costs to use with TransmissionFeatures handler: line_tie_in_cost, line_cost, station_tie_in_cost, center_tie_in_cost, sink_tie_in_cost, by default None
avail_cap_frac (int, optional) – Fraction of transmissions features capacity ‘ac_cap’ to make available for connection to supply curve points, by default 1
line_limited (bool, optional) – Flag to have substation connection is limited by maximum capacity of the attached lines, legacy method, by default False
connectable (bool, optional) – Flag to only compute tranmission capital cost if transmission feature has enough available capacity, by default True
max_workers (int | NoneType, optional) – Number of workers to use to compute lcot, if > 1 run in parallel. None uses all available cpu’s. by default None
consider_friction (bool, optional) – Flag to consider friction layer on LCOE when “mean_lcoe_friction” is in the sc points input, by default True
trans_table (pd.DataFrame, optional) – Optional transmission table to compute costs for. If no table is provided, the object’s _trans_table attribute is used instead. By default,
None
.
- static add_sum_cols(table, sum_cols)[source]
Add a summation column to table.
- Parameters:
table (pd.DataFrame) – Supply curve table.
sum_cols (dict) – Mapping of new column label(s) to multiple column labels to sum. Example: sum_col={‘total_cap_cost’: [‘cap_cost1’, ‘cap_cost2’]} Which would add a new ‘total_cap_cost’ column which would be the sum of ‘cap_cost1’ and ‘cap_cost2’ if they are present in table.
- Returns:
table (pd.DataFrame) – Supply curve table with additional summation columns.
- full_sort(fcr, transmission_costs=None, avail_cap_frac=1, line_limited=False, connectable=True, max_workers=None, consider_friction=True, sort_on=None, columns=(SupplyCurveField.TRANS_GID, SupplyCurveField.TRANS_CAPACITY, SupplyCurveField.TRANS_TYPE, SupplyCurveField.TOTAL_TRANS_CAP_COST_PER_MW, SupplyCurveField.DIST_SPUR_KM, SupplyCurveField.LCOT, SupplyCurveField.TOTAL_LCOE), wind_dirs=None, n_dirs=2, downwind=False, offshore_compete=False)[source]
run full supply curve sorting
- Parameters:
fcr (float) – Fixed charge rate, used to compute LCOT
transmission_costs (str | dict, optional) – Transmission feature costs to use with TransmissionFeatures handler: line_tie_in_cost, line_cost, station_tie_in_cost, center_tie_in_cost, sink_tie_in_cost, by default None
avail_cap_frac (int, optional) – Fraction of transmissions features capacity ‘ac_cap’ to make available for connection to supply curve points, by default 1
line_limited (bool, optional) – Flag to have substation connection is limited by maximum capacity of the attached lines, legacy method, by default False
connectable (bool, optional) – Flag to only compute transmission capital cost if transmission feature has enough available capacity, by default True
max_workers (int | NoneType, optional) – Number of workers to use to compute lcot, if > 1 run in parallel. None uses all available cpu’s. by default None
consider_friction (bool, optional) – Flag to consider friction layer on LCOE when “mean_lcoe_friction” is in the sc points input, by default True
sort_on (str, optional) – Column label to sort the Supply Curve table on. This affects the build priority - connections with the lowest value in this column will be built first, by default None, which will use total LCOE without any reinforcement costs as the sort value.
columns (list | tuple, optional) – Columns to preserve in output connections dataframe, by default (‘trans_gid’, ‘trans_capacity’, ‘trans_type’, ‘trans_cap_cost_per_mw’, ‘dist_km’, ‘lcot’, ‘total_lcoe’)
wind_dirs (pandas.DataFrame | str, optional) – path to .csv or reVX.wind_dirs.wind_dirs.WindDirs output with the neighboring supply curve point gids and power-rose value at each cardinal direction, by default None
n_dirs (int, optional) – Number of prominent directions to use, by default 2
downwind (bool, optional) – Flag to remove downwind neighbors as well as upwind neighbors, by default False
offshore_compete (bool, default) – Flag as to whether offshore farms should be included during CompetitiveWindFarms, by default False
- Returns:
supply_curve (pandas.DataFrame) – Updated sc_points table with transmission connections, LCOT and LCOE+LCOT based on full supply curve connections
- poi_sort(fcr, max_cap_tie_in_cost_per_mw=None, consider_friction=True, sort_on=None, scale_with_capacity=False, connection_upper_limit=None, columns=(SupplyCurveField.TRANS_GID, SupplyCurveField.TRANS_CAPACITY, SupplyCurveField.TRANS_TYPE, SupplyCurveField.TOTAL_TRANS_CAP_COST_PER_MW, SupplyCurveField.DIST_SPUR_KM, SupplyCurveField.LCOT, SupplyCurveField.TOTAL_LCOE))[source]
run POI-based supply curve sorting
- Parameters:
fcr (float) – Fixed charge rate, used to compute LCOT
max_cap_tie_in_cost_per_mw (float, optional) – Cost to tie into a POI after it has reached maximum capacity. If you don’t want to allow connections after the POI capacity is reached, leave this input unspecified. By default,
None
.consider_friction (bool, optional) – Flag to consider friction layer on LCOE when
"mean_lcoe_friction"
is in the sc points input. By default,True
.sort_on (str, optional) – Column label to sort the Supply Curve table on. This affects the build priority - connections with the lowest value in this column will be built first. By default,
None
, which will use total LCOE without any reinforcement costs as the sort value.scale_with_capacity (bool, default=False) – Option to scale the costs as capacity changes. If
False
, costs are only computed once at the beginning of the sort. IfTrue
, costs are re-computed as parts of a plant are connected, leaving the remainder of the plant capacity with higher connection costs (since new lines have to be built for a smaller amount of capacity). By default,False
.connection_upper_limit (int | float, optional) – Optional upper limit for total capacity (MW). If specified, the sort will stop when this amount of capacity has been connected. By default,
None
which does not impose any limits.columns (list | tuple, optional) – Columns to preserve in output connections dataframe, by default (‘trans_gid’, ‘trans_capacity’, ‘trans_type’, ‘trans_cap_cost_per_mw’, ‘dist_km’, ‘lcot’, ‘total_lcoe’)
- Returns:
supply_curve (pandas.DataFrame) – Updated sc_points table with POI transmission connections, LCOT and LCOE+LCOT based on POI supply curve connections.
- simple_sort(fcr, transmission_costs=None, avail_cap_frac=1, max_workers=None, consider_friction=True, sort_on=None, columns=('trans_gid', 'trans_type', 'count_num_parallel_trans', 'dist_spur_km', 'cost_total_trans_usd_per_mw_ac', 'lcot_usd_per_mwh', 'lcoe_all_in_usd_per_mwh', 'dist_export_km', 'dist_reinforcement_km', 'cost_spur_usd_per_mw_ac', 'cost_poi_usd_per_mw_ac', 'cost_export_usd_per_mw_ac', 'cost_reinforcement_usd_per_mw_ac', 'latitude_poi', 'longitude_poi', 'latitude_reinforcement_poi', 'longitude_reinforcement_poi'), wind_dirs=None, n_dirs=2, downwind=False, offshore_compete=False)[source]
Run simple supply curve sorting that does not take into account available capacity
- Parameters:
fcr (float) – Fixed charge rate, used to compute LCOT
transmission_costs (str | dict, optional) – Transmission feature costs to use with TransmissionFeatures handler: line_tie_in_cost, line_cost, station_tie_in_cost, center_tie_in_cost, sink_tie_in_cost, by default None
avail_cap_frac (int, optional) – Fraction of transmissions features capacity ‘ac_cap’ to make available for connection to supply curve points, by default 1
line_limited (bool, optional) – Flag to have substation connection is limited by maximum capacity of the attached lines, legacy method, by default False
connectable (bool, optional) – Flag to only compute tranmission capital cost if transmission feature has enough available capacity, by default True
max_workers (int | NoneType, optional) – Number of workers to use to compute lcot, if > 1 run in parallel. None uses all available cpu’s. by default None
consider_friction (bool, optional) – Flag to consider friction layer on LCOE when “mean_lcoe_friction” is in the sc points input, by default True
sort_on (str, optional) – Column label to sort the Supply Curve table on. This affects the build priority - connections with the lowest value in this column will be built first, by default None, which will use total LCOE without any reinforcement costs as the sort value.
columns (list | tuple, optional) – Columns to preserve in output connections dataframe. By default,
DEFAULT_COLUMNS
.wind_dirs (pandas.DataFrame | str, optional) – path to .csv or reVX.wind_dirs.wind_dirs.WindDirs output with the neighboring supply curve point gids and power-rose value at each cardinal direction, by default None
n_dirs (int, optional) – Number of prominent directions to use, by default 2
downwind (bool, optional) – Flag to remove downwind neighbors as well as upwind neighbors
offshore_compete (bool, default) – Flag as to whether offshore farms should be included during CompetitiveWindFarms, by default False
- Returns:
supply_curve (pandas.DataFrame) – Updated sc_points table with transmission connections, LCOT and LCOE+LCOT based on simple supply curve connections
- run_poi(out_fpath, fixed_charge_rate, max_cap_tie_in_cost_per_mw=None, scale_with_capacity=False, consider_friction=True, sort_on=None, columns=('trans_gid', 'trans_type', 'count_num_parallel_trans', 'dist_spur_km', 'cost_total_trans_usd_per_mw_ac', 'lcot_usd_per_mwh', 'lcoe_all_in_usd_per_mwh', 'dist_export_km', 'dist_reinforcement_km', 'cost_spur_usd_per_mw_ac', 'cost_poi_usd_per_mw_ac', 'cost_export_usd_per_mw_ac', 'cost_reinforcement_usd_per_mw_ac', 'latitude_poi', 'longitude_poi', 'latitude_reinforcement_poi', 'longitude_reinforcement_poi'), competition=None)[source]
Run POI Supply Curve sort calculations
Run full POI-base supply curve transmission sort taking into account available capacity of transmission features and POI’s when making connections.
- Parameters:
out_fpath (str) – Full path to output CSV file. Does not need to include file ending - it will be added automatically if missing.
fixed_charge_rate (float) – Fixed charge rate, (in decimal form: 5% = 0.05). This value is used to compute LCOT.
max_cap_tie_in_cost_per_mw (float, optional) – Cost to tie into a POI after it has reached maximum capacity. If you don’t want to allow connections after the POI capacity is reached, leave this input unspecified. By default,
None
.scale_with_capacity (bool, default=False) – Option to scale the costs as capacity changes. If
False
, costs are only computed once at the beginning of the sort. IfTrue
, costs are re-computed as parts of a plant are connected, leaving the remainder of the plant capacity with higher connection costs (since new lines have to be built for a smaller amount of capacity). By default,False
.consider_friction (bool, optional) – Flag to add a new
"total_lcoe_friction"
column to the supply curve output that contains the sum of the computed"total_lcoe"
value and the input"mean_lcoe_friction"
values. If"mean_lcoe_friction"
is not in the sc_points input, this option is ignored. By default,True
.sort_on (str, optional) – Column label to sort the supply curve table on. This affects the build priority when doing a “full” sort - connections with the lowest value in this column will be built first. For a “simple” sort, only connections with the lowest value in this column will be considered. If
None
, the sort is performed on the total LCOE without any reinforcement costs added (this is typically what you want - it avoids unrealistically long spur-line connections). By defaultNone
.columns (list | tuple, optional) – Columns to preserve in output supply curve dataframe. By default,
DEFAULT_COLUMNS
.competition (dict, optional) – Optional dictionary of arguments for competitive wind farm exclusions, which removes supply curve points upwind (and optionally downwind) of the lowest LCOE supply curves. If
None
, no competition is applied. Otherwise, this dictionary can have up to four keys:wind_dirs
(required) : A path to a CSV file orreVX ProminentWindDirections
output with the neighboring supply curve point gids and power-rose values at each cardinal direction.n_dirs
(optional) : An integer representing the number of prominent directions to use during wind farm competition. By default,2
.downwind
(optional) : A flag indicating that downwind neighbors should be removed in addition to upwind neighbors during wind farm competition. By default,False
.offshore_compete
(optional) : A flag indicating that offshore farms should be included during wind farm competition. By default,False
.
By default
None
.
- Returns:
str – Path to output supply curve.
- run(out_fpath, fixed_charge_rate, simple=True, avail_cap_frac=1, line_limited=False, transmission_costs=None, consider_friction=True, sort_on=None, columns=('trans_gid', 'trans_type', 'count_num_parallel_trans', 'dist_spur_km', 'cost_total_trans_usd_per_mw_ac', 'lcot_usd_per_mwh', 'lcoe_all_in_usd_per_mwh', 'dist_export_km', 'dist_reinforcement_km', 'cost_spur_usd_per_mw_ac', 'cost_poi_usd_per_mw_ac', 'cost_export_usd_per_mw_ac', 'cost_reinforcement_usd_per_mw_ac', 'latitude_poi', 'longitude_poi', 'latitude_reinforcement_poi', 'longitude_reinforcement_poi'), max_workers=None, competition=None)[source]
Run Supply Curve Transmission calculations.
Run full supply curve taking into account available capacity of transmission features when making connections.
- Parameters:
out_fpath (str) – Full path to output CSV file. Does not need to include file ending - it will be added automatically if missing.
fixed_charge_rate (float) – Fixed charge rate, (in decimal form: 5% = 0.05). This value is used to compute LCOT.
simple (bool, optional) – Option to run the simple sort (does not keep track of capacity available on the existing transmission grid). If
False
, a full transmission sort (where connections are limited based on available transmission capacity) is run. Note that the full transmission sort requires the avail_cap_frac and line_limited inputs. By default,True
.avail_cap_frac (int, optional) – This input has no effect if
simple=True
. Fraction of transmissions features capacityac_cap
to make available for connection to supply curve points. By default,1
.line_limited (bool, optional) – This input has no effect if
simple=True
. Flag to have substation connection limited by maximum capacity of the attached lines. This is a legacy method. By default,False
.transmission_costs (str | dict, optional) – Dictionary of transmission feature costs or path to JSON file containing a dictionary of transmission feature costs. These costs are used to compute transmission capital cost if the input transmission tables do not have a
"trans_cap_cost"
column (this input is ignored otherwise). The dictionary must include:line_tie_in_cost
line_cost
station_tie_in_cost
center_tie_in_cost
sink_tie_in_cost
By default,
None
.consider_friction (bool, optional) – Flag to add a new
"total_lcoe_friction"
column to the supply curve output that contains the sum of the computed"total_lcoe"
value and the input"mean_lcoe_friction"
values. If"mean_lcoe_friction"
is not in the sc_points input, this option is ignored. By default,True
.sort_on (str, optional) – Column label to sort the supply curve table on. This affects the build priority when doing a “full” sort - connections with the lowest value in this column will be built first. For a “simple” sort, only connections with the lowest value in this column will be considered. If
None
, the sort is performed on the total LCOE without any reinforcement costs added (this is typically what you want - it avoids unrealistically long spur-line connections). By defaultNone
.columns (list | tuple, optional) – Columns to preserve in output supply curve dataframe. By default,
DEFAULT_COLUMNS
.max_workers (int, optional) – Number of workers to use to compute LCOT. If > 1, computation is run in parallel. If
None
, computation uses all available CPU’s. By default,None
.competition (dict, optional) – Optional dictionary of arguments for competitive wind farm exclusions, which removes supply curve points upwind (and optionally downwind) of the lowest LCOE supply curves. If
None
, no competition is applied. Otherwise, this dictionary can have up to four keys:wind_dirs
(required) : A path to a CSV file orreVX ProminentWindDirections
output with the neighboring supply curve point gids and power-rose values at each cardinal direction.n_dirs
(optional) : An integer representing the number of prominent directions to use during wind farm competition. By default,2
.downwind
(optional) : A flag indicating that downwind neighbors should be removed in addition to upwind neighbors during wind farm competition. By default,False
.offshore_compete
(optional) : A flag indicating that offshore farms should be included during wind farm competition. By default,False
.
By default
None
.
- Returns:
str – Path to output supply curve.