Web-based GUI substrate for the ANDES power-system simulator
Project description
tensa (server)
Phase A substrate: Python wrapper around ANDES + FastAPI HTTP/WebSocket surface. The substrate is independently usable — agents, SDKs, and curl can drive ANDES through it without any UI.
Install (development)
# Use a venv that has ANDES 2.0.x installed.
# If you don't have one yet:
python3.12 -m venv ~/andes-project/.venv
source ~/andes-project/.venv/bin/activate
pip install --upgrade pip
pip install andes # >=2.0,<3.0
# Install tensa in editable mode with dev dependencies
pip install -e ".[dev]"
Run
tensa serve --workspace ./tmp
The server has no authentication: it binds to loopback by default, so only processes on your machine can reach it. Stderr prints the serving URL and workspace path at startup. Interactive API docs are served at /docs (Swagger UI) and /redoc.
CLI flags:
--bind <addr>— interface to bind. Default127.0.0.1(loopback only). Non-loopback emits a stderr warning: there is no authentication, so a non-loopback bind exposes the API to the whole network.--port <int>— port. Default OS-assigned ephemeral; printed to stderr.--workspace <dir>— case-file workspace root. Default~/.tensa/cases. Created with mode0700if missing.--max-sessions <int>— session-creation cap. Defaultmin(4, max(1, cpu_count // 2)).--idle-timeout-seconds <int>— reap idle sessions after this many seconds. Default180.--worker-rss-limit-mb <int>— per-workerRLIMIT_AS(Linux). Default1500.
Windows: the substrate runs but emits a stderr warning about the path-canonicalization limitation (R23 is best-effort on Windows in v0.1).
Trust model
See the top-level docstring in src/tensa/__init__.py. Summary:
- Local OS user is trusted (case-load equals code execution).
- Loopback web origins from random browser tabs are NOT trusted (Host/Origin allow-list + strict CORS).
- There is no authentication: the server binds to loopback by default, and any local process can reach the API. Non-loopback binds expose the API to the whole network.
- Third-party case files are not trusted by the system but trusted by the user when they choose to load.
- Sandboxed case-file execution and kernel-level workspace enforcement are deferred to the SaaS phase.
Curl-only walkthrough
The Phase A acceptance test is tests/acceptance/walkthrough.sh. It exercises the full end-to-end flow with curl and websocat — no UI. Land in Unit 8.
ANDES version coverage
See ANDES_VERSIONS.md for the seven API contracts the substrate depends on and the verification matrix per ANDES version.
Tests
pytest -m "unit" # fast, no I/O
pytest -m "integration" # spawns subprocesses, hits ANDES
pytest -m "acceptance" # full end-to-end (requires running server)
pytest # all of the above
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tensa-0.4.0.tar.gz.
File metadata
- Download URL: tensa-0.4.0.tar.gz
- Upload date:
- Size: 273.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3027a471e9b1132b801e09917b9962af36764dd9789286a4d83c3ded842b71d8
|
|
| MD5 |
d2cbe892aba1ba936063810be8e57bd8
|
|
| BLAKE2b-256 |
c8a0884c57cdcca3d9716e52304fcd1c922b063def0249ac42fa3a6c1f7ba8d1
|
Provenance
The following attestation bundles were made for tensa-0.4.0.tar.gz:
Publisher:
publish.yml on Roger-GO/TENSA
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tensa-0.4.0.tar.gz -
Subject digest:
3027a471e9b1132b801e09917b9962af36764dd9789286a4d83c3ded842b71d8 - Sigstore transparency entry: 2079230818
- Sigstore integration time:
-
Permalink:
Roger-GO/TENSA@005c57bf08ddca77f576abae0dedf8c8b51a2074 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Roger-GO
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@005c57bf08ddca77f576abae0dedf8c8b51a2074 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file tensa-0.4.0-py3-none-any.whl.
File metadata
- Download URL: tensa-0.4.0-py3-none-any.whl
- Upload date:
- Size: 3.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0adbc3a33f1484acc167a8a99322f37ae94b462c503438d14bf6419b595f64ce
|
|
| MD5 |
352f88a4778f6ca2a236a138b42d1d0d
|
|
| BLAKE2b-256 |
c3892c943e0a786dd066fef36e9c575c2b910a44c3c06b4fc2b505f951cdfaf0
|
Provenance
The following attestation bundles were made for tensa-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on Roger-GO/TENSA
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tensa-0.4.0-py3-none-any.whl -
Subject digest:
0adbc3a33f1484acc167a8a99322f37ae94b462c503438d14bf6419b595f64ce - Sigstore transparency entry: 2079230873
- Sigstore integration time:
-
Permalink:
Roger-GO/TENSA@005c57bf08ddca77f576abae0dedf8c8b51a2074 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Roger-GO
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@005c57bf08ddca77f576abae0dedf8c8b51a2074 -
Trigger Event:
workflow_dispatch
-
Statement type: