Skip to main content

Synthetic smart building simulation toolkit with CLI workflows

Project description

Docs License: MIT

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

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 – configurable via Pydantic models 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
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

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

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

smartbuildsim-0.1.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

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

smartbuildsim-0.1.0-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file smartbuildsim-0.1.0.tar.gz.

File metadata

  • Download URL: smartbuildsim-0.1.0.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.13

File hashes

Hashes for smartbuildsim-0.1.0.tar.gz
Algorithm Hash digest
SHA256 95b3808eb23688900e207e702d20836af61d2d6ad41bfc770947830cf04f8887
MD5 a25cdef0a7c05b87a3eefb1752325a06
BLAKE2b-256 109001cbc8854266913d7a2a4f12208d972eae8c5b6ca561c22bb8d316f03d89

See more details on using hashes here.

File details

Details for the file smartbuildsim-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: smartbuildsim-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.13

File hashes

Hashes for smartbuildsim-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a922e9f328a46ebf232f4bf5e001c8b5d79aca991a45f9391dfc4c0763afefe3
MD5 cb948521d5c9d1e45fe4b41b5f42afb8
BLAKE2b-256 df44129ab8aeaed66bf7032b1cdcfc12b65044341173cc7d948364bc7a2a8946

See more details on using hashes here.

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