Skip to content

Replace deprecated xfun attribute getters with xfun::attr2() - #644

Draft
kristinawlai with Copilot wants to merge 3 commits into
mainfrom
copilot/update-deprecated-xfun-functions
Draft

Replace deprecated xfun attribute getters with xfun::attr2()#644
kristinawlai with Copilot wants to merge 3 commits into
mainfrom
copilot/update-deprecated-xfun-functions

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Thank you for taking the time to submit a pull request!

To maximize the chances of acceptance:

  • The title of your PR should briefly describe the change.
  • Commit/merge messages to be included in NEWS.md should begin with -.
  • Code should follow the tidyverse style guide.
  • Documentation should use roxygen2, with Markdown syntax.
  • Contributions should include unit tests (using testthat).

For more information see Contributing.

  • ## Description

    • This PR removes deprecated xfun attribute access patterns by replacing read-time attr() usage with xfun::attr2() across affected package code.
    • It also updates related docs/version metadata and adds a guard test to prevent deprecated xfun attribute helpers from reappearing.
  • ## Changes

    • Attribute getter migration
      • Replaced attribute reads in affected R functions (print.*, summary.*, autoplot.*, compare_seroincidence, est_seroincidence_by, utils, strata, etc.) with xfun::attr2().
      • Kept attribute assignment (attr(x, "...") <- value) unchanged.
    • Regression coverage
      • Added tests/testthat/test-xfun-deprecations.R to assert:
        • no xfun::atrr() usage
        • no xfun::attr() usage
        • no non-assignment attr() getter usage in R/
    • Docs and metadata
      • Updated roxygen-generated docs (man/set_id_var.Rd, man/summary.seroincidence.by.Rd).
      • Added NEWS entry under development ## Internal.
      • Incremented dev version in DESCRIPTION to 1.4.1.9033.
  • ## Example

# before
start <- object |> attr("lambda_start")

# after
start <- object |> xfun::attr2("lambda_start")

Copilot AI linked an issue Aug 7, 2026 that may be closed by this pull request
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Co-authored-by: kristinawlai <57973437+kristinawlai@users.noreply.github.com>
Copilot AI changed the title [WIP] Update use of deprecated xfun functions Replace deprecated xfun attribute getters with xfun::attr2() Aug 7, 2026
Copilot AI requested a review from kristinawlai August 7, 2026 22:58
This reverts commit ec4cf21.

Co-authored-by: kristinawlai <57973437+kristinawlai@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://UCD-SERG.github.io/serocalculator/pr-preview/pr-644/

Built to branch gh-pages at 2026-08-07 23:12 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.

Update use of deprecated xfun functions

2 participants