Skip to content

Expose digits argument for h_tbl_median_surv#1469

Open
Copilot wants to merge 5 commits intomainfrom
copilot/expose-digits-argument-h-tbl-median-surv
Open

Expose digits argument for h_tbl_median_surv#1469
Copilot wants to merge 5 commits intomainfrom
copilot/expose-digits-argument-h-tbl-median-surv

Conversation

Copy link

Copilot AI commented Feb 12, 2026

Pull Request

Description

The h_tbl_median_surv() function hardcoded signif(..., 4) for rounding median survival estimates. Users can now control precision via a digits parameter.

Changes

  • h_tbl_median_surv(): Added digits parameter (default: 4) to control signif() precision for median and CI values
  • control_surv_med_annot(): Added digits parameter to expose setting via control interface
  • g_km(): Passes digits from control_annot_surv_med with %||% 4 fallback for backward compatibility
  • Documentation and tests added

Usage

# Via control object in g_km()
g_km(
  df = df,
  variables = variables,
  control_annot_surv_med = control_surv_med_annot(digits = 2)
)

# Direct function call
h_tbl_median_surv(fit_km = fit, digits = 2)

Backward compatible: default value and fallback maintain existing behavior.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 12, 2026 17:31
Co-authored-by: shajoezhu <3692541+shajoezhu@users.noreply.github.com>
Co-authored-by: shajoezhu <3692541+shajoezhu@users.noreply.github.com>
…gits

Co-authored-by: shajoezhu <3692541+shajoezhu@users.noreply.github.com>
Co-authored-by: shajoezhu <3692541+shajoezhu@users.noreply.github.com>
Copilot AI changed the title [WIP] Expose digits argument for h_tbl_median_surv function Expose digits argument for h_tbl_median_surv Feb 12, 2026
Copilot AI requested a review from shajoezhu February 12, 2026 17:35
@shajoezhu shajoezhu marked this pull request as ready for review February 12, 2026 18:37
@shajoezhu shajoezhu requested a review from donyunardi February 12, 2026 18:37
@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

Unit Tests Summary

    1 files     85 suites   1m 37s ⏱️
  901 tests   892 ✅   9 💤 0 ❌
2 231 runs  1 520 ✅ 711 💤 0 ❌

Results for commit 344bf69.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

Unit Test Performance Difference

Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
h_km 👶 $+0.02$ control_surv_med_annot_works_with_custom_digits
h_km 👶 $+0.03$ h_tbl_median_surv_respects_digits_parameter

Results for commit 8e41787

♻️ This comment has been updated with latest results.

Copy link

@donyunardi donyunardi left a comment

Choose a reason for hiding this comment

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

Hi @shajoezhu

  • Should the digit be exposed all the way to the top to g_km? This is the function that's ultimately being used for tm_g_km
  • there's no request to address h_km. This seems to be out-of-scope from the intended issue. Or is there any relationship between g_km and h_km?
  • CI/CD did not pass, usually we make sure it passed before review.

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.

3 participants