{"id":33374366,"url":"https://github.com/derivkit/derivkit-demos","last_synced_at":"2026-05-15T02:12:10.419Z","repository":{"id":321855551,"uuid":"1065328714","full_name":"derivkit/derivkit-demos","owner":"derivkit","description":"Example scripts and notebooks showcasing how to use DerivKit’s tools for analysis, differentiation, and forecasting.","archived":false,"fork":false,"pushed_at":"2025-11-17T15:01:07.000Z","size":6870,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-17T16:26:59.030Z","etag":null,"topics":["demos","derivatives","derivkit","differentiation","examples","forecasting","inference","notebooks-jupyter","numerical-analysis","python","scientific-computing","statistics"],"latest_commit_sha":null,"homepage":"https://derivkit.org","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derivkit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-27T14:00:03.000Z","updated_at":"2025-11-17T15:01:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/derivkit/derivkit-demos","commit_stats":null,"previous_names":["derivkit/derivkit-demos"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/derivkit/derivkit-demos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derivkit%2Fderivkit-demos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derivkit%2Fderivkit-demos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derivkit%2Fderivkit-demos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derivkit%2Fderivkit-demos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derivkit","download_url":"https://codeload.github.com/derivkit/derivkit-demos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derivkit%2Fderivkit-demos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285873538,"owners_count":27246054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-22T02:00:05.934Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demos","derivatives","derivkit","differentiation","examples","forecasting","inference","notebooks-jupyter","numerical-analysis","python","scientific-computing","statistics"],"created_at":"2025-11-22T23:00:58.765Z","updated_at":"2026-05-15T02:12:10.409Z","avatar_url":"https://github.com/derivkit.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/derivkit/derivkit-logo/main/png/logo-red.png\" width=\"70\" alt=\"DerivKit red\"/\u003e\n  \u0026nbsp;\u0026nbsp;\n  \u003cimg src=\"https://raw.githubusercontent.com/derivkit/derivkit-logo/main/png/logo-blue.png\" width=\"70\" alt=\"DerivKit blue\"/\u003e\n  \u0026nbsp;\u0026nbsp;\n  \u003cimg src=\"https://raw.githubusercontent.com/derivkit/derivkit-logo/main/png/logo-yellow.png\" width=\"70\" alt=\"DerivKit yellow\"/\u003e\n\u003c/p\u003e\n\n---\n\n# DerivKit Demos\n\n[![Open CCL demo in Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/derivkit/derivkit-demos/main?labpath=notebooks/forecast-kit-cosmic-shear-ccl.ipynb)\n\n**Runnable demo collection** for the [DerivKit](https://github.com/derivkit/derivkit) ecosystem.  \nThis repository is **non-installable by design** — just clone it, create an environment, and run the demos in place.  \nIt contains ready-to-run Python scripts and optional notebooks showcasing core DerivKit modules such as **DerivativeKit**, **CalculusKit**, and **ForecastKit**.\n\n---\n\n## Repository structure\n\n```text\nderivkit-demos/\n├─ scripts/  # Runnable demo scripts\n│  ├─ calculus-kit-advanced.py\n│  ├─ calculus-kit-simple.py\n│  ├─ derivative-kit-advanced.py\n│  ├─ derivative-kit-simple.py\n│  ├─ derivative-kit-tabulated-advanced.py\n│  ├─ derivative-kit-tabulated-simple.py\n│  ├─ forecast-kit-cosmic-shear-ccl.py\n│  ├─ forecast-kit-cluster-counts-forecast.py\n│  ├─ forecast-kit-cluster-counts-sweep.py\n│  ├─ forecast-kit-dali-1d.py\n│  ├─ forecast-kit-dali-2d.py\n│  ├─ forecast-kit-fisher-bias.py\n│  └─ forecast-kit-fisher.py\n│\n├─ notebooks/  # Optional notebooks\n├─ utils/\n│  └─ style.py  # Shared Matplotlib style and palette\n│\n├─ plots/  # Auto-generated figures (git-ignored)\n├─ run_demo.py  # Launcher utility for demos\n├─ requirements.txt  # Minimal dependencies\n├─ environment.yaml  # Conda environment file\n├─ pyproject.toml  # Metadata only (repo is not installable)\n├─ LICENSE\n└─ README.md\n```\n\n---\n\n\n##  Demos included\n\n**DerivativeKit**\n- Derivative methods backends with analytic comparisons (finite, poly, adaptive).\n- Derivatives of tabulated functions with interpolation schemes.\n\n\n**CalculusKit**\n- Gradients, Hessians, and Jacobians with analytic comparisons.\n\n**ForecastKit**\n- **Fisher Information** — analytic vs. numerical ellipses.\n- **Fisher Bias** — systematic offset → parameter shift (Δθ).\n- **DALI** — nonlinear likelihood expansions beyond Fisher.\n- **Cluster counts** — forecasting and parameter sweeps for cluster-count examples\n- **Cosmic shear with pyCCL** — forecast for cosmic shear with pyccl\n\nFigures are automatically saved to `plots/` as both `.pdf` and `.png` unless `--plot` is\nused to display them interactively.\n\n---\n\n##  Quick start\n\n\u003e You **do not need to install** this repo — just clone and run inside a Python or Conda environment.\n\n### 1 Create an environment\n\n**With pip:**\n```bash\npython -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\n**With conda:**\n```bash\nconda env create -f environment.yaml\nconda activate derivkit-demos\n```\n\n---\n\n### 2 Run demos\n\nList all available demos:\n```bash\npython run_demo.py --list\n```\n\nRun a specific demo:\n```bash\npython run_demo.py forecast-kit-fisher\npython run_demo.py forecast-kit-fisher-bias\npython run_demo.py forecast-kit-dali-1d\npython run_demo.py forecast-kit-dali-2d\n```\n\nRun by fuzzy name:\n```bash\npython run_demo.py fisher\npython run_demo.py fisher-bias\npython run_demo.py dali\npython run_demo.py cluster\n```\n\nPass extra arguments through to the demo with --:\n```bash\npython run_demo.py dali -- --plot\npython run_demo.py forecast-kit-dali-2d -- --method adaptive\npython run_demo.py forecast-kit-fisher-bias -- --plot\n```\n\nRun directly:\n```bash\npython -m scripts.forecast-kit-fisher.py --plot\n```\n\n\u003e The `--` separator passes additional arguments directly to the demo.\n\n---\n\n##  Styling\n\nAll demos use a shared visual style from:\n```python\nfrom utils.style import apply_plot_style, DEFAULT_COLORS\napply_plot_style()\n```\n\nAvailable colors:  \n`DEFAULT_COLORS = {\"blue\": \"#3b9ab2\", \"yellow\": \"#e1af00\", \"red\": \"#f21901\"}`\n\n---\n\n##  Tips\n\n- **ImportError: `utils.style`**  \n  Always run scripts from the repo root or via `run_demo.py`.\n\n- **No install step**  \n  This repo is meant to be run in place; avoid `pip install .`.\n\n- **Clean working tree**  \n  Figures and notebook outputs are ignored via `.gitignore`.\n\n---\n\n##  Development tips\n\nIf you use `ruff`:\n```bash\nruff check --fix .\n```\n\nAdd 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.\n\n\n---\n\n## Citation\n\nIf you use **derivkit** in your research, please cite:\n\n```bibtex\n@software{sarcevic2025derivkit,\n  author       = {Nikolina Šarčević and Matthijs van der Wild and Cynthia Trendafilova and Bastien Carreres},\n  title        = {derivkit: A Python Toolkit for Numerical Derivatives},\n  year         = {2025},\n  publisher    = {GitHub},\n  journal      = {GitHub Repository},\n  howpublished = {\\url{https://github.com/derivkit/derivkit}},\n}\n\n```\n\n---\n\n##  License\n\nMIT — see [LICENSE](LICENSE).\n---\n\n##  Acknowledgements\n\nDeveloped as part of the **DerivKit ecosystem** (CalculusKit, ForecastKit, and friends).  \nThanks to all contributors and collaborators supporting derivative-based cosmological inference tools.\n\n## Useful links\n- [DerivKit documentation](https://docs.derivkit.org)\n- [DerivKit website](https://derivkit.org)\n- [DerivKit GitHub repository](https://github.com/derivkit/derivkit)\n- [DerivKit organization](https://github.com/derivkit)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderivkit%2Fderivkit-demos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderivkit%2Fderivkit-demos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderivkit%2Fderivkit-demos/lists"}