Executable systems modeling in Python
Project description
thundergraph-model
Executable systems modeling in Python.
Model systems as System, Part, and Requirement types, compile dependency graphs, evaluate unit-aware expressions, bind external compute, and keep traceability in one strict library.
Installation
pip install thundergraph-model
Quick Start
from unitflow import kg
from tg_model import Part, System
from tg_model.execution import instantiate
class PayloadAnalysis(Part):
@classmethod
def define(cls, model):
payload = model.parameter_ref(PayloadSystem, "payload_kg")
model.attribute("payload_with_margin_kg", unit=kg, expr=payload * 1.1)
model.constraint("payload_limit", expr=payload <= 1000 * kg)
class PayloadSystem(System):
@classmethod
def define(cls, model):
model.parameter("payload_kg", unit=kg, required=True)
model.part("analysis", PayloadAnalysis)
cm = instantiate(PayloadSystem)
result = cm.evaluate(inputs={cm.root.payload_kg: 800 * kg})
print(result.passed)
print(result.outputs[cm.root.analysis.payload_with_margin_kg.stable_id])
What It Covers
- Unit-aware parameters, attributes, and executable constraints
- Structural modeling with
System,Part, and composableRequirementpackages - Requirement allocation and traceability
- Graph compilation and evaluation from Python-authored models
- External compute integration through
ExternalComputeBinding - Discrete behavior and scenario modeling
Documentation
Documentation and project information are available at thundergraph.ai/open-source/thundergraph-model.
Links
License
Apache 2.0
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 thundergraph_model-1.2.3.tar.gz.
File metadata
- Download URL: thundergraph_model-1.2.3.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cd076fa04154e779cde998ca8b3b942f5ef96ab162acf2798ddb04fbeac771d
|
|
| MD5 |
9faeaee90a45abec19bddb30c2df728f
|
|
| BLAKE2b-256 |
73f7de7066de153dac7018cc9c55e1ecffb225a262180ea460c131796e43d580
|
File details
Details for the file thundergraph_model-1.2.3-py3-none-any.whl.
File metadata
- Download URL: thundergraph_model-1.2.3-py3-none-any.whl
- Upload date:
- Size: 88.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f52fa646818bd74517431df1895527f57199b76f543034ef8667d0b2382bd755
|
|
| MD5 |
820eb31169b3290f1426ea5b7b62b3f3
|
|
| BLAKE2b-256 |
b370207dbcbe2327a8404ea23b3a5a492040963c259aceeb27cde10d565b4e89
|