Fix docstring drift surfaced by audit#96
Open
kgdunn wants to merge 2 commits into
Open
Conversation
- Model.params (db/models.py): reflect that today's blob holds x_loadings, explained_variance, and r2_cumulative, not P/W/means/scales. - apply_transform (core/transforms.py): the power branch's signature default is c1=0.0; 0.5 (signed root) is only substituted internally when c1==0.0. - suggest_transform (core/profiling.py): describe the actual branches (POWER only for strongly skewed + not-strictly-positive/narrow-range; milder skew is left alone).
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.
Summary
Three docstrings had drifted from the code they describe. Docstring-only fixes; no signature or behaviour changes.
src/scorepilot/db/models.py--Modelclass docstring. Old text claimed theparamsblob heldP, W, means, scales, .... In practice_pack_paramsinsrc/scorepilot/api/models.pyonly writesx_loadings,explained_variance, andr2_cumulative. Rewrote the docstring to enumerate exactly those three arrays and note the "swap for object storage if artifacts grow" pattern still holds.src/scorepilot/core/transforms.py--apply_transformNotes. Old text said thepowerbranch's defaultc1is0.5(signed root). The signature default isc1 = 0.0;0.5is only substituted internally by_transform_valueswhenc1 == 0.0. Rewrote the Note to describe the two-layer default.src/scorepilot/core/profiling.py--suggest_transform. Old text said "milder skew suggests a signed power (root)". The code actually returnsPOWERonly when the variable is strongly skewed (skewness > 1.0) but fails either the strict-positivity or wide-range check forLOG. Milder skew returnsNONE. Rewrote to describe the real branches.Version bumped from 0.22.0 -> 0.22.1 (PATCH: docstrings only), lockfile refreshed in the same commit per the ScorePilot CLAUDE.md rule.
Test plan
uv run ruff check .-- passesuv run ruff format --check .-- passesModeldocstring vs_pack_paramsinsrc/scorepilot/api/models.pyapply_transformNotes vs thePOWERbranch of_transform_valuessuggest_transformdocstring vs itsif strongly_skewed and positive and wide_range/if strongly_skewedladderGenerated by Claude Code