Skip to content

Fix docstring drift surfaced by audit#437

Open
kgdunn wants to merge 1 commit into
mainfrom
claude/determined-fermat-io6c8o
Open

Fix docstring drift surfaced by audit#437
kgdunn wants to merge 1 commit into
mainfrom
claude/determined-fermat-io6c8o

Conversation

@kgdunn

@kgdunn kgdunn commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

Docstring/comment-only changes across multiple modules; no runtime behaviour changes, no signature changes.

# File Fix
1 src/process_improve/multivariate/_mbpca.py MBPCA class docstring: drop phantom super_vip_ entry from the fitted-attributes list; fit() only populates block_vip_.
2 src/process_improve/multivariate/_tpls.py TPLS class docstring example: wrap all_data dict in DataFrameDict(all_data) before estimator.fit(...) since TPLS.fit() raises TypeError on a bare dict.
3 src/process_improve/univariate/metrics.py variance_decomposition docstring: example now calls the current name variance_decomposition(...) instead of the pre-rename within_between_standard_deviation(...).
4 src/process_improve/multivariate/_tpls.py (~line 837) TPLS.help() text: point at tpls.diagnose(X_new) instead of the deprecated tpls.predict(X_new).
5 src/process_improve/multivariate/_tpls.py (~line 850) TPLS.help() text: correct SPE-limit call shape from .spe_limit["Y"]() to .spe_limit["Y"][group]() to match the nested dict-of-dicts populated in fit().
6 src/process_improve/multivariate/_tpls.py (~line 558) TPLS.diagnose docstring example: replace estimator.predict(new_data) with estimator.diagnose(new_data).
7 src/process_improve/regression/_robust_regression.py (~line 133) robust_regression Returns: drop the t_value entry; out["t_value"] is only ever initialised to np.nan.
8 src/process_improve/experiments/analysis.py (~line 176) analyze_experiment Parameters block: remove the coding parameter entry (declared in the signature but never referenced in the body). Signature untouched.
9 src/process_improve/multivariate/_pls.py (~line 1799) PLS.cross_validate Parameters block: add previously-undocumented sample_weight parameter, matching the style of the other parameters.
10 src/process_improve/univariate/metrics.py (~line 396-399) ttest_paired_from_df Output bullets 6-9: prose said "B minus A" but the code computes A - B (differences = sample_A - sample_B.to_numpy()); prose now reads "A minus B" to match.

Version bumped to 1.51.1 (PATCH; docstrings/comments only). CITATION.cff synced (version: 1.51.1, date-released: "2026-07-03"). CHANGELOG.md gains a ## [1.51.1] - 2026-07-03 section under ## [Unreleased], and the link-reference footer is updated.

Test plan

  • uv run ruff check src/ tests/ passes.
  • uv run ruff format --check on the touched files shows only pre-existing drift (unchanged from main); no new format issues introduced.
  • No signature or function-body changes; behaviour is identical.
  • uv.lock is intentionally not touched (Claude Code session rule).

Generated by Claude Code

Docstring/comment-only changes across multiple modules; no runtime
behaviour changes:

- MBPCA class docstring (_mbpca.py): drop phantom super_vip_ entry from
  fitted-attributes list; fit() only populates block_vip_.
- TPLS class docstring example (_tpls.py): wrap all_data dict in
  DataFrameDict(all_data) before estimator.fit(...) to match the
  runtime isinstance check.
- TPLS.diagnose docstring example (_tpls.py): change
  estimator.predict(new_data) to estimator.diagnose(new_data) since
  predict is deprecated.
- TPLS.help() text (_tpls.py): point users at tpls.diagnose(X_new) not
  the deprecated tpls.predict, and correct spe_limit call shape from
  .spe_limit["Y"]() to .spe_limit["Y"][group]() to match the nested
  dict-of-dicts populated by fit().
- variance_decomposition docstring (univariate/metrics.py): update the
  example to call variance_decomposition(...) instead of the old name
  within_between_standard_deviation(...).
- ttest_paired_from_df docstring (univariate/metrics.py): Output
  bullets 6-9 said "B minus A"; the code computes A - B, so update the
  prose to "A minus B" to match.
- robust_regression returns block (regression/_robust_regression.py):
  remove t_value entry - out["t_value"] is only ever initialised to
  np.nan.
- analyze_experiment docstring (experiments/analysis.py): remove the
  coding parameter from the Parameters block; it is declared but never
  referenced in the body (signature untouched).
- PLS.cross_validate docstring (multivariate/_pls.py): add the missing
  sample_weight parameter to the Parameters block, matching the style
  of the other parameters.

CITATION.cff version + date-released bumped to match, CHANGELOG.md
gains a 1.51.1 section under Unreleased.
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 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