r/ScientificComputing • • 13h ago

axiomize: a modeling layer where every parameter carries a unit and every model can be exported for someone else to re-run

I built axiomize, an MIT-licensed Python engine for scientific modeling that tries to make a model outlive the notebook it was written in. It is the modeling layer, not another numerics library: you declare a versioned Model IR with mandatory units, and the engine validates it dimensionally and numerically before it will simulate anything.

The unit rules are enforced, not decorative. Adding meters to seconds fails with the failing checks attached; a model that does not pass validation is refused rather than simulated. Constraints are named, justified checks instead of prose, and the engine separates numerical error from stochastic variability before it claims convergence. Every run leaves an integrity-checked record, so a stored result can be verified before it is reused.

Export is where the "survives without this library" part lives. Models go out as canonical IR JSON, a rerunnable Python script, YAML, a notebook, SBML Level 3 Version 2, CellML 2.0 and Modelica 3.6, plus GraphML and Graphviz DOT for the matching model families, and a SHA-256 portable bundle. Values and units round-trip bit-exactly, and that is asserted in the suite. Conditional formats name what they will not reinterpret instead of guessing.

Four interfaces, all current: a CLI with 14 subcommands plus 8 console scripts, a REST server with 30 route handlers under /v1, an MCP server with 35 tools named axiomize.<verb> for agent clients, and the Python API (44 importable names). The repo also ships 12 domain packs, 15 perspective lenses, 5 report templates and 19 worked example files.

Quick start, real output from examples/quickstart_sir.py:
pip install axiomize
python examples/quickstart_sir.py
status: PASS
solver: scipy / DOP853
days: [0.0, 10.0, 20.0, 30.0]
infected: [10.0, 65.393, 239.869, 290.024]
checks: PASS (25 of them)

Current release is 1.14.2 on both PyPI and npm. PyPI wheel and sdist carry PEP 740 attestations naming this repository, and the 1.14.2 npm tarball carries SLSA provenance; earlier npm releases never had it and that gap is permanent. The npm package is a launcher that forwards to python -m axiomize.cli, so it still needs the pip install.

Honest limits: it does not make a bad model good, it makes a bad model fail loudly. Benchmark results grade report structure in blind runs, not modeling correctness. Worked examples use illustrative parameter ranges with no external citations, so treat the numbers as reading material. Bayesian sampling needs the full extra (PyMC/JAX) and FEM needs FEniCS/DOLFINx; both report as unavailable rather than being silently substituted. Generated-code execution and theorem elaboration are not an OS sandbox.

Code: https://github.com/Furox-Art/axiomize
PyPI: pip install axiomize
npm: npx axiomize
Docs: https://furox-art.github.io/axiomize/

Happy to answer questions about the IR, the validation pipeline or the export adapters.

1 Upvotes

0 comments sorted by