Skip to content

Conversation

@malcolmbarrett
Copy link
Collaborator

No description provided.

@malcolmbarrett malcolmbarrett requested a review from Copilot August 12, 2025 23:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves parameter naming consistency across the package by replacing ambiguous parameter names with more descriptive alternatives. The changes primarily focus on replacing .treated/.untreated with .focal_level/.reference_level, focal with .focal_level, and .df with .data throughout the codebase.

  • Standardizes parameter naming to use .focal_level and .reference_level instead of .treated/.untreated for better clarity
  • Updates function signatures to use .data instead of .df for consistency with tidyverse conventions
  • Implements deprecation warnings for old parameter names while maintaining backward compatibility
  • Updates test files to use new parameter names and adds proper option handling for test output consistency

Reviewed Changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/testthat/test-weights.R Updates test calls to use new .focal_level/.reference_level parameters and adds message suppression options
tests/testthat/test-weights-categorical.R Converts focal parameter usage to .focal_level in categorical weight tests
tests/testthat/test-weights-categorical-comparison.R Updates categorical comparison tests with new parameter names
tests/testthat/test-weight-integration-categorical.R Changes parameter names in integration tests and fixes .df to .data
tests/testthat/test-ps_trunc.R Updates propensity score truncation tests with new parameter naming
tests/testthat/test-ps_trunc-categorical.R Removes duplicate test methods and updates parameter names
tests/testthat/test-ps_trim.R Updates trimming tests to use .focal_level/.reference_level and .data parameters
tests/testthat/test-ps_trim-categorical.R Updates categorical trimming tests and removes duplicate print method tests
tests/testthat/test-ps_calibration.R Updates calibration tests with new parameter names and fixes test descriptions
tests/testthat/test-ipw.R Updates IPW tests to use .data instead of .df and new focal parameters
tests/testthat/setup.R Adds propensity.quiet = TRUE option to suppress info messages during tests
tests/testthat/_snaps/*.md Updates test snapshots to reflect new parameter names in error messages
man/*.Rd Updates documentation files with new parameter names and deprecation badges
R/weights.R Core implementation of parameter name changes with deprecation handling
R/weights-utils.R Adds deprecation handling utility and updates transformation functions
R/ps_trunc.R Updates truncation functions with new parameter names
R/ps_trim.R Updates trimming functions including ps_refit parameter change
R/ps_calibration.R Updates calibration function parameters and examples
R/ipw.R Changes .df to .data throughout IPW implementation
DESCRIPTION Adds lifecycle package dependency for deprecation warnings
Comments suppressed due to low confidence (2)

tests/testthat/test-weights.R:293

  • Error message should be updated to match the new parameter naming convention. Should say "Setting focal level to treated" to be consistent with the new .focal_level parameter.
    "Setting focal level to `treated`"

tests/testthat/test-weights.R:716

  • Error message should be updated to match the new parameter naming convention. Should say "Setting focal level to treated" to be consistent with the new .focal_level parameter.
    "Setting focal level to `treated`"

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@malcolmbarrett malcolmbarrett merged commit ea99af5 into main Aug 13, 2025
7 checks passed
@malcolmbarrett malcolmbarrett deleted the consistency branch August 13, 2025 00:18
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