Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/sphinx/source/whatsnew/v0.11.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Documentation

- `spectra` and `spectra_components` (:issue:`2150`, :pull:`2264`)

* Added a example to :py:func:`~pvlib.pvsystem.retrieve_sam` docstring to
demonstrate how to retrieve a database from the SAM repo. (:pull:`2313`)

Testing
~~~~~~~
Expand Down
8 changes: 7 additions & 1 deletion pvlib/pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2060,7 +2060,13 @@ def retrieve_sam(name=None, path=None):
CEC_Date NaN
CEC_Type Utility Interactive
Name: AE_Solar_Energy__AE6_0__277V_, dtype: object
"""

# using the latest CEC Inverter database, via URL
>>> inv_db = pvsystem.retrieve_sam(path="https://raw.githubusercontent.com/NREL/SAM/refs/heads/develop/deploy/libraries/CEC%20Inverters.csv")
>>> inv_db.keys()
Index(['ABB__PVI_3_0_OUTD_S_US_A__208V_', 'ABB__PVI_3_0_OUTD_S_US_A__240V_', ...],
dtype='object', length=...)
""" # noqa: E501
# error: path was previously silently ignored if name was given GH#2018
if name is not None and path is not None:
raise ValueError("Please provide either 'name' or 'path', not both.")
Expand Down
Loading