Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

samlib-0.3.1.240.post1-cp310-cp310-macosx_10_9_universal2.whl (17.4 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

samlib-0.3.1.240.post1-cp39-cp39-macosx_10_9_universal2.whl (17.4 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page