Skip to content

Fix suggest_transform docstring to match POWER fallback logic#90

Open
kgdunn wants to merge 3 commits into
mainfrom
claude/ecstatic-johnson-knl404
Open

Fix suggest_transform docstring to match POWER fallback logic#90
kgdunn wants to merge 3 commits into
mainfrom
claude/ecstatic-johnson-knl404

Conversation

@kgdunn

@kgdunn kgdunn commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

The docstring for suggest_transform in src/scorepilot/core/profiling.py misdescribes the rule used by the function. It says the POWER branch is reached for "milder skew", but in reality the POWER branch fires at exactly the same skewness > 1.0 threshold as the LOG branch. What actually differs between the two branches is the positive + wide_range conditions, not the skew level.

This PR replaces the rule paragraph with an accurate description of the implemented logic:

A strongly right-skewed (skewness > 1.0), strictly positive variable with a wide dynamic range (min/max ratio > 20) is a candidate for a log transform. A strongly right-skewed variable that is not strictly positive or lacks a wide dynamic range falls back to a signed power (root). Otherwise no transform is suggested.

Surgical docstring-only change; no behaviour change. PATCH version bump in pyproject.toml per the repo versioning rule.

Test plan

  • uv run ruff check src/scorepilot/core/profiling.py
  • uv run ruff format --check src/scorepilot/core/profiling.py

Generated by Claude Code

claude added 3 commits June 12, 2026 07:22
The previous docstring said the POWER branch fires for 'milder skew', but
both LOG and POWER branches use the same skewness > 1.0 threshold. POWER
is reached when the variable is strongly skewed but is not strictly
positive or lacks a wide dynamic range. Update the docstring to describe
the actual rule.
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