Skip to content

docs: fix docstring examples for RandomBaseline and CrhEnsemble - #1349

Merged
solarsys merged 1 commit into
sunlabuiuc:masterfrom
joshb-code:docs/fix-interpret-docstring-examples
Oct 30, 2026
Merged

solarsys merged 1 commit into
sunlabuiuc:masterfrom
joshb-code:docs/fix-interpret-docstring-examples

Conversation

@joshb-code

Copy link
Copy Markdown
Contributor

Contributor: Joshua Sebastian (joshb-code)

Contribution Type: Documentation (docstring fix)

Description: Follow-up to #1341, addressing the review suggestion. Two docstring examples referenced names that don't exist and now render on the interpret API pages:

  • RandomBaseline: imported a nonexistent Random; now uses the exported RandomBaseline.
  • CrhEnsemble: imported nonexistent GradientShap and Saliency; now uses IntegratedGradients, DeepLift and LimeExplainer, matching the other ensemble examples.

Docstring-only, 4 lines changed. I verified the example imports resolve; I did not run the full examples end to end. Ruff reports no issues on the changed lines. Addresses #324.

Files to Review:

  • pyhealth/interpret/methods/baseline.py - RandomBaseline docstring example
  • pyhealth/interpret/methods/ensemble_crh.py - CrhEnsemble docstring example

🤖 Generated with Claude Code

RandomBaseline's example imported a nonexistent `Random`; use the exported
`RandomBaseline`. CrhEnsemble's example imported nonexistent `GradientShap`
and `Saliency`; use the exported IntegratedGradients, DeepLift and
LimeExplainer, matching the other ensemble examples.

Follow-up to sunlabuiuc#1341; addresses sunlabuiuc#324

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Test Coverage

Total: 73.26% (19597 / 26749 lines)

Modified file Coverage Lines
pyhealth/interpret/methods/baseline.py 83.87% 26 / 31
pyhealth/interpret/methods/ensemble_crh.py 25.81% 8 / 31

Workflow run · 1287497

@solarsys solarsys left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff and ran the full core suite locally with this PR applied; no new failures. Thanks!

@solarsys
solarsys merged commit d25b2ff into sunlabuiuc:master Oct 30, 2026
2 checks passed
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