Skip to main content

Python client for the SynergyPlus distributed EnergyPlus runner.

Project description

SynergyPlus Python SDK

synergyplus is the official Python client for the SynergyPlus distributed EnergyPlus runner. It wraps the apiserver's HTTP API for submitting simulations and parametric batches, polling their state, and fetching results.

Install

pip install synergyplus

# Optional: enable SynergyClient.upload_input() for pushing local model/weather
# files to S3-compatible storage (MinIO, AWS S3, ...).
pip install "synergyplus[s3]"

Requires Python 3.9+.

Quickstart

from synergyplus import SynergyClient, ArtifactRef

sp = SynergyClient("http://localhost:8090", token="synergy-dev-key")

sim = sp.submit_simulation(
    engine_version="24.1.0",
    model=ArtifactRef("s3://models/sample/baseline.idf"),
    weather=ArtifactRef("s3://weather/sample/chicago.epw"),
)

sp.wait(sim["id"])
print(sp.get_results(sim["id"]))

API

SynergyClient(base_url, token=None, timeout=30.0)

Method Description
healthz() GET /healthz — returns True if the apiserver is up.
submit_simulation(*, engine_version, model, weather, priority=None, extraction_spec=None) POST /v1/simulations{id, state}.
get_simulation(sim_id) GET /v1/simulations/{id}{id, state, verdict?, result?}.
get_results(sim_id) GET /v1/results/{simId}{verdict, metrics, artifactUri}.
wait(sim_id, *, poll=2.0, deadline=None) Block until the simulation reaches a terminal state (succeeded/failed).
submit_batch(*, engine_version, weather, variants, priority=None, max_parallelism=None, idempotency_key=None) POST /v1/batches{batchId, state}.
get_batch(batch_id) GET /v1/batches/{id}{id, state, total, succeeded, failed}.
list_batch_simulations(batch_id, *, limit=100, offset=0) GET /v1/batches/{id}/simulations{items, total}.
upload_input(local_path, ref, *, s3_endpoint=None, s3_region="us-east-1", s3_access_key=None, s3_secret_key=None) Upload a local file to an s3:// ref and return an ArtifactRef with its sha256. Requires the s3 extra.

model/weather accept either an s3://... string or an ArtifactRef.

Batch example

from synergyplus import SynergyClient, ArtifactRef, Variant

sp = SynergyClient("http://localhost:8090", token="synergy-dev-key")

batch = sp.submit_batch(
    engine_version="24.1.0",
    weather=ArtifactRef("s3://weather/sample/chicago.epw"),
    variants=[
        Variant(model=ArtifactRef("s3://models/a.idf")),
        Variant(model=ArtifactRef("s3://models/b.idf")),
    ],
    max_parallelism=8,
)
print(batch["batchId"])

License

MIT — see LICENSE.

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

synergyplus-0.2.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

synergyplus-0.2.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file synergyplus-0.2.0.tar.gz.

File metadata

  • Download URL: synergyplus-0.2.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for synergyplus-0.2.0.tar.gz
Algorithm Hash digest
SHA256 641b4c7e47c2c273abd259adff11747c39bcc2def9f4bafa93699f1d8923f61b
MD5 40584f6dc414bac63504c081e158ed8f
BLAKE2b-256 f635a5e3f6f3eb1c3fc412f1cb4b8600b1d1723177957846f09d6ddee1b2e8aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for synergyplus-0.2.0.tar.gz:

Publisher: release-pypi.yml on City-Syntax/SynergyPlus

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

File details

Details for the file synergyplus-0.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for synergyplus-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 76313c11ea6d2b3aafaffa64031750f76814e6bfc3e89fad611e213220081a87
MD5 750c4392a12f131d83851727d9c1a338
BLAKE2b-256 2a21f133c773c9ef46fc03d80137fbe4b1577979bd93dcb3ebe361fdd9c94c1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for synergyplus-0.2.0-py3-none-any.whl:

Publisher: release-pypi.yml on City-Syntax/SynergyPlus

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