Skip to main content

Executable systems modeling in Python

Reason this release was yanked:

Breaks Api

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.

Python License

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 composable Requirement packages
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thundergraph_model-1.4.4.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

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

thundergraph_model-1.4.4-py3-none-any.whl (100.5 kB view details)

Uploaded Python 3

File details

Details for the file thundergraph_model-1.4.4.tar.gz.

File metadata

  • Download URL: thundergraph_model-1.4.4.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for thundergraph_model-1.4.4.tar.gz
Algorithm Hash digest
SHA256 7317c2c77842c1c4d1a6871bdd92f1beed4b4c06cbef0698ed448ae54e38fbdf
MD5 fb4a58cdd6a9740d969ff7054c1cfb2f
BLAKE2b-256 a6cd9e2e31ab36f037becb33368a2d2e8215a182260b8c20e142af7327952032

See more details on using hashes here.

File details

Details for the file thundergraph_model-1.4.4-py3-none-any.whl.

File metadata

File hashes

Hashes for thundergraph_model-1.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f3ff043bdfb024307c03dcfd1ccddb73059a9e3ff8d45f33bcbcc6e51198b087
MD5 3f5b835cc566bd065564d8782f914e64
BLAKE2b-256 1a85458c11a18aa1bd48a9e784d7fd178d8567dd750877500b581b9b4851df39

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