Skip to content

docs: fix five docstring/code mismatches#97

Open
kgdunn wants to merge 1 commit into
mainfrom
claude/ecstatic-johnson-oeqk8z
Open

docs: fix five docstring/code mismatches#97
kgdunn wants to merge 1 commit into
mainfrom
claude/ecstatic-johnson-oeqk8z

Conversation

@kgdunn

@kgdunn kgdunn commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Docstring-only cleanup: five spots where the prose had drifted from what the code actually does. No behaviour changes.

Fixes

  1. src/scorepilot/schemas.py:300-307FitModelRequest: the old wording claimed n_components was used as an upper bound when auto_components is set. It isn't — the auto-fit ceiling is the fixed internal _AUTO_MAX_COMPONENTS = 20 in api/models.py, and the request's n_components is ignored. Rewrote the sentence to say so.

  2. src/scorepilot/core/profiling.py:142-158suggest_transform: docstring implied "milder skew → signed power". The code actually returns POWER only when skew > 1.0 and the log preconditions (positive + wide range) fail; mild skew (≤ 1.0) returns NONE. Reworded to "a strong skew that isn't positive with a wide dynamic range suggests a signed power (root)".

  3. src/scorepilot/core/transforms.py:51apply_transform Notes: claimed power defaults to c1 = 0.5, but the signature default is c1 = 0.0, which _transform_values remaps to 0.5 internally. Clarified the note to state the parameter default is 0.0 and is treated as 0.5 (signed root) inside _transform_values.

  4. src/scorepilot/db/models.py:47-54Model class docstring listed the persisted fitted arrays as "P, W, means, scales, …". _pack_params in api/models.py (lines 51-59) only stores x_loadings, explained_variance, r2_cumulative. Updated the list to match.

  5. src/scorepilot/api/models.py — replaced stale "no longer in memory" / "no longer loaded" wording at four sites (get_model ~L336-337, update_model ~L386, model_contributions ~L427, model_cross_validation ~L489) with "no longer available" / "the source dataset record is missing/deleted". Datasets are persisted now, not in-memory.

PATCH version bump (0.22.00.22.1); lockfile intentionally not refreshed (harness rule).

Test plan

  • uv run ruff check .
  • uv run pyright
  • uv run pytest
  • Skim each edited docstring in a rendered view to confirm phrasing reads naturally.

Generated by Claude Code

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.

2 participants