RepositoryPython
CADLabs

CADLabs/radCAD

A Python framework for designing, testing, and validating complex systems through modelling and simulation.

119stars
26forks
5issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: modelling-framework

#1 Repository of the month

1
TINIX TRENDING·Topic: modelling

#1 Repository of the month

1
TINIX TRENDING·Topic: cadcad

#1 Repository of the month

radCAD

PyPI Build Status Coverage Status Maintainability

Gosper Glider Gun

radCAD is a cadCAD-compatible Python framework for modelling and simulating dynamical systems. A dynamical system is one whose state evolves over time according to a fixed set of rules that depend on its current state and, optionally, external inputs.

You describe a system as a set of state transitions (encoding differential equations, agent behaviour, or other logic), then run parameter sweeps, Monte Carlo runs, and A/B tests over it in parallel across multiple processing backends. radCAD is compatible with cadCAD: its functions, data structures, and simulation results follow the same conventions, so existing cadCAD models run with minimal changes.

📚 Read the documentation  |  🎓 cadCAD.education courses

Why radCAD?

  • Simple API: describe a model, wrap it in a simulation, run it.
  • Fast: optimised for large parameter sweeps and Monte Carlo runs.
  • cadCAD compatible: standard functions, data structures, and simulation results, plus a compatibility mode for existing cadCAD models.
  • Extensible: hooks, iterable models, and typed dataclass parameters.
  • Robust exception handling: failed runs return partial results and tracebacks, so one error won't discard a long-running simulation.
  • Distributed execution: parallel processing across multiple backends, including remote Ray clusters.
  • Tested: against Python 3.10–3.12 on Linux, macOS, and Windows.

Open-source models using radCAD

Installation

pip install radcad

Optional extras:

pip install "radcad[compat]"                  # cadCAD compatibility layer
pip install "radcad[extension-backend-ray]"   # Ray backend

Quick start

import pandas as pd
from radcad import Model, Simulation

initial_state = {"x": 1}
params = {"growth": [1, 2, 3]}

def policy(params, substep, state_history, previous_state):
    return {"dx": params["growth"]}

def update_x(params, substep, state_history, previous_state, policy_input):
    return "x", previous_state["x"] + policy_input["dx"]

state_update_blocks = [
    {
        "policies": {"growth_policy": policy},
        "variables": {"x": update_x},
    }
]

model = Model(initial_state=initial_state, state_update_blocks=state_update_blocks, params=params)
simulation = Simulation(model=model, timesteps=10, runs=1)

df = pd.DataFrame(simulation.run())
print(df[["simulation", "subset", "run", "timestep", "substep", "x"]].tail())

Core concepts

The primary API is:

  1. Model: initial state, state update blocks, and parameters.
  2. Simulation: one model plus timesteps and Monte Carlo runs.
  3. Experiment: one or more simulations, useful for A/B tests and batches.
  4. Engine: execution settings, backend selection, deepcopy behaviour, substep retention, and exception handling.
from radcad import Experiment

experiment = Experiment([simulation_a, simulation_b])
result = experiment.run()

Documentation

The documentation site is built with MkDocs Material and organised with the Diátaxis framework:

  • Tutorials: learn radCAD from a complete first simulation.
  • How-to guides: configure sweeps, hooks, backends, experiments, and exception handling.
  • Reference: API docs generated from docstrings plus the simulation data model.
  • Explanation: concepts, execution model, and performance trade-offs.

Docs are published to GitHub Pages at https://cadlabs.github.io/radCAD/.

Build locally:

uv run --extra docs mkdocs serve

Examples

Development

Set up the development environment with uv:

uv sync

Run tests and benchmarks with Nox:

nox --session tests
nox --session benchmarks

See the Contributing guide for environment setup, profiling, releasing, and other development tasks.

Acknowledgements

Thanks to @danlessa, @rogervs, @abzaremba, and @smngvlkz for contributions to examples, documentation, compatibility, and CI.

License

radCAD is released under the license in LICENSE.

Star History

Star History Chart

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
oemof/oemof-solph

A model generator for energy system modelling and optimisation (LP/MILP).

432
Nov 26, 2026
RepositoryPython
donnemartin/system-design-primer

Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.

379.9k
Sep 15, 2026
RepositoryPython
vinta/awesome-python

The definitive list that answers "I want to do X in Python, which tool should I use?"

338.6k
Nov 28, 2026
RepositoryPython
practical-tutorials/project-based-learning

Curated list of project-based tutorials

290.9k
Nov 30, 2026
RepositoryPython
TheAlgorithms/Python

All Algorithms implemented in Python

226.6k
Nov 13, 2026
RepositoryPython
yt-dlp/yt-dlp

A feature-rich command-line audio/video downloader

212.4k
Dec 2, 2026
RepositoryPython
521xueweihan/HelloGitHub

:octocat: 分享 GitHub 上有趣、入门级的开源项目。Share interesting, entry-level open source projects on GitHub.

192.6k
Nov 27, 2026
RepositoryPython
Significant-Gravitas/AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

188.2k
Nov 29, 2026
RepositoryJupyter Notebook
CADLabs/ethereum-economic-model

A modular dynamical-systems model of Ethereum's validator economics

140
Aug 14, 2024