Runnable demo collection for the DerivKit ecosystem.
This repository is non-installable by design — just clone it, create an environment, and run the demos in place.
It contains ready-to-run Python scripts and optional notebooks showcasing core DerivKit modules such as DerivativeKit, CalculusKit, and ForecastKit.
derivkit-demos/
├─ scripts/ # Runnable demo scripts
│ ├─ calculus-kit-advanced.py
│ ├─ calculus-kit-simple.py
│ ├─ derivative-kit-advanced.py
│ ├─ derivative-kit-simple.py
│ ├─ derivative-kit-tabulated-advanced.py
│ ├─ derivative-kit-tabulated-simple.py
│ ├─ forecast-kit-cosmic-shear-ccl.py
│ ├─ forecast-kit-cluster-counts-forecast.py
│ ├─ forecast-kit-cluster-counts-sweep.py
│ ├─ forecast-kit-dali-1d.py
│ ├─ forecast-kit-dali-2d.py
│ ├─ forecast-kit-fisher-bias.py
│ └─ forecast-kit-fisher.py
│
├─ notebooks/ # Optional notebooks
├─ utils/
│ └─ style.py # Shared Matplotlib style and palette
│
├─ plots/ # Auto-generated figures (git-ignored)
├─ run_demo.py # Launcher utility for demos
├─ requirements.txt # Minimal dependencies
├─ environment.yaml # Conda environment file
├─ pyproject.toml # Metadata only (repo is not installable)
├─ LICENSE
└─ README.md
DerivativeKit
- Derivative methods backends with analytic comparisons (finite, poly, adaptive).
- Derivatives of tabulated functions with interpolation schemes.
CalculusKit
- Gradients, Hessians, and Jacobians with analytic comparisons.
ForecastKit
- Fisher Information — analytic vs. numerical ellipses.
- Fisher Bias — systematic offset → parameter shift (Δθ).
- DALI — nonlinear likelihood expansions beyond Fisher.
- Cluster counts — forecasting and parameter sweeps for cluster-count examples
- Cosmic shear with pyCCL — forecast for cosmic shear with pyccl
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 forecast-kit-fisher
python run_demo.py forecast-kit-fisher-bias
python run_demo.py forecast-kit-dali-1d
python run_demo.py forecast-kit-dali-2dRun by fuzzy name:
python run_demo.py fisher
python run_demo.py fisher-bias
python run_demo.py dali
python run_demo.py clusterPass extra arguments through to the demo with --:
python run_demo.py dali -- --plot
python run_demo.py forecast-kit-dali-2d -- --method adaptive
python run_demo.py forecast-kit-fisher-bias -- --plotRun directly:
python -m scripts.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.
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}},
}
MIT — see LICENSE.
Developed as part of the DerivKit ecosystem (CalculusKit, ForecastKit, and friends).
Thanks to all contributors and collaborators supporting derivative-based cosmological inference tools.


