lawsynth/crates/lawsynth-python
caelum0x 7a06febeb6 chore(release): inherit repository metadata on all crates
Crates inherited version/license/edition from [workspace.package] but not
`repository`, so every crate published without a repository link. Add
`repository.workspace = true` uniformly, completing the
description+version+license+repository metadata `cargo publish` and crates.io
expect. No build impact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-06 13:08:47 +03:00
..
2026-08-16 21:04:23 +03:00
2026-08-16 23:40:41 +03:00
2026-08-16 21:04:23 +03:00

lawsynth-python

PyO3 bindings that expose a compact Python-facing World and Scenario API while reusing the Rust data, discovery, simulation, and bundle implementations. The extension defines the lawsynth module when built with the Python feature set.

Use

import lawsynth

world = lawsynth.World(
    states=["x"], parameters={"rate": 0.5},
    equations={"x": "rate * x"},
)
trajectory = world.simulate(initial={"x": 1.0}, end=1.0, step=0.01)
assert trajectory.values["x"][-1] > 1.0

Boundary helpers validate names, finite numeric values, schedules, and bundle errors before mapping them to ValueError. Python receives deterministic results for a fixed configuration; it does not bypass the scientific limits of the underlying numerical model.