From a895b7d18bd2648085869d808ee5fd72ba0ee5ae Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 15 Aug 2025 15:37:14 +0200 Subject: [PATCH 1/8] add changelog, bump version --- CHANGELOG.md | 162 +++++++++++++++++++++++++++++++++++++++++++++ sbi/__version__.py | 2 +- 2 files changed, 163 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a796c813a..1637b839d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,167 @@ # Changelog +## v0.25.0 + +### Highlights + +#### New Inference Methods + +* **MNPE class similar to MNLE** by @dgedon in https://github.com/sbi-dev/sbi/pull/1362 +* **Implementing SNPE-B (#199)** by @etouron1 in https://github.com/sbi-dev/sbi/pull/1471 + +#### Neural Network Architectures & Embedding Networks + +* **Simple transformer implementation** by @NicolasRR in https://github.com/sbi-dev/sbi/pull/1494 +* **Add embedding net that uses 1D causal convolutions (#1459)** by @Aranka-S in https://github.com/sbi-dev/sbi/pull/1499 +* **Add LRU-backed embedding networks** by @famura in https://github.com/sbi-dev/sbi/pull/1512 +* **Add ResNet as embedding model** by @StefanWahl in https://github.com/sbi-dev/sbi/pull/1472 +* **Spectral convolution embedding net** by @L-in-da in https://github.com/sbi-dev/sbi/pull/1503 + +#### Major Features & Capabilities + +* **Unify flow matching and score-based models** by @StarostinV in https://github.com/sbi-dev/sbi/pull/1497 +* **Model misspecification based on MMD** by @coschroeder in https://github.com/sbi-dev/sbi/pull/1502 +* **Marginal estimator log-prob based test for misspecification** by @swag2198 in https://github.com/sbi-dev/sbi/pull/1522 +* **Adding interface for unconditional flow training** by @plcrodrigues in https://github.com/sbi-dev/sbi/pull/1470 +* **Support using trained estimators in Pyro models** by @sethaxen in https://github.com/sbi-dev/sbi/pull/1491 +* **Add util to generate mcmc samples from user defined potential (#1405)** by @hayden-johnson in https://github.com/sbi-dev/sbi/pull/1483 +* **Logit transform** by @anastasiakrouglova in https://github.com/sbi-dev/sbi/pull/1485 + +#### Documentation & Tutorials + +* **Tutorial on new features for score-based methods #1392** by @touronc in https://github.com/sbi-dev/sbi/pull/1489 +* **Docs: Introduce Readthedocs website** by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1463 + +### Bug Fixes + +* z_score correct order in Zuko by @anastasiakrouglova in https://github.com/sbi-dev/sbi/pull/1492 +* Minor fix when moving thetas from GPU to CPU by @famura in https://github.com/sbi-dev/sbi/pull/1515 +* Minor fix while using unconditional density estimator and LRU embedding by @ARna06 in https://github.com/sbi-dev/sbi/pull/1556 +* fix: replace 'in' operator with '==' for proper classifier comparison by @abelaba in https://github.com/sbi-dev/sbi/pull/1550 +* flowmatching condition shape fix by @gmoss13 in https://github.com/sbi-dev/sbi/pull/1584 +* patch for torch bug in tarp, run torch.histogram with cpu-only tensor by @psteinb in https://github.com/sbi-dev/sbi/pull/1596 +* fix failing tarp test by @janfb in https://github.com/sbi-dev/sbi/pull/1628 +* fix: cap max_sampling_batch_size to prevent excessive memory by @janfb in https://github.com/sbi-dev/sbi/pull/1624 +* 1561 computation of denoising posterior precision matrix in jac method score fn iid by @manuelgloeckler in https://github.com/sbi-dev/sbi/pull/1636 +* fix xfail test, fix deprecation warnings by @janfb in https://github.com/sbi-dev/sbi/pull/1642 + +### Maintenance & Improvements + +#### Code Quality & Refactoring + +* Refactoring flow and score matching classes and nets by @manuelgloeckler in https://github.com/sbi-dev/sbi/pull/1544 +* Rename inference trainer classes by @abelaba in https://github.com/sbi-dev/sbi/pull/1605 +* Rename VectorFieldInference to VectorFieldTrainer by @abelaba in https://github.com/sbi-dev/sbi/pull/1614 +* Refactor build_posterior to Eliminate Duplication Across Trainers by @abelaba in https://github.com/sbi-dev/sbi/pull/1610 +* Refactor build posterior method arguments to use Literals by @abelaba in https://github.com/sbi-dev/sbi/pull/1606 +* Refactor build_posterior Posterior Configuration Using Dataclasses by @abelaba in https://github.com/sbi-dev/sbi/pull/1619 +* Use TypeAlias and consistent naming for sbi types by @janfb in https://github.com/sbi-dev/sbi/pull/1637 +* Add protocol for estimator builder by @abelaba in https://github.com/sbi-dev/sbi/pull/1633 +* Improve abc implementation by @janfb in https://github.com/sbi-dev/sbi/pull/1615 + +#### Type Hints & API Improvements + +* fix: add enum for flow options to fix type hints. by @janfb in https://github.com/sbi-dev/sbi/pull/1562 +* fix LC2ST kwarg typing by @janfb in https://github.com/sbi-dev/sbi/pull/1565 +* fix: Update RatioEstimator classifier argument to use a Protocol by @abelaba in https://github.com/sbi-dev/sbi/pull/1582 +* Update append_simulations return type to Self by @abelaba in https://github.com/sbi-dev/sbi/pull/1622 +* Deprecation Warnings for build_posterior stringly typed parameters by @abelaba in https://github.com/sbi-dev/sbi/pull/1627 + +#### Testing & CI/CD + +* Testmon by @manuelgloeckler in https://github.com/sbi-dev/sbi/pull/1452 +* disable testmon for now by @manuelgloeckler in https://github.com/sbi-dev/sbi/pull/1467 +* chore: Use pytest-split plugin in ci workflow by @schroedk in https://github.com/sbi-dev/sbi/pull/1465 +* tests: refactor "not slow" tests to be not so slow by @janfb in https://github.com/sbi-dev/sbi/pull/1495 +* Test for known pytorch distribution transform issue by @dgedon in https://github.com/sbi-dev/sbi/pull/1504 +* xfail scan test on python 3.13 by @manuelgloeckler in https://github.com/sbi-dev/sbi/pull/1533 +* Gpu test for VectorFieldPosterior by @jorobledo in https://github.com/sbi-dev/sbi/pull/1542 +* set vector field iid-tests xfail by @janfb in https://github.com/sbi-dev/sbi/pull/1554 +* Changed the xfail condition for LRU tests with mode='scan' by @famura in https://github.com/sbi-dev/sbi/pull/1552 +* Fix/lru test by @Matthijspals in https://github.com/sbi-dev/sbi/pull/1568 +* refactor sbc funcs and tests by @janfb in https://github.com/sbi-dev/sbi/pull/1578 +* chore: remove testmon, add codecov test analytics by @janfb in https://github.com/sbi-dev/sbi/pull/1592 +* chore: reorder setup steps for Python and uv in CI/CD workflows by @janfb in https://github.com/sbi-dev/sbi/pull/1601 +* Fix/lc2st numpy type fixes by @janfb in https://github.com/sbi-dev/sbi/pull/1613 +* Fix failing CI on main. by @janfb in https://github.com/sbi-dev/sbi/pull/1618 + +#### Documentation & Website + +* Fix tests for new docs by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1475 +* Prevent notebook execution upon doc build by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1477 +* Fix broken links on website by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1480 +* fix: Update documentation folder path by @abelaba in https://github.com/sbi-dev/sbi/pull/1510 +* fix path to contribute.md by @psteinb in https://github.com/sbi-dev/sbi/pull/1507 +* Add utils to docs by @sethaxen in https://github.com/sbi-dev/sbi/pull/1520 +* Update new Readthedocs website by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1519 +* fix broken links on new website by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1538 +* Fixups for new website landing page by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1539 +* Fix: add tutorial page to mkdocs website by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1540 +* Fix broken links in some tutorials by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1541 +* Add examples to documentation by @jorobledo in https://github.com/sbi-dev/sbi/pull/1548 +* docs: Add importance_sampling_parameters to build_posterior docstring. by @abelaba in https://github.com/sbi-dev/sbi/pull/1558 +* Add missing arguments to LikelihoodEstimator and RatioEstimator docstrings. by @abelaba in https://github.com/sbi-dev/sbi/pull/1571 +* Fixups for new RTD website by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1573 +* Tutorial with a more representative training loop by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1574 +* Fixups for rendering of HH tutorial notebook by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1575 +* fix for colors in Hodgkin-Huxley notebook by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1576 +* Add citations to how-to guide by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1579 +* Clarify fullscreen view of applications-explorer by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1580 +* Fixups for the documentation by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1585 +* fixed misrendered bullet list, tested locally by @psteinb in https://github.com/sbi-dev/sbi/pull/1594 +* Improvements to L-C2ST tutorial by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1588 +* docs: Change colortheme in light mode by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1638 + +#### Infrastructure & Dependencies + +* Add uv support by @abelaba in https://github.com/sbi-dev/sbi/pull/1518 +* switch to numfocus code of conduct by @janfb in https://github.com/sbi-dev/sbi/pull/1560 +* Update readme with new JOSS citation by @janfb in https://github.com/sbi-dev/sbi/pull/1564 +* update numfocus code of conduct by @janfb in https://github.com/sbi-dev/sbi/pull/1602 +* Added Apache License reference comments to source files + CI bash script check by @nMaax in https://github.com/sbi-dev/sbi/pull/1599 + +#### User Experience & Warnings + +* Change xfail to skipif as outcome is not consistent by @gmoss13 in https://github.com/sbi-dev/sbi/pull/1487 +* Add warning when using append_simulations with exclude_invalid_x=True by @abelaba in https://github.com/sbi-dev/sbi/pull/1486 +* Batch sampling slow without warning by @dgedon in https://github.com/sbi-dev/sbi/pull/1490 +* Clarify pbar annotation in sample_batched for DirectPosterior by @StefanWahl in https://github.com/sbi-dev/sbi/pull/1493 + +#### GPU Support & Device Handling + +* Prior to(device) by @jorobledo in https://github.com/sbi-dev/sbi/pull/1505 +* posterior.to(device) by @jorobledo in https://github.com/sbi-dev/sbi/pull/1527 + +#### Miscellaneous Improvements + +* ref: update tests, add types and docs to marginal trainer by @janfb in https://github.com/sbi-dev/sbi/pull/1516 +* integrate sbi application eplorer by @lappalainenj in https://github.com/sbi-dev/sbi/pull/1567 +* fix: update notebook references by @emmanuel-ferdman in https://github.com/sbi-dev/sbi/pull/1563 +* Update sbiutils.py to use one-dimensional batch by @vivienr in https://github.com/sbi-dev/sbi/pull/1577 +* fix: remove empty list default argument by @abelaba in https://github.com/sbi-dev/sbi/pull/1608 +* fix: throw exception on unsupported activation function by @emmanuel-ferdman in https://github.com/sbi-dev/sbi/pull/1609 +* fix: resolve logger warnings by @emmanuel-ferdman in https://github.com/sbi-dev/sbi/pull/1598 +* fix paths by @manuelgloeckler in https://github.com/sbi-dev/sbi/pull/1641 + +### New Contributors + +* @abelaba made their first contribution in https://github.com/sbi-dev/sbi/pull/1486 +* @dgedon made their first contribution in https://github.com/sbi-dev/sbi/pull/1490 +* @StefanWahl made their first contribution in https://github.com/sbi-dev/sbi/pull/1493 +* @touronc made their first contribution in https://github.com/sbi-dev/sbi/pull/1489 +* @jorobledo made their first contribution in https://github.com/sbi-dev/sbi/pull/1505 +* @hayden-johnson made their first contribution in https://github.com/sbi-dev/sbi/pull/1483 +* @sethaxen made their first contribution in https://github.com/sbi-dev/sbi/pull/1491 +* @etouron1 made their first contribution in https://github.com/sbi-dev/sbi/pull/1471 +* @Aranka-S made their first contribution in https://github.com/sbi-dev/sbi/pull/1499 +* @swag2198 made their first contribution in https://github.com/sbi-dev/sbi/pull/1522 +* @StarostinV made their first contribution in https://github.com/sbi-dev/sbi/pull/1497 +* @L-in-da made their first contribution in https://github.com/sbi-dev/sbi/pull/1503 +* @NicolasRR made their first contribution in https://github.com/sbi-dev/sbi/pull/1494 +* @vivienr made their first contribution in https://github.com/sbi-dev/sbi/pull/1577 + +**Full Changelog**: https://github.com/sbi-dev/sbi/compare/v0.24.0...v0.25.0 + ## v0.24.0 ### โœจ Highlights diff --git a/sbi/__version__.py b/sbi/__version__.py index 8ccf390be..1dc9a0890 100644 --- a/sbi/__version__.py +++ b/sbi/__version__.py @@ -1,6 +1,6 @@ # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed # under the Apache License Version 2.0, see -VERSION = (0, 24, 0) +VERSION = (0, 25, 0) __version__ = ".".join(map(str, VERSION)) From f7ed9aa07f9fae71f508e87d54df48c2b17e6b55 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 15 Aug 2025 15:44:19 +0200 Subject: [PATCH 2/8] improve headings --- .github/workflows/publish.yml | 2 +- CHANGELOG.md | 34 ++++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 961b12e4d..14415af42 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -71,7 +71,7 @@ jobs: name: python-package-distributions path: dist/ - name: Sign the dists with Sigstore - uses: sigstore/gh-action-sigstore-python@v2.1.1 + uses: sigstore/gh-action-sigstore-python@v3.0.0 with: inputs: >- ./dist/*.tar.gz diff --git a/CHANGELOG.md b/CHANGELOG.md index 1637b839d..7d4216049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,17 @@ # Changelog +# Changelog + ## v0.25.0 -### Highlights +### โœจ Highlights -#### New Inference Methods +#### ๐Ÿš€ New Inference Methods * **MNPE class similar to MNLE** by @dgedon in https://github.com/sbi-dev/sbi/pull/1362 * **Implementing SNPE-B (#199)** by @etouron1 in https://github.com/sbi-dev/sbi/pull/1471 -#### Neural Network Architectures & Embedding Networks +#### ๐Ÿง  Neural Network Architectures & Embedding Networks * **Simple transformer implementation** by @NicolasRR in https://github.com/sbi-dev/sbi/pull/1494 * **Add embedding net that uses 1D causal convolutions (#1459)** by @Aranka-S in https://github.com/sbi-dev/sbi/pull/1499 @@ -17,7 +19,7 @@ * **Add ResNet as embedding model** by @StefanWahl in https://github.com/sbi-dev/sbi/pull/1472 * **Spectral convolution embedding net** by @L-in-da in https://github.com/sbi-dev/sbi/pull/1503 -#### Major Features & Capabilities +#### โญ Major Features & Capabilities * **Unify flow matching and score-based models** by @StarostinV in https://github.com/sbi-dev/sbi/pull/1497 * **Model misspecification based on MMD** by @coschroeder in https://github.com/sbi-dev/sbi/pull/1502 @@ -27,12 +29,12 @@ * **Add util to generate mcmc samples from user defined potential (#1405)** by @hayden-johnson in https://github.com/sbi-dev/sbi/pull/1483 * **Logit transform** by @anastasiakrouglova in https://github.com/sbi-dev/sbi/pull/1485 -#### Documentation & Tutorials +#### ๐Ÿ“š Documentation & Tutorials * **Tutorial on new features for score-based methods #1392** by @touronc in https://github.com/sbi-dev/sbi/pull/1489 * **Docs: Introduce Readthedocs website** by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1463 -### Bug Fixes +### ๐Ÿ› Bug Fixes * z_score correct order in Zuko by @anastasiakrouglova in https://github.com/sbi-dev/sbi/pull/1492 * Minor fix when moving thetas from GPU to CPU by @famura in https://github.com/sbi-dev/sbi/pull/1515 @@ -45,9 +47,9 @@ * 1561 computation of denoising posterior precision matrix in jac method score fn iid by @manuelgloeckler in https://github.com/sbi-dev/sbi/pull/1636 * fix xfail test, fix deprecation warnings by @janfb in https://github.com/sbi-dev/sbi/pull/1642 -### Maintenance & Improvements +### ๐Ÿ› ๏ธ Maintenance & Improvements -#### Code Quality & Refactoring +#### ๐Ÿ”ง Code Quality & Refactoring * Refactoring flow and score matching classes and nets by @manuelgloeckler in https://github.com/sbi-dev/sbi/pull/1544 * Rename inference trainer classes by @abelaba in https://github.com/sbi-dev/sbi/pull/1605 @@ -59,7 +61,7 @@ * Add protocol for estimator builder by @abelaba in https://github.com/sbi-dev/sbi/pull/1633 * Improve abc implementation by @janfb in https://github.com/sbi-dev/sbi/pull/1615 -#### Type Hints & API Improvements +#### ๐Ÿท๏ธ Type Hints & API Improvements * fix: add enum for flow options to fix type hints. by @janfb in https://github.com/sbi-dev/sbi/pull/1562 * fix LC2ST kwarg typing by @janfb in https://github.com/sbi-dev/sbi/pull/1565 @@ -67,7 +69,7 @@ * Update append_simulations return type to Self by @abelaba in https://github.com/sbi-dev/sbi/pull/1622 * Deprecation Warnings for build_posterior stringly typed parameters by @abelaba in https://github.com/sbi-dev/sbi/pull/1627 -#### Testing & CI/CD +#### ๐Ÿงช Testing & CI/CD * Testmon by @manuelgloeckler in https://github.com/sbi-dev/sbi/pull/1452 * disable testmon for now by @manuelgloeckler in https://github.com/sbi-dev/sbi/pull/1467 @@ -85,7 +87,7 @@ * Fix/lc2st numpy type fixes by @janfb in https://github.com/sbi-dev/sbi/pull/1613 * Fix failing CI on main. by @janfb in https://github.com/sbi-dev/sbi/pull/1618 -#### Documentation & Website +#### ๐Ÿ“– Documentation & Website * Fix tests for new docs by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1475 * Prevent notebook execution upon doc build by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1477 @@ -112,7 +114,7 @@ * Improvements to L-C2ST tutorial by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1588 * docs: Change colortheme in light mode by @michaeldeistler in https://github.com/sbi-dev/sbi/pull/1638 -#### Infrastructure & Dependencies +#### ๐Ÿ—๏ธ Infrastructure & Dependencies * Add uv support by @abelaba in https://github.com/sbi-dev/sbi/pull/1518 * switch to numfocus code of conduct by @janfb in https://github.com/sbi-dev/sbi/pull/1560 @@ -120,19 +122,19 @@ * update numfocus code of conduct by @janfb in https://github.com/sbi-dev/sbi/pull/1602 * Added Apache License reference comments to source files + CI bash script check by @nMaax in https://github.com/sbi-dev/sbi/pull/1599 -#### User Experience & Warnings +#### ๐Ÿ‘ฅ User Experience & Warnings * Change xfail to skipif as outcome is not consistent by @gmoss13 in https://github.com/sbi-dev/sbi/pull/1487 * Add warning when using append_simulations with exclude_invalid_x=True by @abelaba in https://github.com/sbi-dev/sbi/pull/1486 * Batch sampling slow without warning by @dgedon in https://github.com/sbi-dev/sbi/pull/1490 * Clarify pbar annotation in sample_batched for DirectPosterior by @StefanWahl in https://github.com/sbi-dev/sbi/pull/1493 -#### GPU Support & Device Handling +#### ๐ŸŽฎ GPU Support & Device Handling * Prior to(device) by @jorobledo in https://github.com/sbi-dev/sbi/pull/1505 * posterior.to(device) by @jorobledo in https://github.com/sbi-dev/sbi/pull/1527 -#### Miscellaneous Improvements +#### ๐Ÿ”ง Miscellaneous Improvements * ref: update tests, add types and docs to marginal trainer by @janfb in https://github.com/sbi-dev/sbi/pull/1516 * integrate sbi application eplorer by @lappalainenj in https://github.com/sbi-dev/sbi/pull/1567 @@ -143,7 +145,7 @@ * fix: resolve logger warnings by @emmanuel-ferdman in https://github.com/sbi-dev/sbi/pull/1598 * fix paths by @manuelgloeckler in https://github.com/sbi-dev/sbi/pull/1641 -### New Contributors +### ๐ŸŽ‰ New Contributors * @abelaba made their first contribution in https://github.com/sbi-dev/sbi/pull/1486 * @dgedon made their first contribution in https://github.com/sbi-dev/sbi/pull/1490 From 200b6fc5eb9faca692f8fd279a3357a19b74b455 Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 16 Aug 2025 12:26:12 +0200 Subject: [PATCH 3/8] update docs building instructions. --- docs/contributing.md | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/docs/contributing.md b/docs/contributing.md index 38d7bb7e5..b63b5400e 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -270,33 +270,27 @@ test suite in `tests/test_bm.py`. ## Contributing to the documentation -Most of the documentation for `sbi` is written in markdown and the website is generated -using `mkdocs` with `mkdocstrings` and `mike`. The tutorials and examples are converted -from jupyter notebooks into markdown files to be shown on the website. To work on -improvements of the documentation, you should first install the `doc` dependencies: +Most of the documentation for `sbi` is written in reStructuredText and the website is +generated using `Sphinx`. The tutorials and examples are Jupyter notebooks that are +automatically converted during the build process. To work on improvements of the +documentation, you should first install the `doc` dependencies: ```bash -pip install -e ".[doc]" +uv sync --extra doc ``` Then, you can build the website locally by executing in the `docs` folder ```bash -mkdocs serve +make html +sphinx-autobuild . _build/html ``` -This will build the website on a local host address shown in the terminal. Changes to -the website files or a browser refresh will immediately rebuild the website. - -If you updated the tutorials or examples, you need to convert them to markdown first: - -```bash -cd docs -jupyter nbconvert --to markdown ../docs/tutorials/*.ipynb --output-dir docs/tutorials/ -jupyter nbconvert --to markdown ../docs/advanced_tutorials/*.ipynb --output-dir docs/tutorials/ -jupyter nbconvert --to markdown ../docs/how_to_guide/09_sampler_interface.ipynb --output-dir docs/tutorials/ -mkdocs serve -``` +The first command will build the website in the `docs/_build/html` directory. The second +command will start a local development server with automatic rebuilding and live reload, so +you can open it in your browser and see changes as you edit. You can skip the first +command if you've already built the documentation before. Changes to the documentation +files will automatically trigger a rebuild and be displayed locally. ### Using AI Coding Assistants From 92a8547a44c0e16c8db5ffc37d1ad911e9a4c029 Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 16 Aug 2025 12:31:36 +0200 Subject: [PATCH 4/8] update installation instructions. --- docs/installation.md | 61 +++++++++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index a960c021c..365460ee0 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,39 +1,64 @@ (installation)= # Installation -`sbi` requires Python 3.10 or higher. A GPU is not required, but can lead to -speed-up in some cases. We recommend using a -[`conda`](https://docs.conda.io/en/latest/miniconda.html) virtual environment -([Miniconda installation -instructions](https://docs.conda.io/en/latest/miniconda.html)). If `conda` is -installed on the system, an environment for installing `sbi` can be created as -follows: - -```console -# Create an environment for sbi (indicate Python 3.10 or higher); activate it -$ conda create -n sbi_env python=3.10 && conda activate sbi_env +`sbi` requires Python 3.10 or higher. We recommend using Python 3.12 for the best +experience. A GPU is not required, but can lead to speed-up in some cases. + +## Recommended: Installation with uv + +We recommend using [`uv`](https://docs.astral.sh/uv) +for package and environment management. If you haven't installed `uv` yet, follow +the [installation instructions](https://docs.astral.sh/uv/getting-started/installation/). + +Create a virtual environment and install `sbi`: + +```bash +# Create a virtual environment with Python 3.12 +uv venv --python 3.12 + +# Activate the environment (on macOS/Linux) +source .venv/bin/activate + +# On Windows +# .venv\Scripts\activate + +# Install sbi +uv pip install sbi ``` -Independent of whether you are using `conda` or not, `sbi` can be installed -using `pip`: +## Alternative installation methods + +### Using pip + +If you prefer using `pip` directly: ```bash python -m pip install sbi ``` -To install and add `sbi` to a project with [`pixi`](https://pixi.sh/), from the project directory run +### Using conda + +To install into a conda environment: ```bash -pixi add sbi +# Create an environment for sbi (Python 3.10 or higher) +conda create -n sbi_env python=3.12 && conda activate sbi_env + +# Install sbi from conda-forge +conda install --channel conda-forge sbi ``` -and to install into a particular conda environment with [`conda`](https://docs.conda.io/projects/conda/), in the activated environment run +### Using pixi + +To install and add `sbi` to a project with [`pixi`](https://pixi.sh/): ```bash -conda install --channel conda-forge sbi +pixi add sbi ``` -To test the installation, drop into a Python prompt and run +## Testing the installation + +To test the installation, drop into a Python prompt and run: ```python from sbi.examples.minimal import simple From 8b3a18d423f8c93d659174f3a464db86105644f8 Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 16 Aug 2025 12:56:34 +0200 Subject: [PATCH 5/8] update contribution guide installation instructions. --- docs/README.md | 20 ++++++++++++++++++-- docs/contributing.md | 39 +++++++++++++-------------------------- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/docs/README.md b/docs/README.md index 8abd7627f..cbea06d9a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,7 +1,23 @@ # Documentation -To build the sphinx documentation, run +## Building and serving the documentation locally + +To build the Sphinx documentation with autoreload (recommended for development): + +```bash +# Install documentation dependencies +uv sync --extra doc + +# Start development server with autoreload +sphinx-autobuild . _build/html ``` + +This will automatically rebuild the documentation when you make changes and serve it locally (usually at `http://127.0.0.1:8000`). + +Alternatively, for a one-time build and simple HTTP server: + +```bash make html && python -m http.server --directory _build/html ``` -This will find all jupyter notebooks, run them, collect the output, and incorporate them into the documentation. + +The autoreload method is recommended as it will find all Jupyter notebooks, run them, collect the output, and incorporate them into the documentation, while automatically rebuilding when you make changes. diff --git a/docs/contributing.md b/docs/contributing.md index b63b5400e..07466933e 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -61,29 +61,19 @@ git clone git@github.com:$USERNAME/sbi.git cd sbi ``` -**Step 4**: Install a recent version of Python (we currently recommend 3.10) -for instance using [`miniforge`](https://github.com/conda-forge/miniforge). We -strongly recommend you create a specific `conda` environment for doing -development on `sbi` as per: +**Step 4**: Set up your development environment. Follow the [installation +instructions](installation.md) to install Python and create a virtual environment with +`uv`. -```bash -conda create -n sbi_dev python=3.10 -conda activate sbi_dev -``` - -**Step 5**: Install `sbi` in editable mode with +**Step 5**: Install `sbi` in editable mode with development dependencies: ```bash -pip install -e ".[dev]" +uv pip install -e ".[dev]" ``` -This installs the `sbi` package into the current environment by creating a -link to the source code directory (instead of copying the code to pipโ€™s `site_packages` -directory, which is what normally happens). This means that any edits you make -to the `sbi` source code will be reflected the next time you open a Python interpreter -and `import sbi` (the `-e` flag of pip stands for an โ€œeditableโ€ installation, -and the `dev` flag installs development and testing dependencies). This requires -at least Python 3.8. +This installs the `sbi` package in editable mode, meaning changes to the source code +will be immediately reflected when you import `sbi`, along with all development and +testing dependencies. **Step 6**: Add the upstream remote. This saves a reference to the main `sbi` repository, which you can use to keep your repository synchronized with the latest @@ -106,7 +96,6 @@ upstream git@github.com:sbi-dev/sbi.git (push) **Step 7**: Install `pre-commit` to run code style checks before each commit: ```bash -pip install pre-commit pre-commit install ``` @@ -279,18 +268,16 @@ documentation, you should first install the `doc` dependencies: uv sync --extra doc ``` -Then, you can build the website locally by executing in the `docs` folder +Then, you can build and serve the website locally by executing in the `docs` folder ```bash -make html sphinx-autobuild . _build/html ``` -The first command will build the website in the `docs/_build/html` directory. The second -command will start a local development server with automatic rebuilding and live reload, so -you can open it in your browser and see changes as you edit. You can skip the first -command if you've already built the documentation before. Changes to the documentation -files will automatically trigger a rebuild and be displayed locally. +This command will automatically build the website and start a local development server with +automatic rebuilding and live reload, so you can open it in your browser and see changes +as you edit. Changes to the documentation files will automatically trigger a rebuild and +be displayed locally. ### Using AI Coding Assistants From d4ca18dfe9c9180fba2fea7fecba94c4621ba30b Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 16 Aug 2025 12:56:56 +0200 Subject: [PATCH 6/8] add warning and new link to old docs. --- mkdocs/docs/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mkdocs/docs/index.md b/mkdocs/docs/index.md index 14d806510..75647d3f9 100644 --- a/mkdocs/docs/index.md +++ b/mkdocs/docs/index.md @@ -1,5 +1,13 @@ # `sbi`: simulation-based inference toolkit +!!! warning "Documentation Moved" + + **This documentation is deprecated.** Please visit our new documentation at: + + **[https://sbi.readthedocs.io/en/latest/](https://sbi.readthedocs.io/en/latest/)** + + The documentation below is no longer maintained and may contain outdated information. + `sbi` is a Python package for simulation-based inference, designed to meet the needs of both researchers and practitioners. Whether you need fine-grained control or an easy-to-use interface, `sbi` has you covered. From 977d6d7d70cc198522247c7e6d594384d035abcb Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 17 Aug 2025 21:11:32 +0200 Subject: [PATCH 7/8] skip fnpe score estimation iid test --- tests/linearGaussian_vector_field_test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/linearGaussian_vector_field_test.py b/tests/linearGaussian_vector_field_test.py index e9e5cc486..b86313fb2 100644 --- a/tests/linearGaussian_vector_field_test.py +++ b/tests/linearGaussian_vector_field_test.py @@ -350,7 +350,12 @@ def test_vector_field_sde_ode_sampling_equivalence(vector_field_trained_model): @pytest.mark.parametrize( "iid_method, num_trial", [ - pytest.param("fnpe", 3, id="fnpe-3trials"), + pytest.param( + "fnpe", + 3, + id="fnpe-3trials", + marks=pytest.mark.skip(reason="fails randomly, see #1646"), + ), pytest.param("gauss", 3, id="gauss-3trials"), pytest.param("auto_gauss", 8, id="auto_gauss-8trials"), pytest.param("auto_gauss", 16, id="auto_gauss-16trials"), From 8ba7edfab115a716ed1f5364740b80bf8f3a5b66 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 18 Aug 2025 13:20:00 +0200 Subject: [PATCH 8/8] fix links in readme. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 27a21089a..e995520d5 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ ## `sbi`: Simulation-Based Inference -[Getting Started](https://sbi-dev.github.io/sbi/latest/tutorials/00_getting_started/) | -[Documentation](https://sbi-dev.github.io/sbi/) | [Discord Server](https://discord.gg/eEeVPSvWKy) +[Getting Started](https://sbi.readthedocs.io/en/latest/tutorials/00_getting_started.html) | +[Documentation](https://sbi.readthedocs.io/en/latest/) | [Discord Server](https://discord.gg/eEeVPSvWKy) `sbi` is a Python package for simulation-based inference, designed to meet the needs of both researchers and practitioners. Whether you need fine-grained control or an