Metadata-Version: 2.4
Name: taktwerk
Version: 0.8.1
Summary: Read taktwerk run records and campaigns into arrays and data frames, and start runs
Keywords: simulation,co-simulation,fixed-step,records,campaign
License-Expression: MIT OR Apache-2.0
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Requires-Dist: numpy>=2.2.6 ; extra == 'numpy'
Requires-Dist: pandas>=2.3.3 ; extra == 'pandas'
Requires-Python: >=3.10
Project-URL: Homepage, https://labinetix.github.io/taktwerk/
Project-URL: Documentation, https://labinetix.github.io/taktwerk/python.html
Provides-Extra: numpy
Provides-Extra: pandas
Description-Content-Type: text/markdown

# taktwerk for Python

Read the records of [taktwerk](https://labinetix.github.io/taktwerk/) runs and campaigns into
lists, numpy arrays or pandas data frames, and start runs and campaigns through the `taktwerk`
command. Offline only: nothing here touches a running engine's cycle.

```sh
pip install 'taktwerk[pandas]'      # or: uv add 'taktwerk[pandas]'
```

```python
import taktwerk

run = taktwerk.read_run("records/project/main")  # a run directory, or one run below it
run["plant.level"], run.t_engine, run.stop, run.overrides
run.to_pandas()  # indexed by engine time

c = taktwerk.read_campaign("out/gains")  # a campaign's output directory
c.to_pandas()  # one row per run: axes, values, status
c.read("nominal-g03").to_pandas()

taktwerk.run("project.toml", until_time=600, set={"ctrl.kp": 2.0}, seed=1)
taktwerk.campaign("gains.toml")  # taktwerk campaign --write, then loaded
```

The reader needs only the standard library; `taktwerk[numpy]` and `taktwerk[pandas]` add the
conversions. Starting runs needs the `taktwerk` command on `PATH` or in `$TAKTWERK`. Guide:
[Python](https://labinetix.github.io/taktwerk/python.html).
