https://nrel-pysam.readthedocs.io
- Provides a wrapper around the SAM library that groups together the C API functions by technology or financial model into modules.
- Includes error-checking, explicit input and output definition, and conversion between Python data types.
- PySAM modules are compatible with PySSC, which is included as a subpackage. PySSC is the original wrapper used by SAM's code generator.
- Automatically assign default values to input parameters from SAM's default value database.
- Built-in documentation of models and parameters.
- Python 3.5+, 64 bit
- Operating system:
- MacOSX 10.7+
- Most Linux
- Windows 7, x64
- CMake 2.8
-
PyPi:
pip install NREL-PySAM
-
Anaconda:
conda config --env --append channels nrel conda install nrel-pysam
(package via
conda-forge
channel upcoming)
- Python User Script (Python)
- PySAM Package (Python)
- PySAM Extension (C)
- SAM API (C)
- SAM Library & SSC API (C/C++)
- SSC Library (C++)
- Uses Python's C API to create importable C extension. A PySAM Extension is a wrapper module that exposes the SAM C API in a more "Pythonic" API that makes use of Python language features.
- May not be compatible with different builds of the CPython reference interpreter, and not with alternative interpreters such as PyPy, IronPython or Jython
- Most detailed error message is created by C API layer functions, inside
TranslateError()
, which throws exceptions upon failure of the C function. The error indication should be propagated up the callers, but without changing the message.