Skip to content

refactor: extract burden-summary renderer from burden_test (PR-5)#183

Merged
enriquea merged 1 commit into
devfrom
refactor/pre-release-5-burden-cli-decompose
Jun 2, 2026
Merged

refactor: extract burden-summary renderer from burden_test (PR-5)#183
enriquea merged 1 commit into
devfrom
refactor/pre-release-5-burden-cli-decompose

Conversation

@enriquea
Copy link
Copy Markdown
Collaborator

@enriquea enriquea commented Jun 2, 2026

PR-5 (burden_cli) — extract the burden-summary renderer from burden_test

burden_test is a ~780-line CLI orchestrator that inlines its result presentation. This PR extracts the cohesive ASCII summary / top-significant-table renderer into a pure, testable helper:

  • _render_burden_summary(result_df, alpha, phenotype_type) — counts significant gene sets and renders the "BURDEN ANALYSIS SUMMARY" + a top-5 ASCII table, with columns chosen by phenotype type (odds ratio for binary, standard error for continuous). ~100 lines move out of the command body.

Scope

The plan also named a dry-run/plan renderer and a stratified-loop helper. Those are left in place: they depend on ~20 of the command's parameters, so extracting them would be param-soup with little real clarity gain. The summary renderer is the cohesive, low-parameter (3 inputs) piece — the clean win. Further decomposition of the param-heavy orchestrator is noted as a possible follow-up.

Verification

  • Behavior-preserving: _render_burden_summary output verified byte-identical to the prior inline logic across binary, continuous, and no-significant-results cases (captured click.echo output compared against a verbatim copy of the old block).
  • flake8 (project selection) clean (no dangling n_significant); my edited region is black-compliant; diffs scoped to the helper + the command body. Import smoke OK.

burden_test (~780-line CLI orchestrator) inlines its result presentation. Extract the cohesive ASCII summary / top-significant-table renderer into a pure _render_burden_summary(result_df, alpha, phenotype_type) helper — ~100 lines move out of the command body into a named, testable function.

Behavior-preserving: output verified byte-identical to the prior inline logic for binary, continuous, and no-significant-results cases.

Scope: the other two renderers the plan mentioned (the dry-run plan and the stratified-loop) are left in place — they depend on ~20 command params, so extracting them would be param-soup with little clarity gain; noted as a possible follow-up. flake8 clean; import smoke OK.
@qodo-code-review
Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: db32df83-47cc-4aae-adec-ddbb0dac5b27

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/pre-release-5-burden-cli-decompose

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codacy-production
Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 medium · 1 minor

Alerts:
⚠ 3 issues (≤ 0 issues of at least minor severity)

Results:
3 new issues

Category Results
Documentation 1 minor
Complexity 2 medium

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@enriquea enriquea merged commit c723c40 into dev Jun 2, 2026
2 of 3 checks passed
@enriquea enriquea deleted the refactor/pre-release-5-burden-cli-decompose branch June 2, 2026 22:25
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.

1 participant