Repository navigation
chore: prune over-long code comments - #335
Conversation
Recent PRs (#272, #302, #309, #317, #283) inserted comment blocks with essay-length justifications. Tighten the worst 13: keep each block's essential technical point (Enzyme array-typing invariants, right-alignment, forecast factorisation, GP nugget floor) but cut the repeated rationale, filler, and self-referential prose. Comments only — no code, docstring, or test-assertion changes.
Try this Pull Request!Option 1: Julia Package ManagerOpen Julia and type: import Pkg
Pkg.activate(temp=true)
Pkg.add(url="https://github.com/EpiAware/ComposableTuringIDModels.jl", rev="chore/prune-comments")
using ComposableTuringIDModelsOption 2: Local CheckoutIf you have the repo locally: git checkout chore/prune-comments
julia --project=. -e "using Pkg; Pkg.instantiate()" |
Benchmark comparison vs baseMinimum time per call. Buckets are PR time as a % of base, so lower is faster (🟢 faster, ⚪ within 5%, 🔴 slower). Counts of benchmarks per bucket:
Evaluation — 9 benchmarks (by time change)
AD gradients — 7 benchmarks (by time change)
|
|
📖 Documentation preview is ready! View the docs for this PR at: https://EpiAware.github.io/ComposableTuringIDModels.jl/previews/PR335/ This preview will be updated automatically when you push new commits. |
There was a problem hiding this comment.
This PR only trims explanatory # comments in 12 source files and one test file to be shorter, per the org standard that comments should be short and state the why without narration; no function bodies, signatures, tests, or docstrings are touched. I checked each hunk against its surrounding code and against the julia-standards.md rules on comment style, and the trimming preserves the load-bearing rationale in every case (e.g. the generation-interval lag-0 convention removed from Renewal.jl's inline comment is still stated at its owning definition, _drop_lag_zero). The broad CI failure list looks unrelated to a comment-only diff and is worth confirming separately rather than attributing to this change.
Automated first pass by seabbs-review-bot (Claude sonnet), triggered by: first pass. Not a human review. Comment @seabbs-review-bot to ask for another pass: @seabbs any time, the author's agent once it has pushed changes. Add the no-review label to opt this PR out. Ping @seabbs with any questions.
Six of the shortened blocks lost something a reader needs and cannot get from the code: - Mooncake's actual error text, "Unreachable reached", which is what someone hitting it will search for. - Why the GP guard needs ℓ > 0 at all: no spectral density, and a singular covariance, at ℓ ≤ 0. - That a container-held model is printed but not walked — the observable consequence of `wrapped_models` differing from the printing walk. - That an absent entry is missing at random, which is what licenses dropping it from the likelihood rather than imputing it. - That no heuristic on the time-axis length is used or wanted, since an innovation stream is typically shorter than the series it drives. - That the resolve-before-scan seam means nothing ever tests what a modifier is. Also unpick a "so … so" in the trials comment, restore the note that the longer series' head goes unused, and drop a stray blank line in the forecast splice loop. Co-Authored-By: Sam Abbott <contact@samabbott.co.uk> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UmmqqzQPhrB74RfAv2TqBQ
|
@seabbs-review-bot |
The pruned nugget comment named the code's own choice as the failure mode. The nugget in the code IS jitter-scaled; the rejected alternative was one with an absolute floor of `jitter`. The `ExactGP` docstring says so, and the worked number at σ = 1e-3 is what made it checkable. Put both back. Four other blocks lost the mechanism that supported their claim: - The Enzyme constraint had become a non-sequitur without the `y_t[i] ~ dist` run-time `=== missing` check that is what would need the array. - "DynamicPPL owns the copying" was unsupported without the deepcopy of an argument that still holds a `missing`. - `n_strata` is `infection_strata` applied to the stream count, not the stream count, and the two `time_steps` sources are why the helper is shared. - The i.i.d. parenthetical had attached to the latent rather than to its resized stream. Also split a sentence in `priors.jl` carrying both a semicolon and a dash, and make "the worked example" indefinite now that the sentence naming it is gone. Co-Authored-By: Sam Abbott <contact@samabbott.co.uk> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UmmqqzQPhrB74RfAv2TqBQ
There was a problem hiding this comment.
This PR is comment-only: every hunk trims prose in existing #/docstring comments, plus one incidental blank-line removal in forecast.jl; no logic, signatures, tests, or behaviour change anywhere in the diff. I checked the trimmed comments (nugget formula in ExactGP.jl, the factorisation guard and innovation-extension logic in forecast.jl, the missing-observation scoring in ObservationErrorModels/methods.jl, the Aggregate/BinomialError alignment comments) against the code they describe and found no drift — the branch's own follow-up commits already restored facts an earlier pass over-pruned and fixed a wrong nugget-formula comment. No development-history language, issue references, or restated-signature docstrings were introduced. Nothing to flag.
Automated first pass by seabbs-review-bot (Claude sonnet), triggered by: re-review requested by seabbs-bot. Not a human review. Comment @seabbs-review-bot to ask for another pass: @seabbs any time, the author's agent once it has pushed changes. Add the no-review label to opt this PR out. Ping @seabbs with any questions.
| # [`AR`](@ref)'s damping for the worked example. | ||
| # `Distribution` ⇒ one RV, a constant) OR a length-`n` path (an | ||
| # `AbstractPriorModel` process ⇒ the process's own draw). A component reads | ||
| # the result per step with `at`, so ONE recursion serves both the constant |
What
Recent PRs (#272, #302, #309, #317, #283) landed comment blocks with essay-length rationales — multi-paragraph justifications above short functions that repeat the code's own point. This PR tightens the worst 13 blocks in
src/and one intest/, keeping each block's essential technical point while cutting the filler.Comments only. No code, docstring, string-literal, or test-assertion changes. Verified with a script that 0 non-comment lines changed and
git diff --checkis clean.What was kept
The genuinely-necessary invariants stay, just condensed:
Files (13)
src/base/priors.jl,src/infection_models/Renewal.jl,src/inference/IDProblem.jl,src/inference/forecast.jl,src/latent_models/models/ExactGP.jl,src/latent_models/models/HilbertSpaceGP.jl,src/observation_models/ObservationErrorModels/{BinomialError,methods}.jl,src/observation_models/modifiers/{Aggregate,ReportTriangle}.jl,src/observation_models/traversal.jl,src/steps/RenewalStep.jl,test/unit/observation_models/observations_extra.jlNet diff: -65 comment lines (107 insertions, 172 deletions).