Skip to content

Add \ball for the open ball around a center - #438

Merged
d-morrison merged 3 commits into
mainfrom
claude/project-thread-rwplgk
Nov 20, 2026
Merged

d-morrison merged 3 commits into
mainfrom
claude/project-thread-rwplgk

Conversation

@d-morrison

@d-morrison d-morrison commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Ezra · project thread

Why

Ezra asked that the mds local maximizer definition write its condition $\norm{x - x^} < \delta$ as "x is in the δ-radius ball around x".
mds already defines the open ball, but that definition gives it no symbol, and these macros had no ball macro.

What

  • \ball{center}{radius} prints $B_r(\vx)$, braced so that an exponent rises over a tall center.
    \ballsym prints the symbol $B$ alone.
  • interpretations.tsv rows for both, and a regenerated data/symbols-all.csv.
  • A notation-choices.qmd entry, "The open ball".
    It covers our convention, why we use it for neighborhood conditions, and how a ball differs from the coefficient $B$ (\Regcoef).
    It also lists the alternatives $B(\vx, r)$ and $N_r(\vx)$.
  • _tests/ball-exponent.qmd and its markers in tools/check_latex.py.
    The test checks that an exponent after \ball{\frac{a}{b}}{r} rises, and that the radius subscript prints, measured as added width.
    Each check has a control that must fail: an unbraced body must not rise, and a body without the radius must come out missing.

Checks run locally

  • python3 tools/gen_symbols.py --check: passes.
  • tools/check_symbols_mathjax.py: 1219 symbols typeset, 0 failures.
  • python3 tools/check_latex.py with TinyTeX: exit 0.
    ball-exponent.pdf prints BALLEXPRISES, BALLRADIUSPRINTED, RADIUSCTRLMISSING and CTRLSTUCK.
  • cut -f1 interpretations.tsv | sort | uniq -d: no duplicate keys.

Follow-up

Morrison-Lab/mds#866 uses the macro.
It is pinned to this branch, and it will be re-pinned to the merge commit.

🤖 Generated with Claude Code

https://claude.ai/code/session_019xfc9oqRg66ANhcYmtpmq3

mds defines the open ball (vector-calculus.qmd#def-ball) but gives it
no symbol, so its local maximizer and minimizer definitions restate
the ball's inequality (||x - x*|| < delta) instead of naming the set.
\ball{center}{radius} prints B_r(x), so those conditions can read
"x in B_delta(x*)". \ballsym prints the symbol alone.

Adds the interpretations.tsv rows, the regenerated symbols file, a
notation-choices.qmd entry, and a PDF test that an exponent rises over
a tall center and the radius prints as a subscript, with an unbraced
control that must not rise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9oqRg66ANhcYmtpmq3

Copy link
Copy Markdown
Collaborator Author

/review


Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

The review found the depth test cannot pass: the parenthesis already
reaches 2.5pt below the baseline, as deep as the subscript, so the
depth difference is zero. The radius subscript does add width, so
compare widths, and check that a body without the radius reports
missing. Also say how a ball differs from the coefficient B (\Regcoef),
and put one clause per line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9oqRg66ANhcYmtpmq3

Copy link
Copy Markdown
Collaborator Author

/review

Changes in ac93b7f:

  • Radius check: it now compares widths, because the parenthesis already reaches as deep below the baseline as the subscript does. It has a control that must report missing, and locally it printed BALLRADIUSPRINTED, RADIUSCTRLMISSING, BALLEXPRISES and CTRLSTUCK.
  • \Regcoef: the open ball section of notation-choices.qmd now says how a ball differs from the coefficient \Regcoef.
  • Line breaks: the two-clause line is split.

Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@d-morrison

Copy link
Copy Markdown
Collaborator Author

Cross-model review (agy, gemini-4-hydrogen-high) of head ac93b7f:

Summary

PR Morrison-Lab/macros#438 adds \ballsym (B) and \ball{center}{radius} ({\ballsym_{#2}\paren{#1}}) to macros.qmd, registers both in interpretations.tsv, regenerates data/symbols-all.csv, documents the convention in notation-choices.qmd, and adds a LaTeX test (_tests/ball-exponent.qmd and its expected markers in tools/check_latex.py) verifying that exponents rise over tall centers and that the radius subscript adds width, with negative controls for both.

Findings

  1. Content error and PR-description mismatch in notation-choices.qmd (#sec-open-ball-notation):
    • notation-choices.qmd writes:

      Other sources write $B(\vx, r)$ or $B_r(\vx)$,
      and some write $N_r(\vx)$ for a neighborhood.

    • However, \ball{\vx}{r} ({\ballsym_{#2}\paren{#1}}) itself renders as $B_r(\vx)$. Listing $B_r(\vx)$ under "Other sources write ..." presents the repo's own convention as an external alternative, and directly mismatches the PR description ("It also lists the alternatives $B(\vx, r)$ and $N_r(\vx)$."), which omits $B_r(\vx)$ from the alternatives.

Verdict

VERDICT: NOT CLEAN

Reviewed-Commit: ac93b7f

Posted by Claude Code (AI agent) --- not written by a human.

\ball prints B_r(x), so listing it under "other sources write" presented
our convention as an outside alternative (agy review on macros#438).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9oqRg66ANhcYmtpmq3

Copy link
Copy Markdown
Collaborator Author

/review

I addressed the agy finding in b2be0ad. notation-choices.qmd no longer lists $B_r(\vx)$, the form \ball prints, under "Other sources write". The alternatives are now $B(\vx, r)$ and $N_r(\vx)$, which matches the PR description.


Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

👀 Claude Review Dispatched — run reviewing PR #438 at b2be0ad.

@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


I reviewed the one commit added since the last round, b2be0ad. It changes one line in notation-choices.qmd. It drops $B_r(\vx)$ from the list of other sources' notation for a ball.

The edit is correct and needs no further change.

  • Accuracy: B_r(\vx) is the form this PR's own \ball macro prints. It no longer belongs in a list of other conventions.
  • Grammar: the sentence now reads "Other sources write $B(\vx, r)$, and some write $N_r(\vx)$ for a neighborhood." The comma and the following clause are still grammatical.
  • Math macros: the edit adds no math, only removes it. No macro check is needed.
  • Prose rules: the changed line holds one clause and breaks correctly, so the semantic line-break rule is met.
  • Not run: I did not compile or run tools/check_latex.py here. This commit touches no macro, test or CSV file, so data/symbols-all.csv and the PDF test are unaffected.

My earlier verdict still stands: the 2026-11-20 review of ac93b7f found no blocking issues. That verdict assumed the check-latex job passes, since that job is the first real compile of the width-based radius test. This commit does not change that dependency.

Verdict

Ready for merge, assuming the check-latex job passes on this head.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "b2be0adbf612f270926012626ef8b05aa93fd702",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "The only change since the last round is one line in notation-choices.qmd that removes B_r(x) from the other-sources list, which is accurate and grammatical.",
  "holistic_assessment": "The prior CLEAN verdict on ac93b7f still stands; this docs-only edit touches no macro, test or CSV, and the remaining risk is the CI check-latex job being the first compile of the width test."
}

Reviewed commit: b2be0ad

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $0.1822 (review) — run

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2
🚀 Preview available at: https://Morrison-Lab.github.io/macros/pr-preview/pr-438/

Built to branch gh-pages at 2026-11-20 09:42 UTC.

@d-morrison

Copy link
Copy Markdown
Collaborator Author

Cross-model review (agy, gemini-4-hydrogen-high) of head b2be0ad:

Summary

PR Morrison-Lab/macros#438 adds \ballsym (B) and \ball{center}{radius} ({\ballsym_{#2}\paren{#1}}) to macros.qmd, adds entries for both to interpretations.tsv, updates data/symbols-all.csv, documents the convention in notation-choices.qmd (#sec-open-ball-notation), and adds _tests/ball-exponent.qmd along with its expected markers in tools/check_latex.py.

The earlier agy review's finding is resolved: notation-choices.qmd now lists only $B(\vx, r)$ and $N_r(\vx)$ as alternative notations used by other sources, no longer listing the repository's own $B_r(\vx)$ convention as an external alternative, and now matches the PR description. No new defects were found.

Findings

None.

Verdict

VERDICT: CLEAN

Reviewed-Commit: b2be0ad

Posted by Claude Code (AI agent) --- not written by a human.

@d-morrison

Copy link
Copy Markdown
Collaborator Author

Annotation dispositions for head b2be0ad:

Check runs 136207817435,136207813265,136207812911:

  • Node.js 20 is deprecated (warnings, 3): GitHub's runner notice about pinned actions. It isn't a defect in this PR.

Posted by Claude Code (AI agent) --- not written by a human.

@d-morrison
d-morrison merged commit f221480 into main Nov 20, 2026
17 checks passed
@d-morrison
d-morrison deleted the claude/project-thread-rwplgk branch November 20, 2026 09:45
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.

2 participants