Skip to content

Fix docstring inconsistencies in find_elbow_point, rho, psi#414

Open
kgdunn wants to merge 6 commits into
mainfrom
claude/determined-fermat-knl404
Open

Fix docstring inconsistencies in find_elbow_point, rho, psi#414
kgdunn wants to merge 6 commits into
mainfrom
claude/determined-fermat-knl404

Conversation

@kgdunn

@kgdunn kgdunn commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

Docstring-only fixes; no behaviour change.

  1. bivariate/_elbow_peak.py::find_elbow_point - the signature returns int | float and the body can return either -1 (when every value in x or y is missing) or np.nan (when the consensus intersection is degenerate), but the free-form docstring only mentioned the -1 case. Rewrite to NumPy style with proper Parameters and Returns sections that document both return paths.

  2. monitoring/control_charts.py::rho - bi-weight rho function. Add NumPy-style Parameters and Returns sections; preserve the reference to the source paper.

  3. monitoring/control_charts.py::psi - Huber-style psi function. Add NumPy-style Parameters and Returns sections; preserve the reference to the source paper.

Each fix lands as its own micro-commit; a final commit bumps the PATCH version, updates CITATION.cff, and adds a CHANGELOG.md entry.

Test plan

  • ruff check clean on both touched files
  • ruff format --check clean on both touched files
  • No code paths changed; existing tests remain green

Generated by Claude Code

claude added 6 commits June 12, 2026 07:20
The signature is int | float and the body can return either -1 (when
every value in x or y is missing) or np.nan (when the consensus
intersection is degenerate because every fitted pair of lines was
effectively parallel). The free-form docstring previously documented
only the -1 case. Rewrite to NumPy style with Parameters and Returns
sections that cover both paths, the length validation, and the
>10-finite-values minimum that ValueError enforces.
The bi-weight rho function had a free-form docstring with just the
paper reference. Add Parameters (documenting x and the k=2.52 tuning
constant) and Returns sections, and move the paper link into a proper
References section.
The Huber-style psi function had a free-form docstring with just the
paper reference. Add Parameters (documenting x and the k=2.0 tuning
constant) and Returns sections, and move the paper link into a proper
References section.
Picks up pre-existing wrap inconsistencies in lines that fit within
the 120-char limit. No behaviour change.
Patch bump covering the NumPy-style docstring corrections to
find_elbow_point, rho, and psi. No behaviour change. CITATION.cff
version + date-released and CHANGELOG.md updated in the same commit.
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/process_improve/bivariate/_elbow_peak.py 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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