reV.SAM.econ.LCOE

class LCOE(sam_sys_inputs, site_sys_inputs=None, output_request=('lcoe_fcr',))[source]

Bases: Economic

SAM LCOE model.

Initialize a SAM LCOE economic model object.

Methods

assign_inputs()

Assign the self.sam_sys_inputs attribute to the PySAM object.

collect_outputs()

Collect SAM output_request, convert timeseries outputs to UTC, and save outputs to self.outputs property.

default()

Get the executed default pysam LCOE FCR object.

drop_leap(resource)

Drop Feb 29th from resource df with time index.

ensure_res_len(arr, time_index)

Ensure time_index has a constant time-step and only covers 365 days (no leap days).

execute()

Call the PySAM execute method.

flip_actual_irr()

Get actual IRR (from PPA/SingleOwner model).

get_sam_res(*args, **kwargs)

Get the SAM resource iterator object (single year, single file).

get_time_interval(time_index)

Get the time interval.

gross_revenue()

Get cash flow total revenue (from PPA/SingleOwner model).

lcoe_fcr()

Get LCOE ($/MWh).

lcoe_nom()

Get nominal LCOE ($/MWh) (from PPA/SingleOwner model).

lcoe_real()

Get real LCOE ($/MWh) (from PPA/SingleOwner model).

make_datetime(series)

Ensure that pd series is a datetime series with dt accessor

npv()

Get net present value (NPV) ($).

outputs_to_utc_arr()

Convert array-like SAM outputs to UTC np.ndarrays

ppa_price()

Get PPA price ($/MWh).

reV_run(points_control, site_df, cf_file, year)

Execute SAM LCOE simulations based on a reV points control instance.

Attributes

DIR

IGNORE_ATTRS

MODULE

attr_dict

Get the heirarchical PySAM object attribute dictionary.

input_list

Get the list of lowest level input attribute/variable names.

meta

Get meta data property.

module

Get module property.

pysam

Get the pysam object.

site

Get the site number for this SAM simulation.

PYSAM = <module 'PySAM.Lcoefcr' from '/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/PySAM/Lcoefcr.cpython-38-x86_64-linux-gnu.so'>
static default()[source]

Get the executed default pysam LCOE FCR object.

Returns:

PySAM.Lcoefcr

classmethod reV_run(points_control, site_df, cf_file, year, output_request=('lcoe_fcr',))[source]

Execute SAM LCOE simulations based on a reV points control instance.

Parameters:
  • points_control (config.PointsControl) – PointsControl instance containing project points site and SAM config info.

  • site_df (pd.DataFrame) – Dataframe of site-specific input variables. Row index corresponds to site number/gid (via df.loc not df.iloc), column labels are the variable keys that will be passed forward as SAM parameters.

  • cf_file (str) – reV generation capacity factor output file with path.

  • year (int | str | None) – reV generation year to calculate econ for. Looks for cf_mean_{year} or cf_profile_{year}. None will default to a non-year-specific cf dataset (cf_mean, cf_profile).

  • output_request (list | tuple | str) – Output(s) to retrieve from SAM.

Returns:

out (dict) – Nested dictionaries where the top level key is the site index, the second level key is the variable name, second level value is the output variable value.

assign_inputs()

Assign the self.sam_sys_inputs attribute to the PySAM object.

property attr_dict

Get the heirarchical PySAM object attribute dictionary.

Returns:

_attr_dict (dict) –

Dictionary with:

keys: variable groups values: lowest level attribute/variable names

collect_outputs()

Collect SAM output_request, convert timeseries outputs to UTC, and save outputs to self.outputs property.

static drop_leap(resource)

Drop Feb 29th from resource df with time index.

Parameters:

resource (pd.DataFrame) – Resource dataframe with an index containing a pandas time index object with month and day attributes.

Returns:

resource (pd.DataFrame) – Resource dataframe with all February 29th timesteps removed.

static ensure_res_len(arr, time_index)

Ensure time_index has a constant time-step and only covers 365 days (no leap days). If not remove last day

Parameters:
  • arr (ndarray) – Array to truncate if time_index has a leap day

  • time_index (pandas.DatatimeIndex) – Time index associated with arr, used to check time-series frequency and number of days

Returns:

arr (ndarray) – Truncated array of data such that there are 365 days

execute()

Call the PySAM execute method. Raise SAMExecutionError if error. Include the site index if available.

flip_actual_irr()

Get actual IRR (from PPA/SingleOwner model).

Native units are %.

static get_sam_res(*args, **kwargs)

Get the SAM resource iterator object (single year, single file).

classmethod get_time_interval(time_index)

Get the time interval.

Parameters:

time_index (pd.series) – Datetime series. Must have a dt attribute to access datetime properties (added using make_datetime method).

Returns:

time_interval (int:) – This value is the number of indices over which an hour is counted. So if the timestep is 0.5 hours, time_interval is 2.

gross_revenue()

Get cash flow total revenue (from PPA/SingleOwner model).

Native units are $.

property input_list

Get the list of lowest level input attribute/variable names.

Returns:

_inputs (list) – List of lowest level input attributes.

lcoe_fcr()

Get LCOE ($/MWh).

Native units are $/kWh, mult by 1000 for $/MWh.

lcoe_nom()

Get nominal LCOE ($/MWh) (from PPA/SingleOwner model).

Native units are cents/kWh, mult by 10 for $/MWh.

lcoe_real()

Get real LCOE ($/MWh) (from PPA/SingleOwner model).

Native units are cents/kWh, mult by 10 for $/MWh.

static make_datetime(series)

Ensure that pd series is a datetime series with dt accessor

property meta

Get meta data property.

property module

Get module property.

npv()

Get net present value (NPV) ($).

Native units are dollars.

outputs_to_utc_arr()

Convert array-like SAM outputs to UTC np.ndarrays

ppa_price()

Get PPA price ($/MWh).

Native units are cents/kWh, mult by 10 for $/MWh.

property pysam

Get the pysam object.

property site

Get the site number for this SAM simulation.