Skip to content

Update new Readthedocs website - #1519

Merged
michaeldeistler merged 1 commit into
mainfrom
docsorg
Mar 26, 2025
Merged

michaeldeistler merged 1 commit into
mainfrom
docsorg

Conversation

@michaeldeistler

@michaeldeistler michaeldeistler commented Mar 21, 2025 •

Copy link
Copy Markdown
Contributor

Update new documentation

  • more details in API reference
  • how-to guide
  • advanced tutorials

TODO:

  • more high-level FAQ: "What methods are implented", "Do I need a Python simulator",...
  • better looking "boxes" on landing page.
  • fix sphinx build errors
  • add brief citations to all how-to guides

@michaeldeistler
michaeldeistler force-pushed the docsorg branch 2 times, most recently from b5491bb to 9b34b82 Compare March 21, 2025 11:15
@michaeldeistler michaeldeistler changed the title Docsorg Update new Readthedocs website Mar 25, 2025
@michaeldeistler
michaeldeistler force-pushed the docsorg branch 4 times, most recently from 6ed9616 to 6e195bb Compare March 26, 2025 13:15
@codecov

codecov Bot commented Mar 26, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.57%. Comparing base (8900ca0) to head (56a2271).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1519      +/-   ##
==========================================
- Coverage   89.45%   79.57%   -9.89%     
==========================================
  Files         128      133       +5     
  Lines       10170    10210      +40     
==========================================
- Hits         9098     8125     -973     
- Misses       1072     2085    +1013     
Flag Coverage Δ
unittests 79.57% <100.00%> (-9.89%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sbi/analysis/__init__.py 100.00% <100.00%> (ø)
sbi/diagnostics/__init__.py 100.00% <100.00%> (ø)
sbi/diagnostics/sbc.py 92.95% <ø> (ø)
sbi/inference/__init__.py 100.00% <100.00%> (ø)
sbi/inference/abc/__init__.py 100.00% <100.00%> (ø)
sbi/inference/posteriors/__init__.py 100.00% <100.00%> (ø)
sbi/inference/posteriors/base_posterior.py 85.18% <ø> (-2.47%) ⬇️
sbi/inference/posteriors/direct_posterior.py 96.66% <ø> (ø)
sbi/inference/posteriors/importance_posterior.py 86.15% <ø> (ø)
sbi/inference/posteriors/mcmc_posterior.py 84.72% <ø> (-3.13%) ⬇️
... and 25 more

... and 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@michaeldeistler
michaeldeistler force-pushed the docsorg branch 4 times, most recently from a42c968 to 85cf5c5 Compare March 26, 2025 15:28
@michaeldeistler
michaeldeistler requested a review from janfb March 26, 2025 15:30
@michaeldeistler
michaeldeistler merged commit f83f788 into main Mar 26, 2025
@michaeldeistler
michaeldeistler deleted the docsorg branch March 26, 2025 15:47
janfb added a commit that referenced this pull request Jul 31, 2026
#1961)

* remove the legacy mkdocs site

Sphinx on readthedocs has been canonical since #1519. The mkdocs CI and
dependencies went in #1831. This removes the tracked mkdocs/ tree and the
stale build-dir entry in .gitignore.

* point the remaining links at readthedocs

The old GitHub Pages domain serves a frozen v0.25.0 build. This rewrites
the PyPI documentation URL, 16 README links, two links in the simple
interface, one tutorial link, and the proposals path. The mkdocstrings
reference anchors map to the Sphinx autosummary pages.

* fix codemeta.json: readthedocs link and invalid Person entry

The last Person entry had a bare ORCID string without the '@id' key, so
the file was not valid JSON.

* keep the sbi and BMBF logos in the Sphinx static tree

The two SVGs only ever lived under mkdocs/docs/static/, so retiring that tree
removed them. docs/logo.png survives for html_logo, but the vector master and the
BMBF funding logo had no other copy.

Move both into docs/_static/ and reference the BMBF logo from the Support section
of docs/credits.md, where the text acknowledgment already sits. The mkdocs credits
page carried the same image.

---------

Co-authored-by: Jan <[email protected]>
janfb added a commit to pawank925/sbi that referenced this pull request Aug 17, 2026
Builds on @pawank925's commit.

- Replace the absolute readthedocs URLs in the reStructuredText pages with
  `:doc:` roles. Sphinx resolves those at build time and warns when a
  target moves, which is what the dead `sbi.html` link needed. Six notebook
  cells used the same dead target and now point at api_reference.html. The
  notebooks keep absolute URLs, because readers also open them on GitHub
  and in Colab, where MyST roles do not render.
- Give the estimators their own page. Each section of the landing page
  pairs with a page in the toctree. The entries went into
  `api_reference/neural_nets`, so the sidebar filed the classes under
  "Neural nets". Also add `ConditionalVectorFieldEstimator`, which is the
  base class of the score and flow matching estimators and the type that
  `vector_field_estimator_based_potential` takes, plus
  `FlowMatchingEstimator` and `MixedDensityEstimator` for the FMPE, MNLE
  and MNPE methods that the Training section already lists.
- Fix the FAQ page that becomes visible with the toctree entry. The code
  sample was missing a comma and raised a SyntaxError. The title was not
  phrased as a question like the other entries. The first sentence assumed
  the reader arrived from the leakage entry. The page also described the
  transform as zuko-only, although `mdn` supports it. Renumber the file to
  04, because questions 04 to 07 went away in sbi-dev#1519.
janfb added a commit that referenced this pull request Aug 17, 2026
…gs (#1990)

* docs: fix broken links, orphaned FAQ page, and add estimator API reference

* docs: finish the #1982 documentation fixes

Builds on @pawank925's commit.

- Replace the absolute readthedocs URLs in the reStructuredText pages with
  `:doc:` roles. Sphinx resolves those at build time and warns when a
  target moves, which is what the dead `sbi.html` link needed. Six notebook
  cells used the same dead target and now point at api_reference.html. The
  notebooks keep absolute URLs, because readers also open them on GitHub
  and in Colab, where MyST roles do not render.
- Give the estimators their own page. Each section of the landing page
  pairs with a page in the toctree. The entries went into
  `api_reference/neural_nets`, so the sidebar filed the classes under
  "Neural nets". Also add `ConditionalVectorFieldEstimator`, which is the
  base class of the score and flow matching estimators and the type that
  `vector_field_estimator_based_potential` takes, plus
  `FlowMatchingEstimator` and `MixedDensityEstimator` for the FMPE, MNLE
  and MNPE methods that the Training section already lists.
- Fix the FAQ page that becomes visible with the toctree entry. The code
  sample was missing a comma and raised a SyntaxError. The title was not
  phrased as a question like the other entries. The first sentence assumed
  the reader arrived from the leakage entry. The page also described the
  transform as zuko-only, although `mdn` supports it. Renumber the file to
  04, because questions 04 to 07 went away in #1519.

* fix: correct the transform_to_unconstrained message and docstrings

`build_mdn` has supported `z_score_x="transform_to_unconstrained"` since
#1888, which shipped in 0.27.0, but the error from the nflows builders
still sent users to the zuko models only. Name `mdn` as well, and correct
the same claim in the guard's docstring. The message stays as it is for the
classifier, vector field and unconditional builders, which never named an
alternative model.

Documenting the estimator classes also turns on RST parsing for docstrings
that nothing parsed before. That surfaced 19 warnings: shape tuples such as
`(sample_dim, batch_dim, *input_shape)` without backticks, display
equations indented below the prose, and two footnotes with no citation in
the class docstring. The SDE in `ConditionalScoreEstimator` rendered glued
to the sentence before it and is now a `.. math::` block. The branch builds
with 56 warnings, one fewer than main.

No control flow changes. The only runtime change is the error message.

* fix: render the mean_t and std_t maths instead of a MathJax error

MathJax rejects an underscore inside `\text{}`. `\text{mean_t}` therefore
printed "'_' allowed only in math mode" where the equation should be. Write
the subscript properly, as `\text{mean}_t`.

Five of the seven were already in `mean_t_fn` and `std_t_fn` in `base.py`.
Nothing rendered those docstrings before this branch documented the
estimator classes, so the broken output was invisible. The other two are in
`ConditionalScoreEstimator`, where the previous commit moved two plain-text
equations into `.. math::` blocks. As plain text the underscores were
harmless; as maths they were not.

Sphinx reports no warning for this, because it is MathJax that rejects the
TeX in the browser. Checked with a browser: both display equations on the
ConditionalScoreEstimator page typeset, and none of the seven estimator
pages has a MathJax error.

* docs: correct the estimator docstring contracts and equations

Follows a CodeRabbit review. All five findings were valid. Three are older
mistakes in docstrings that this branch renders for the first time. Two are
in text this branch added.

- `combine_theta_and_x` and `unnormalized_log_ratio` documented `theta` with
  a sample dimension and `x` without one. `_get_shape_prefix` compares the
  two prefixes exactly and states that it does not broadcast, so the
  documented shapes raise a `ValueError`. Document the contract that the
  code enforces.
- The perturbation kernel read `N(mean_t, std_t)` in `mean_t_fn` and
  `N(mean_t, std_t^2)` in `std_fn`. `std_fn` returns a standard deviation,
  and the marginal variance adds `std_fn(t)**2`, so the variance form is the
  correct one. Use it in both, and in the SDE marginal.
- The flow matching score equations subtracted `\theta_0`, but `score()`
  subtracts `input`, which is `\theta_t`. Substituting the interpolation
  into the code gives `-\theta_1/t`, the score of `p(\theta_t|\theta_0)`, so
  the code is right and the symbol was wrong.
- The FAQ example used `prior` without defining it. Define it, so the
  example runs as it is.
- The FAQ claimed the transform works with the `zuko_*` estimators. The
  unconditional (marginal) zuko builder rejects it, so limit the claim to
  the conditional ones.

---------

Co-authored-by: Jan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant