Skip to content

fix(docs): escape absolute-value bars that RST misread as substitutions (v3.1.0 docs deploy) - #313

Merged
ofloveandhate merged 1 commit into
developfrom
fix/docstring-rst-pipe-substitutions
Jul 9, 2026
Merged

fix(docs): escape absolute-value bars that RST misread as substitutions (v3.1.0 docs deploy)#313
ofloveandhate merged 1 commit into
developfrom
fix/docstring-rst-pipe-substitutions

Conversation

@ofloveandhate

Copy link
Copy Markdown
Contributor

The v3.1.0 versioned-docs deploy failed. build_docs.yml runs sphinx-build -b html -W
(warnings-as-errors), and three docstrings wrote absolute-value / norm notation with bare pipes:

ERROR: Undefined substitution referenced: "p_i - q_i"  — bertini.multiprec.is_distinct_up_to
ERROR: Undefined substitution referenced: "p_i - q_i"  — bertini.is_distinct_up_to  (top-level re-export)
ERROR: Undefined substitution referenced: "imag"        — bertini.operators.is_real

In reStructuredText |word| is a substitution reference, so Sphinx tried to resolve undefined
substitutions p_i - q_i and imag and errored out. is_distinct_up_to (#305) and is_real (#306)
both landed in the 3.1.0 line.

Fix

Reword the two source strings to abs(...)max_i abs(p_i - q_i) and abs(imag) < tol — which
read cleanly in Sphinx HTML and plain help() and carry no RST metacharacters. The other |…|
docstrings in the tree are already safe (wrapped in inline literals or inside code blocks) and
are left untouched.

Not a package problem

Docstrings only — the released wheels are unaffected. 3.1.0 is already on PyPI and the GitHub
Release is published
; only the docs-site deploy failed.

Verified

Reproduced the exact failing command locally (sphinx-build -b html -W --keep-going): now
build succeeded, zero substitution errors.

Root-cause note (for the post-3.1.0 CI pass)

The -b html -W build runs only at docs-deploy time, not in PR CI (PR CI runs -b doctest,
which passed). So this whole class of RST/docstring error is invisible until release. Running the
-W html build in PR CI would have caught it — worth adding alongside #312.

…substitutions

The versioned-docs deploy (build_docs.yml runs `sphinx-build -b html -W`) failed on the
v3.1.0 release: three docstrings wrote absolute-value/norm notation with bare pipes --
`max_i |p_i - q_i|` (is_distinct_up_to, surfaced twice: multiprec + top-level re-export) and
`|imag| < tol` (operators.is_real). In reStructuredText `|word|` is a *substitution reference*,
so Sphinx tried to resolve undefined substitutions "p_i - q_i" and "imag" and errored; with
-W (warnings-as-errors) the docs build died.

Reword both to `abs(...)`, which reads cleanly in Sphinx HTML and plain help() and carries no
RST metacharacters. (The other |...| docstrings in the tree are already safe -- wrapped in
``inline literals`` or inside code blocks -- so they are left as-is.)

This did not affect the released wheels (docstrings only): 3.1.0 is on PyPI and the GitHub
Release is published; only the docs site deploy failed. Verified locally by reproducing the
exact failing command (sphinx-build -b html -W --keep-going) -- now 'build succeeded', no
substitution errors.

Escapes surfaced because the -W html build runs only at docs-deploy time, not in PR CI.
@ofloveandhate
ofloveandhate merged commit dcba24c into develop Jul 9, 2026
13 of 17 checks passed
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