High-level library for NREL's SAM Simulation Core (SSC)
Project description
samlib
Samlib is a high-level Python wrapper to the SAM SSC library from the SAM SDK.
Overview
Samlib uses cffi to build Pythonic library bindings to the SAM SSC library. It includes mypy stubs for static type analysis and code completion.
Example
import samlib
from samlib.modules import pvsamv1
wfd = samlib.Data() # weather forecast data
wfd.lat = 38.743212
wfd.lon = -117.431238
...
data = pvsamv1.Data()
data.solar_resource_data = wfd
data.use_wf_albedo = 0
...
module = pvsamv1.Module()
module.exec(data)
# Use results in data
License
Samlib is provided under a BSD 3-Clause license.
The SAM SSC, distributed in binary form in samlib wheels, is also licensed under a BSD 3-clause license.
Building
The build-samlib.py script provides a nice wrapper for building samlib source
and wheel distributions. It requires the build package, which can be installed
with pip install --upgrade build
.
Building universal (fat) wheels on macOS requires a recent SDK. Execute the following command, replacing the deployment target if desired.
env MACOSX_DEPLOYMENT_TARGET=10.9 CMAKE_OSX_ARCHITECTURES="arm64;x86_64" CFLAGS="-arch arm64 -arch x86_64" python build-samlib.py --build-dir build --plat-name macosx_10_9_universal2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for samlib-0.3.1.240.post1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6976e2b8f5dacbfc52fe28cc6ca0e78621a2c3736aadb104e889b2cad8349e7a |
|
MD5 | cee3dc011a535a39ec17f5be8e270221 |
|
BLAKE2b-256 | f1e93df5544ccd36adb0574e3f41dd2262cccc01a5459e12efcd489b21ce8f9a |
Hashes for samlib-0.3.1.240.post1-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2184520e1ffdc9f09e7ad22ee9e38da9c1e6b4ec01ccd841ca8cb9749022ddef |
|
MD5 | 5c039b06b667bf89e2b08447e6a42145 |
|
BLAKE2b-256 | a5f069e15b89cac94ef635bba850280a059d2cc39159901b62a0aee53cc1cfa5 |