Repository navigation
Trim three long comment blocks moved to notes/code_history/ - #58
Merged
Merged
Conversation
The 2026-08-24 convention is that R/ reads as code, with one or two lines above each block saying what it does, and the long explanation living in notes/code_history/<file>.md. Three blocks I added since then did not follow it: the DOMAIN_PENALTY_PER_OBS sweep tables (24 lines), the tHN domain-guard rationale (10), and the vcov() bhhh reasoning (6). Comments only -- stripping ## lines leaves all three files byte-identical to main, and the suite is unchanged (FAIL 0 | PASS 5417, same counts as main). The prose was written into notes/code_history/ FIRST, so no pointer here lands on a file that does not discuss its topic: - data.processing.md gains the DOMAIN_PENALTY_PER_OBS section (both sweeps, and why the penalty is per observation rather than a total). - sfareg_methods.md gains the bhhh-recommendation section; it had no entry for this at all. - sfm.md's A56a section had a stale DOMAIN_PENALTY = 1e6 line, corrected to DOMAIN_PENALTY_PER_OBS = 1e4. R/sfm.R's block also pointed at .SFA_CONSTANTS$DOMAIN_PENALTY, a name that stopped existing when A56a renamed it; that pointer is gone. Scoped to blocks I wrote. The long file headers in mundlak.R, lcsfm_homogeneity.R and matrix_utils.R predate the convention and are a larger, more opinionated change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
A comments-only change restoring the 2026-08-24 convention in three places
where I broke it:
R/reads as code, with one or two lines above each blocksaying what it does, and the long explanation lives in
notes/code_history/<file>.md(outside the package, so it reaches neither theCRAN tarball nor this repo).
R/data.processing.RR/sfm.RR/sfareg_methods.RNet 28 fewer comment lines.
Why it is safe
Comments only. Stripping
##lines from all three files leaves thembyte-identical to
main(verified by md5 of the stripped files). The fullsuite is
FAIL 0 | WARN 43 | SKIP 8 | PASS 5417-- the same counts asmain.No
NEWS.mdentry: nothing a user can observe changed.The prose was written first
A short comment pointing at a file that does not discuss the topic is worse
than a long comment, so each note section went in before the corresponding
trim:
data.processing.mdgains aDOMAIN_PENALTY_PER_OBSsection carrying bothsweeps -- the five-tHN sweep over penalty magnitude, and the sweep across
nthat is the reason the penalty is per observation rather than a fixedtotal (a fixed total keeps its margin only while
nis small).sfareg_methods.mdgains a bhhh-recommendation section. It had no entryfor this; trimming the source first would have left a dangling pointer.
sfm.md's A56a section saidDOMAIN_PENALTY = 1e6. That is stale twiceover -- wrong name and wrong value -- and is corrected to
DOMAIN_PENALTY_PER_OBS = 1e4.All three pointers were then checked to resolve to files that mention their
topic.
One real defect fixed in passing
R/sfm.R's block ended by referring the reader to.SFA_CONSTANTS$DOMAIN_PENALTY"for the sweep behind this value". That namestopped existing when A56a renamed it to
DOMAIN_PENALTY_PER_OBS, so thecomment two lines above the correct name sent the reader to a constant that is
not defined anywhere. Removed.
Scope
Deliberately limited to blocks I wrote after the convention was adopted. The
long file headers that predate it --
mundlak.R(37 lines),lcsfm_homogeneity.R(36),matrix_utils.R(34/28/26/26) -- are a larger andmore opinionated change, and are left alone.
🤖 Generated with Claude Code