refactor: extract burden-summary renderer from burden_test (PR-5)#183
Conversation
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 reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 1 minor |
| Complexity | 2 medium |
🟢 Metrics 0 complexity
Metric Results Complexity 0
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.
PR-5 (burden_cli) — extract the burden-summary renderer from
burden_testburden_testis 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
_render_burden_summaryoutput verified byte-identical to the prior inline logic across binary, continuous, and no-significant-results cases (capturedclick.echooutput compared against a verbatim copy of the old block).flake8(project selection) clean (no danglingn_significant); my edited region isblack-compliant; diffs scoped to the helper + the command body. Import smoke OK.