Skip to main content

Systems Advisor for Microgrids & Building Analysis

Project description

SAMBA logo

SAMBA

Systems Advisor for Microgrids & Building Analysis — optimal sizing and techno-economic analysis of hybrid energy systems.

CI PyPI License: MPL 2.0 Python

Describe a system in a YAML file; SAMBA formulates and solves a linear program (oemof-solph + HiGHS) for the least-cost component sizing and hourly dispatch, then writes a structured directory of result artifacts.

Features

  • Provably-optimal sizing (LP/MILP) — PV, wind, battery, diesel, inverter, grid, EV/V2G
  • Thermal domain — heat pump, thermal storage, and gas boiler with merit-order dispatch
  • 8 tariff structures — flat, TOU, tiered, seasonal, monthly (and combinations), plus demand charges and NEM/net-billing
  • Multi-objective cost + CO₂ with epsilon-constraint Pareto fronts
  • Real-world data — NSRDB weather fetch, bifacial PV, battery degradation, load-profile templates
  • Four ways to use it — Python API, CLI, REST service, and a Vue 3 + Tauri desktop/web UI
  • Standardised artifactskpis.json, dispatch.parquet, economics.json, sizing.csv

Quick start

pip install samba-core[cli]
samba run examples/base_scenario.yaml -o results/
import samba
from samba.scenario import load_scenario
from samba.input_resolver import resolve_arrays
from pathlib import Path

scenario = load_scenario("examples/base_scenario.yaml")
load_kw, pv_per_kwp, wind_power_kw = resolve_arrays(scenario, Path("examples"))
result = samba.run(scenario, load_kw=load_kw, pv_per_kwp=pv_per_kwp, output_dir="results/")
print(f"NPC ${result.kpis['npc']:,.0f}  ·  LCOE ${result.kpis['lcoe']:.3f}/kWh")

The default solver is HiGHS (installed via highspy); CBC also works (--solver cbc).

Desktop & Web UI

A Vue 3 + Tauri front-end talks to the samba serve REST API and runs in the browser or as a native desktop app:

samba serve --data-dir examples       # REST API on http://127.0.0.1:8000
cd ui && npm install && npm run dev    # UI on http://localhost:1420

Documentation

Document Description
Getting Started Install and run your first scenario
Scenario Reference Complete YAML schema reference
Thermal Components Heat pump, thermal storage, gas supply
CLI Reference run, validate, info, serve, …
API Reference Python API
Deployment REST service (Docker, persistence, CI)
Desktop / Web UI Running and developing the front-end
Known Limitations What SAMBA does and does not model

Contributing

See CONTRIBUTING.md. Development uses uv:

git clone https://github.com/sambaenergies/samba.git
cd samba && uv sync --all-extras

License

Mozilla Public License 2.0. See Acknowledgements.

Project details


Download files

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

Source Distribution

samba_core-5.3.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

samba_core-5.3.1-py3-none-any.whl (216.6 kB view details)

Uploaded Python 3

File details

Details for the file samba_core-5.3.1.tar.gz.

File metadata

  • Download URL: samba_core-5.3.1.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for samba_core-5.3.1.tar.gz
Algorithm Hash digest
SHA256 b723172cd7e9ed3c8feaffc32407abec475a5c237e491fbcf81bb3a25fbafb07
MD5 74341a12bef0ab051a06c4e10f8af2bd
BLAKE2b-256 bc0ed1b8f797dabc238e7711762fd8de9f11aea910b3d62c660435c43af51d0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for samba_core-5.3.1.tar.gz:

Publisher: release.yml on sambaenergies/samba

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file samba_core-5.3.1-py3-none-any.whl.

File metadata

  • Download URL: samba_core-5.3.1-py3-none-any.whl
  • Upload date:
  • Size: 216.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for samba_core-5.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf0135b5a46774c06fe02ad261aee0cff7f647d0bbee93f9764c9ab3049b764e
MD5 f63bb8536eea9db6c990b5ff888c7fb4
BLAKE2b-256 3dea304a34a9bd47d4448c5f64bfeab389ed38c470b7462f04fd1b9ce4bbf8a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for samba_core-5.3.1-py3-none-any.whl:

Publisher: release.yml on sambaenergies/samba

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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