Skip to content

docs: rename demo notebooks to descriptive slugs (#840)#861

Open
anevolbap wants to merge 4 commits intopymc-labs:mainfrom
anevolbap:issue-840-notebook-slug-seo
Open

docs: rename demo notebooks to descriptive slugs (#840)#861
anevolbap wants to merge 4 commits intopymc-labs:mainfrom
anevolbap:issue-840-notebook-slug-seo

Conversation

@anevolbap
Copy link
Copy Markdown
Contributor

@anevolbap anevolbap commented Apr 20, 2026

Rename demo notebooks to descriptive slugs

Fixes #840.

Summary

  • Rename all 31 demo notebooks from abbreviated snake_case (its_pymc, rd_skl, ...) to descriptive hyphen-separated slugs (interrupted-time-series-pymc, regression-discontinuity-sklearn, ...).
  • Preserve every legacy URL via sphinxext-rediraffe.
  • Update AGENTS.md naming policy, toctree, CI skip-list, and internal cross-references.

Why

Search engines treat underscores as a single token, so its_pymc is indexed as an opaque string. Descriptive, hyphen-separated slugs tokenize into words that match real queries ("interrupted time series python", "regression discontinuity pymc"). Rediraffe keeps old URLs working.

Commits

  1. docs: update notebook naming policy in AGENTS.md
  2. docs: rename demo notebooks to descriptive hyphen-case slugs — 31 renames via git mv (history preserved), plus index.md,skip_notebooks.yml, and three notebook cross-references (custom_pymc_models.ipynb, panel-fixed-effects.ipynb, inverse-propensity-latent.ipynb).
  3. docs: preserve legacy notebook URLs with sphinxext-rediraffe — add the extension to the docs extras and a 31-entry redirect map in conf.py.

Testing

  • Redirect-map check: every target .ipynb exists, no old-slug files remain, every current notebook has exactly one redirect entry.
  • prek run --files <changed-files> passes.
  • Notebook schema validation passes for the three edited notebooks.
  • Full sphinx-build not executed locally (docs env needs rebuilding against current Sphinx). CI will exercise the redirect generation.

Checklist

  • All old filenames have a redirect entry.
  • All internal references use new slugs.
  • AGENTS.md naming policy updated.
  • sphinxext-rediraffe in pyproject.toml docs extras.
  • CI docs build succeeds.
  • RTD PR preview: old URL like notebooks/its_pymc.html redirects.

Require lowercase hyphen-separated filenames with method names spelled
out in full, and document that renames must add a rediraffe redirect.
Rename all 31 demo notebooks from abbreviated snake_case (its_pymc,
rd_skl, ...) to descriptive hyphen-separated names
(interrupted-time-series-pymc, regression-discontinuity-sklearn, ...)
for better SEO and readability. Update the toctree in index.md, the
CI skip-list, and three internal cross-references (in
custom_pymc_models.ipynb, panel-fixed-effects.ipynb, and
inverse-propensity-latent.ipynb) to the new filenames.

Legacy URLs are preserved in a separate commit via sphinxext-rediraffe.

Refs pymc-labs#840.
Add sphinxext-rediraffe to the docs extras and configure a 31-entry
rediraffe_redirects map in conf.py so old notebook URLs
(e.g. notebooks/its_pymc.html) redirect to the new descriptive slugs.
Protects social-media and blog links that point at the historical URLs.

Refs pymc-labs#840.
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@anevolbap anevolbap marked this pull request as draft April 20, 2026 20:40
@drbenvincent
Copy link
Copy Markdown
Collaborator

This PR's failing test (3.11) / test (3.14) jobs are caused by test_panel_regression_plot_unit_effects (TypeError: only 0-dimensional arrays can be converted to Python scalars), which was fixed in #853 (now merged to main). Updating this branch from main should turn CI green — no code changes needed here.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.59%. Comparing base (deb8774) to head (7acf98b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #861      +/-   ##
==========================================
- Coverage   94.60%   94.59%   -0.02%     
==========================================
  Files          80       80              
  Lines       12764    12764              
  Branches      770      770              
==========================================
- Hits        12076    12074       -2     
- Misses        485      486       +1     
- Partials      203      204       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@anevolbap anevolbap marked this pull request as ready for review April 25, 2026 19:57
@anevolbap
Copy link
Copy Markdown
Contributor Author

anevolbap commented Apr 25, 2026

@drbenvincent this is ready for review. CI is green after merging main (your panel_regression test failure note is resolved by #853).

Quickest way to validate the redirects: open an old-slug URL on the RTD preview, e.g. https://causalpy--861.org.readthedocs.build/en/861/notebooks/its_pymc.html. It should redirect to interrupted-time-series-pymc.html. The full 31-entry redirect map lives in docs/source/conf.py.

For the notebook-heavy diff, the ReviewNB link above gives a cell-aware view. Thanks!

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.

Explore any SEO benefit from better url slugs for demo notebooks

2 participants