Skip to content

Finish the I-WLS labels: the AOA and TOA examples say what they run - #90

Merged
qmohsu merged 1 commit into
mainfrom
claude/ch4-iwls-labels-aoa-toa
Aug 23, 2026
Merged

Finish the I-WLS labels: the AOA and TOA examples say what they run#90
qmohsu merged 1 commit into
mainfrom
claude/ch4-iwls-labels-aoa-toa

Conversation

@qmohsu

@qmohsu qmohsu commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #87, which relabelled example_tdoa_positioning. The two files left out carried the same defect.

File Claimed Actually runs
example_aoa_positioning "I-WLS" ×14 AOAPositioner(anchors) at all 7 sites, no sigma_* → unweighted
example_toa_positioning docstring: "using Iterative Weighted Least Squares" method="iterative_ls" in 6 of 7 solves

The AOA half needed measuring, not reading

"Uniform weights" is not obviously the same as "unweighted". It is here — a uniform W is a multiple of the identity, so it cancels out of (H' W H)^-1 H' W. Confirmed by solving the same bearings three ways:

no sigma          [2.95136446 6.79821125]
scalar sigma      [2.95136446 6.79821125]   identical: True
per-anchor sigma  [3.34077553 7.18967219]   identical: False

The first two are bit-identical; only a per-anchor sigma moves the answer. So those seven sites are the Eqs. (4.63)-(4.78) solver run unweighted. example_comparison --compare-geometry is the one place in the chapter that supplies a per-anchor sigma, and it keeps the name.

The TOA half is two docstring lines

Its Example 6 was already right: it labels its own comparison "LS" against "WLS" and genuinely passes a covariance to the weighted side — the only iterative_wls in the file. Only the module docstring was wrong.

Verification

Every number in both examples' output is unchanged. I diffed full stdout, not just extracted numbers, after a scare that turned out to be my own regex reading the hyphen in "Eqs. 4.63-4.78" as a minus sign — every remaining difference is a label or a figure path.

Both committed figures are byte-identical, since neither carried the label in a tick or an axis.

510 passed across repo conventions and the --help sweep; 122 passed across ch4, the new sys.path guard, the lint ratchet and console encoding; the pinned README transcript still passes; pyflakes clean.

One thing this exposes

example_toa_positioning's stdout is the transcript pinned in the chapter README, and it did not move — because the wrong label lived only in the module docstring. A pinned transcript is no guard against a mislabelled docstring, and nothing in the suite is. Noted in CLAUDE.md rather than guarded, since the invariant would be a prose claim with no precise form to check.

🤖 Generated with Claude Code

The two files left out of the earlier relabel carried the same defect.
`example_aoa_positioning` built `AOAPositioner(anchors)` at all seven call sites
with no `sigma_*` and then said "I-WLS" fourteen times; `example_toa_positioning`
solves with `method="iterative_ls"` everywhere while its module docstring
claimed "using Iterative Weighted Least Squares (I-WLS)".

The AOA half needed measuring rather than reading, because "uniform weights" is
not obviously the same as "unweighted". It is here: a uniform W is a multiple of
the identity, so it cancels out of (H' W H)^-1 H' W. Confirmed by solving the
same bearings three ways -- no sigma, a scalar sigma, and a per-anchor sigma.
The first two give bit-identical positions and only the third moves the answer,
so those seven sites are the Eqs. (4.63)-(4.78) solver run unweighted.
`example_comparison --compare-geometry` is the one place in the chapter that
supplies a per-anchor sigma, and it keeps the name.

The TOA half is two docstring lines. Its Example 6 was already right: it labels
its own comparison "LS" against "WLS" and genuinely passes a covariance to the
weighted side, which is the only `iterative_wls` in the file.

Every number in both examples' output is unchanged -- verified by diffing full
stdout, not just the numbers, after a scare that turned out to be my own regex
reading the hyphen in "Eqs. 4.63-4.78" as a minus sign. Both committed figures
are byte-identical, since neither carried the label in a tick or an axis.

Worth noting what that means for coverage: `example_toa_positioning`'s stdout is
the transcript pinned in the chapter README, and it did not move, because the
wrong label lived only in the module docstring. A pinned transcript is no guard
against a mislabelled docstring, and nothing here is.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@qmohsu
qmohsu merged commit b050535 into main Aug 23, 2026
1 check 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