Runnable demo collection for the DerivKit ecosystem.
This repository is non-installable by design — just clone, create an environment, and run.
It contains ready-to-execute Python scripts and optional Jupyter notebooks showcasing
key DerivKit modules such as DerivativeKit, CalculusKit, and ForecastKit.
derivkit-demos/
├─ demo-scripts/ # Runnable demo scripts (no install required)
│ ├─ 01-derivative-kit-simple.py
│ ├─ 02-derivative-kit-advanced.py
│ ├─ 03-calculus-kit-simple.py
│ ├─ 04-calculus-kit-advanced.py
│ ├─ 05-forecast-kit-fisher.py
│ ├─ 06-forecast-kit-fisher-bias.py
│ └─ 07-forecast-kit-dali.py
│
├─ demo-notebooks/ # Optional notebooks (not required for running)
├─ utils/
│ └─ style.py # Shared Matplotlib style and color palette
│
├─ plots/ # Auto-generated figures (git-ignored)
├─ templates/ # Plot or doc templates for demos
├─ forecast_demo.py # Combined example launcher for ForecastKit demos
├─ run_demo.py # Launcher utility to run any demo by ID or name
│
├─ requirements.txt # Minimal dependencies (DerivKit, NumPy, SciPy, Matplotlib)
├─ environment.yaml # Conda environment file (optional)
├─ pyproject.toml # Metadata only (not installable)
├─ LICENSE
└─ README.md
DerivativeKit
- Derivative methods backends with analytic comparisons (finite, poly, adaptive).
CalculusKit
- Gradients, Hessians, and Jacobians with analytic comparisons.
ForecastKit
- Fisher Information — analytic vs. numerical ellipses.
- Fisher Bias — systematic offset → parameter shift (Δθ).
- DALI — Fisher vs. Doublet-DALI vs. exact log-likelihood.
Figures are automatically saved to plots/ as both .pdf and .png unless --plot is used to display them interactively.
You do not need to install this repo — just clone and run inside a Python or Conda environment.
With pip:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtWith conda:
conda env create -f environment.yaml
conda activate derivkit-demosList all available demos:
python run_demo.py --listRun a specific demo:
python run_demo.py 07 -- --plotRun by fuzzy name:
python run_demo.py dali -- --plot
python run_demo.py fisher-bias -- --method adaptiveRun directly:
python demo-scripts/05-forecast-kit-fisher.py --plotThe
--separator passes additional arguments directly to the demo.
All demos use a shared visual style from:
from utils.style import apply_plot_style, DEFAULT_COLORS
apply_plot_style()Available colors:
DEFAULT_COLORS = {"blue": "#3b9ab2", "yellow": "#e1af00", "red": "#f21901"}
-
ImportError:
utils.style
Always run scripts from the repo root or viarun_demo.py. -
No install step
This repo is meant to be run in place; avoidpip install .. -
Clean working tree
Figures and notebook outputs are ignored via.gitignore.
If you use ruff:
ruff check --fix .Add or modify demos under demo-scripts/, following the numbered naming scheme (NN-topic-name.py) and including a top-level docstring explaining purpose, usage, and key results.
MIT — see LICENSE.
If you use derivkit in your research, please cite:
@software{sarcevic2025derivkit,
author = {Nikolina Šarčević and Matthijs van der Wild and Cynthia Trendafilova and Bastien Carreres},
title = {derivkit: A Python Toolkit for Numerical Derivatives},
year = {2025},
publisher = {GitHub},
journal = {GitHub Repository},
howpublished = {\url{https://github.com/derivkit/derivkit}},
}
Developed as part of the DerivKit ecosystem (CalculusKit, ForecastKit, and friends).
Thanks to all contributors and collaborators supporting derivative-based cosmological inference tools.


