Skip to content

docs: make executed examples deterministic and figures accessible - #1503

Draft
s3alfisc wants to merge 2 commits into
masterfrom
docs/deterministic-examples
Draft

docs: make executed examples deterministic and figures accessible#1503
s3alfisc wants to merge 2 commits into
masterfrom
docs/deterministic-examples

Conversation

@s3alfisc

@s3alfisc s3alfisc commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

Executed documentation pages now render the same numbers on every build, and every figure carries a text description. poisson-glm.qmd derived fixed effects from hash() of string labels, which changes with Python's per-process hash seed; the changelog ran decompose(), confint(joint=True), and ccv() unseeded and printed wall-clock timings into the page; several figures were raw <img> wrappers or empty ![]() links. Markdown alt text is used where a visible caption is wanted, fig-alt where it is not. Independent of the other documentation branches. docs/_freeze/** is regenerated for the re-rendered pages; several were stale (one still reported pyfixest 0.40.1), so the results also absorb drift already on master.

Verification

git diff --check; docs-build; individual renders of the six touched pages plus the Feiv reference page, inspected for images, tables, and errors; ruff-check/ruff-format on feiv_.py; pytest tests/test_iv.py (60 passed, 6 skipped: R ivDiag absent locally). Seeded examples verified byte-identical across processes. Full docs-render deferred to CI.

Documentation pages that Quarto executes produced different numbers on
every render. `poisson-glm.qmd` derived fixed effects from `hash()` of
string labels, which varies with Python's per-process hash seed. The
changelog drew decomposition weights without a generator, ran
`decompose()`, `confint(joint=True)` and `ccv()` without seeds, and
printed wall-clock benchmark timings into the page.

Seed the random paths, index the fixed effects by position, and hide the
benchmark cell's timing output while keeping the `etable` comparison that
backs the performance claim. `replicating-the-effect.qmd` now copies the
filtered frame so the page no longer renders a `SettingWithCopyWarning`,
and the `IV_Diag` docstring example carries an explicit cell label so its
generated reference page keeps a stable anchor.

Freeze results are regenerated for the three executed pages.
Most figures shipped with no description at all: the benchmark plots in
`difficult-fixed-effects.md` sat in raw `<p align="center"><img>` wrappers
with a separate italic caption underneath, and the logos and the quantreg
benchmark used empty `![]()`. Only `bench_readme.png` carried an `alt`
attribute.

Where a figure wants a visible caption, use Markdown alt text, which Quarto
renders as the caption: `difficult-fixed-effects.md` and the quantreg
benchmark now fold their italic caption paragraphs into that position, so
each figure has exactly one caption, and width and alignment go through
Quarto's figure handling instead of inline HTML. Where a figure wants no
caption - the logos, the README benchmark, and the changelog benchmark that
already has an italic caption - use `fig-alt`, which sets a real `alt`
attribute and adds nothing visible. The README keeps its raw `<img>` for the
funder badge, which GitHub sizes, and gains an `alt` attribute there.

Freeze results are regenerated for the two executed pages.
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
core-tests 77.22% <ø> (ø)
test-r-core-other 47.88% <ø> (ø)
test-r-extended 22.12% <ø> (ø)
test-r-fixest 38.63% <ø> (?)
tests-extended ?

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

Files with missing lines Coverage Δ
pyfixest/estimation/models/feiv_.py 87.50% <ø> (+2.67%) ⬆️

... and 10 files with indirect coverage changes

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

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