Skip to main content

Docs License: MIT PyPI version DOI

Python Code Style: Ruff Type Checked: mypy Tests: pytest PyPI Downloads

SmartBuildSim

SmartBuildSim is a deterministic smart-building simulation toolkit. It provides utilities for loading BIM-style building schemas, generating synthetic sensor data, engineering features, training forecasting/anomaly/clustering/RL models, and producing Matplotlib visualisations. A Typer-powered CLI orchestrates the full workflow using YAML configuration files.

Features

  • Deterministic synthetic data – centrally managed via smartbuildsim.config with repeatable random seeds.
  • Rich modelling suite – forecasting (linear regression with lagged features), anomaly detection (IsolationForest), clustering (k-means) and reinforcement learning (tabular Q-learning).
  • Scenario presets – ready-to-run building layouts with tuned defaults.
  • Matplotlib visualisations – overlay anomalies and cluster assignments on sensor time series plots.
  • Typer CLI – declarative YAML configs with dotted overrides and sensible output management.

Quickstart

  1. Install dependencies (Python 3.10+):

    pip install -e .
    
  2. Generate a default BIM schema:

    smartbuildsim bim init examples/outputs/schema.yaml --scenario office-small
    
  3. Create synthetic data, train models, detect anomalies, cluster zones, train RL policy, and plot results using the bundled configuration:

    smartbuildsim data generate examples/configs/default.yaml
    smartbuildsim model forecast examples/configs/default.yaml
    smartbuildsim model anomalies examples/configs/default.yaml
    smartbuildsim cluster run examples/configs/default.yaml
    smartbuildsim rl train examples/configs/default.yaml
    smartbuildsim viz plot examples/configs/default.yaml \
      --anomalies-path outputs/anomalies.csv --clusters-path outputs/clusters.csv
    
  4. Run the end-to-end Python example:

    python examples/scripts/run_example.py
    
  5. Explore the interactive workflow notebook located at examples/notebooks/smartbuildsim_workflow.ipynb for a cell-by-cell walkthrough of the same pipeline. Launch it with your preferred Jupyter interface (e.g. jupyter lab examples/notebooks).

Configuration Overview

Configuration is supplied via YAML documents. The examples/configs/default.yaml file demonstrates the expected structure:

scenario: office-small
determinism:
  seed: 123
paths:
  output_dir: ./outputs
  dataset: ./outputs/dataset.csv
data:
  days: 10
  seed: 123
models:
  forecasting:
    horizon: 2
  anomaly:
    contamination: 0.07
cluster:
  sensors:
    - cluster_energy
    - cluster_co2
viz:
  sensor: office_energy

Override any configuration entry directly from the CLI using dotted keys:

smartbuildsim data generate examples/configs/default.yaml \
  --override data.seed=999 --override data.days=5

See Deterministic execution for component specific seed overrides that integrate with the CLI.

Reproducibility

Run ./reproduce.sh to execute the default CLI pipeline twice and assert that the generated datasets are identical. This lightweight check is useful both for local development and as a CI smoke test.

Development

Install the project in editable mode and run the quality gates:

pip install -e .[dev]
ruff check .
mypy .
pytest

Post-generation Checklist

  • Deterministic data generation with scenario presets
  • Forecasting, anomaly detection, clustering, and RL modules
  • Matplotlib-based visualisations
  • Typer CLI with overrides and persisted outputs
  • Comprehensive tests and CI configuration

License

This project is licensed under the MIT License.

With Passion: dr Tymoteusz Miller

Metadata

Release files for smartbuildsim 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smartbuildsim 0.2.0
File Size Uploaded
smartbuildsim-0.2.0.tar.gz 30.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smartbuildsim 0.2.0
File Interpreter ABI Platform
smartbuildsim-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 66.5 kB

Release files / smartbuildsim-0.2.0.tar.gz

Download URL smartbuildsim-0.2.0.tar.gz
Size 30.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a2e0517f95f9336a56fcd3c8f8350a6356e58d63570a4e6c4edb4734d95a34c3
BLAKE2b-256 checksum
How to use checksums
06e66104dd4cbaeebd01c018c79ea790c06fa03579c4fefadc42bd83718cd822
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.13

Release files / smartbuildsim-0.2.0-py3-none-any.whl

Download URL smartbuildsim-0.2.0-py3-none-any.whl
Size 35.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc35a00014b4f87bb1946cf8131a648ec7931ebece8ab6df40d152287152966f
BLAKE2b-256 checksum
How to use checksums
bfd7f3e8c43c10eef99bdcfbf1675100b1a4ff9fd1f0d78c876c3218634e094c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page