Skip to content

Fix stale amica15.f90 line citations in comments - #259

Merged
neuromechanist merged 1 commit into
devfrom
fix-fortran-citations
Aug 23, 2026
Merged

neuromechanist merged 1 commit into
devfrom
fix-fortran-citations

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

Comment/docstring-only cleanup: no code or test logic changed, only amica15.f90:<line> citations in comments and docstrings.

Reviewers found many amica15.f90:<line> citations across the codebase had drifted off by roughly 18-20 lines from the actual pamica/amica15.f90 in this repo (and a few by more, in the write_output/rejection-handling region near lines 900-3700).
Every citation was enumerated with grep -rn "amica15.f90:" pamica/ docs/ --include="*.py" --include="*.md", the surrounding code was read to identify the Fortran construct being cited, and the true line was located in pamica/amica15.f90 with sed -n/grep -n.
Citations that already pointed at the right line were left untouched; only the wrong ones were corrected.

Notable corrections

  • The stop-loop block (if (iter > 1), the LL-decrease branch, use_min_dll, use_grad_norm) was already correct at 1051/1058/1078-1090/1091-1097 in most places; several call sites still cited the pre-drift numbers 1033/1040/1060-1072/1073-1079 and were corrected.
  • The rank/sphere block (numeigs = min(...), nw = numeigs, the reversed-Stmp2 loop, the do_approx_sphere polar-factor block, the Spinv pseudoinverse) moved from 395/545/455-460/483-490/550-560 to 413/563/473-479/501-508/568-578.
  • update_params's A-update gate, the rholrate ceiling ratchet, and the identify_shared_comps/get_unmixing_matrices share schedule moved from 1785/1788/1050/1838/1840,1845/1898/1918 to 1803/1806,1813/1068/1856/1858,1863/1916/1936.
  • The rejection-sentinel citation (sum(modloglik(:,i)) == 0.0) was pointing at if (load_rej) then (887-896); the real check is reject_data's zeroing block (2231-2234) and the sentinel read itself (907). Both were wrong for a different reason than simple line drift and are now correct.
  • The non-GG density-family select-case and its literal log-normalizer constants moved from 1305-1473 to 1323-1491 (case-by-case verified against the actual case (0)/(2)/(3)/(4)/(1) blocks).
  • pdftype/=0 freezing dorho moved from 3682 to 3704-3705 (a larger, non-uniform drift than the rest of the file).

One judgment call (not left ambiguous, but worth flagging)

amica15.f90:2299/2308-2333 (the S-write recl and the write_output LLt interleave) had three nearly-identical candidate targets in the reference (a periodic history checkpoint at ~2317, a date-stamped final write at ~2394/2333, and an explicit-outdirparam final write at ~2423/2338-2343). Picked the explicit-outdirparam branch (2423, 2338-2343) because that is the branch validate_implementations.py actually exercises (input.param sets outdir explicitly, never the date-stamped path).

Nothing left ambiguous

Every enumerated citation was resolved to a specific, verified line or range; none needed to be left as a guess.

Test plan

  • uv run ruff check .
  • uv run ruff format --check .
  • uv run ty check .
  • uv run pytest -m "not slow" -n auto -q (403 passed, 18 skipped, 1 xfailed -- unchanged, confirming this is comment-only)

Reviewers found many amica15.f90:<line> citations in docstrings/comments
drifted off by roughly 18-20 lines from the actual reference file in this
repo. Re-verified every citation against pamica/amica15.f90 with sed/grep
and corrected the wrong ones; comment/docstring text only, no code changes.
@neuromechanist
neuromechanist merged commit e579721 into dev Aug 23, 2026
8 checks passed
@neuromechanist
neuromechanist deleted the fix-fortran-citations branch August 23, 2026 01:11
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