Skip to main content

Python library for using and testing SimStadt workflows.

Project description

simstadt

A Python library for running and testing SimStadt workflows programmatically.

SimStadt is a city simulation tool for energy and urban analysis developed at HFT Stuttgart. This library wraps its CLI to execute workflows against CityGML files and parse the results into pandas DataFrames.

Requirements

  • Python 3.10+
  • SimStadt installed separately

Installation

pip install simstadt

Usage

from simstadt import heatdemand_simulation, photovoltaic_simulation, clean_old_workflows

results = heatdemand_simulation("path/to/city.gml", "Wuerzburg-hour.csv")
print(results.dataframe)
print(results.kpis)

pv = photovoltaic_simulation("path/to/city.gml", "Wuerzburg-hour.csv")
print(pv.dataframe)

# Remove workflow folders older than 1 hour from a project directory
clean_old_workflows(Path("path/to/project.proj"))

For more control, use run_workflow_with_citygml directly:

from simstadt import run_workflow_with_citygml

results = run_workflow_with_citygml(
    template="104_HeatDemandWithShadow",   # name in templates/ or full Path
    citygml_path="path/to/city.gml",
    replaces={"<string>METEONORM_FILE</string>": "<string>Wuerzburg-hour.csv</string>"},
    project_path=Path("path/to/project.proj"),  # optional
)
print(results.kpis)

SimStadt is located automatically via the SIMSTADT_FOLDER environment variable, or by searching ~/Desktop for a SimStadt2_0.*/ directory.

Bundled workflow templates are used by default. Custom templates are resolved via SIMSTADT_TEMPLATE_PATH, or a templates/ directory in the current working directory.

If no project path is specified, workflows are run in a temporary repository under /tmp/simstadt_repo/.

Health check

simstadt

Prints the detected SimStadt installation path and version.

Development

uv sync
uv run pytest               # all tests
uv run pytest -m "not integration"  # skip tests requiring SimStadt

AI agent

SimStadtResults and tests have been written manually during research projects.

Claude Code has been used to refactor and package the scripts into this library.

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

simstadt-0.1.4.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

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

simstadt-0.1.4-py3-none-any.whl (72.6 kB view details)

Uploaded Python 3

File details

Details for the file simstadt-0.1.4.tar.gz.

File metadata

  • Download URL: simstadt-0.1.4.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.1","id":"xia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for simstadt-0.1.4.tar.gz
Algorithm Hash digest
SHA256 bcfe1a6bf7d383d8f28f9cca96803c4e86104d661bb2872a0310159efdf13581
MD5 feb9efa7ad3a3f9322181d4624749e8b
BLAKE2b-256 55e2fbc70071a9dffe944b3cac9ff0963ad2b0456ec84c2b81ffb6f8c9b91fc4

See more details on using hashes here.

File details

Details for the file simstadt-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: simstadt-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 72.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.1","id":"xia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for simstadt-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e908175b012c5166f1943d5f68d97601fec649de0fae2309a5579e7b579e1e28
MD5 48ce1fa18927ce286d028edeb7682f87
BLAKE2b-256 3b05671f4746ddd41b7a97be7e2c4f0ed16051be15332ac5e86c9cc0be9d3cfa

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