Skip to content

Fix broken VAE notebook link in README.rst (#308)#469

Open
jbbqqf wants to merge 1 commit into
interpretml:mainfrom
jbbqqf:fix/308-readme-vae-link
Open

Fix broken VAE notebook link in README.rst (#308)#469
jbbqqf wants to merge 1 commit into
interpretml:mainfrom
jbbqqf:fix/308-readme-vae-link

Conversation

@jbbqqf
Copy link
Copy Markdown

@jbbqqf jbbqqf commented May 9, 2026

Summary

The BaseVAE notebook URL in README.rst points at
docs/notebooks/DiCE_getting_started_feasible.ipynb, but the actual on-disk
path is docs/source/notebooks/DiCE_getting_started_feasible.ipynb. As
@reilankoba reported in #308, the link has been 404 for users since the
docs/source/ reorganisation.

Why

Two changes:

  1. Fix: correct the URL path in README.rst (insert the missing source/
    segment).
  2. Regression guard: add tests/test_readme_links.py that scans every
    https://github.com/interpretml/DiCE/blob/<ref>/<path>.ipynb URL in
    README.rst and asserts each path resolves to a real file under the
    working tree. No network access — purely an in-repo path check. This
    stops future folder renames from silently 404-ing notebook links.

Reproduce BEFORE/AFTER yourself (copy-paste)

set -e
cd /tmp && rm -rf DiCE-308 && git clone https://github.com/interpretml/DiCE.git DiCE-308
cd DiCE-308

# Apply the new test to both refs (it's a new file)
git fetch https://github.com/jbbqqf/DiCE.git fix/308-readme-vae-link
git checkout FETCH_HEAD -- tests/test_readme_links.py
pip install -q -e . pytest

# --- BEFORE: README.rst from origin/main ---
git checkout origin/main -- README.rst
python -m pytest tests/test_readme_links.py::test_readme_notebook_links_resolve -q || echo \"BEFORE: FAIL (expected)\"
# Expected: AssertionError listing 'docs/notebooks/DiCE_getting_started_feasible.ipynb'

# --- AFTER: README.rst from this PR ---
git checkout FETCH_HEAD -- README.rst
python -m pytest tests/test_readme_links.py -q
# Expected: 2 passed

What I ran locally

  • pytest tests/test_readme_links.py2 passed on this branch
  • Test fails on origin/main README with the expected missing-path message
  • Verified all 7 in-repo notebook URLs in README.rst now resolve

Edge cases

case behaviour
README link points to a file under docs/source/notebooks/ passes
README link points to a non-existent path test fails with the missing path printed
External URL (e.g. arxiv.org, mybinder.org) not matched — only GitHub blob URLs are checked
Notebook moved without README update test fails — exactly the regression we want to catch

AI disclosure

This change was prepared with the assistance of Claude (Anthropic).
The author reviewed every line and is responsible for the final result.

The BaseVAE notebook URL in README.rst pointed at
`docs/notebooks/DiCE_getting_started_feasible.ipynb`, but the actual
on-disk path is `docs/source/notebooks/DiCE_getting_started_feasible.ipynb`.
The link has 404'd for users following the README ever since the
`docs/source/` reorganisation.

Adds `tests/test_readme_links.py` which scans every
`https://github.com/interpretml/DiCE/blob/<ref>/<path>.ipynb` URL in
README.rst and asserts it resolves to a real file in the repo. Only
checks in-repo paths — no network access. This prevents future
README/folder-rename drift from re-introducing 404 links.

Closes interpretml#308.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant