Metadata-Version: 2.4
Name: thundergraph-model
Version: 1.4.1
Summary: Executable systems modeling in Python
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: unitflow[numpy]>=0.2.0
Provides-Extra: dev
Requires-Dist: mypy>=1.13; extra == 'dev'
Requires-Dist: numpy>=1.24.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Requires-Dist: scipy>=1.10.0; extra == 'dev'
Description-Content-Type: text/markdown

# 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](https://img.shields.io/badge/python-3.11%2B-3776AB?logo=python&logoColor=white)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

## Installation

```bash
pip install thundergraph-model
```

## Quick Start

```python
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](http://localhost:3002/open-source/thundergraph-model).

## Links

- [ThunderGraph](https://www.thundergraph.ai)
- [GitHub Repository](https://github.com/ThunderGraph/thundergraph-model)

## License

Apache 2.0
