reV.SAM.econ.Economic
- class Economic(sam_sys_inputs, site_sys_inputs=None, output_request='lcoe_fcr')[source]
Bases:
RevPySam
Base class for SAM economic models.
Initialize a SAM economic model object.
- Parameters:
sam_sys_inputs (dict) – Site-agnostic SAM system model inputs arguments.
site_sys_inputs (dict) – Optional set of site-specific SAM system inputs to complement the site-agnostic inputs.
output_request (list | tuple | str) – Requested SAM output(s) (e.g., ‘ppa_price’, ‘lcoe_fcr’).
Methods
Assign the self.sam_sys_inputs attribute to the PySAM object.
Collect SAM output_request, convert timeseries outputs to UTC, and save outputs to self.outputs property.
default
()Get the executed default pysam 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.
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.
Get cash flow total revenue (from PPA/SingleOwner model).
lcoe_fcr
()Get LCOE ($/MWh).
lcoe_nom
()Get nominal LCOE ($/MWh) (from PPA/SingleOwner model).
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) ($).
Convert array-like SAM outputs to UTC np.ndarrays
Get PPA price ($/MWh).
reV_run
(site, site_df, inputs, output_request)Run the SAM econ model for a single site.
Attributes
DIR
IGNORE_ATTRS
MODULE
Get the heirarchical PySAM object attribute dictionary.
Get the list of lowest level input attribute/variable names.
Get meta data property.
Get module property.
Get the pysam object.
Get the site number for this SAM simulation.
- lcoe_nom()[source]
Get nominal LCOE ($/MWh) (from PPA/SingleOwner model).
Native units are cents/kWh, mult by 10 for $/MWh.
- lcoe_real()[source]
Get real LCOE ($/MWh) (from PPA/SingleOwner model).
Native units are cents/kWh, mult by 10 for $/MWh.
- gross_revenue()[source]
Get cash flow total revenue (from PPA/SingleOwner model).
Native units are $.
- collect_outputs()[source]
Collect SAM output_request, convert timeseries outputs to UTC, and save outputs to self.outputs property.
- classmethod reV_run(site, site_df, inputs, output_request)[source]
Run the SAM econ model for a single site.
- Parameters:
site (int) – Site gid.
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.
inputs (dict) – Dictionary of SAM system input parameters.
output_request (list | tuple | str) – Requested SAM output(s) (e.g., ‘ppa_price’, ‘lcoe_fcr’).
- Returns:
sim.outputs (dict) – Dictionary keyed by SAM variable names with SAM numerical results.
- PYSAM = <module 'PySAM.GenericSystem' from '/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/PySAM/GenericSystem.cpython-38-x86_64-linux-gnu.so'>
- 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
- classmethod default()
Get the executed default pysam object.
- Returns:
PySAM.GenericSystem
- 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.
- 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.
- property input_list
Get the list of lowest level input attribute/variable names.
- Returns:
_inputs (list) – List of lowest level input attributes.
- 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.
- outputs_to_utc_arr()
Convert array-like SAM outputs to UTC np.ndarrays
- property pysam
Get the pysam object.
- property site
Get the site number for this SAM simulation.