Skip to content

Overhaul API for recent functions#50

Merged
malcolmbarrett merged 4 commits intomainfrom
consistency
Aug 12, 2025
Merged

Overhaul API for recent functions#50
malcolmbarrett merged 4 commits intomainfrom
consistency

Conversation

@malcolmbarrett
Copy link
Member

This PR introduces a family of functions that are consistent: bal_*(), check_*(), and plot_*() as well as auto plotting methods and clearer name schemes

@malcolmbarrett malcolmbarrett requested a review from Copilot August 12, 2025 21:46
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 introduces a consistent API overhaul for halfmoon functions, implementing three distinct function families: bal_*() for single-weight operations, check_*() for multi-weight comparisons, and plot_*() for visualization. The changes also add automatic plotting methods and improve naming schemes across the package.

  • Renames core functions to follow consistent naming patterns (roc_curvecheck_model_roc_curve, plot_calibrationplot_model_calibration, qqcheck_qq)
  • Introduces new bal_*() functions for single-weight operations (bal_qq, bal_model_auc, bal_model_roc_curve, bal_ess)
  • Adds autoplot methods and S3 plot methods for all halfmoon object classes with appropriate class annotations

Reviewed Changes

Copilot reviewed 68 out of 88 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/testthat/test-plot_roc.R Updates function calls from old to new naming scheme
tests/testthat/test-plot_calibration.R Renames plot_calibration to plot_model_calibration throughout
tests/testthat/test-geom_roc.R Fixes data preparation with explicit numeric conversion
tests/testthat/test-geom_qq2.R Improves data transformation and adds seed for reproducible tests
tests/testthat/test-geom_mirrored_histogram.R Minor test output change for consistency
tests/testthat/test-geom_calibration.R Updates function names and adds comprehensive calibration tests
tests/testthat/test-compute_qq.R Renames qq to check_qq throughout with updated documentation
tests/testthat/test-check_model_auc.R Comprehensive rename from roc_curve to check_model_roc_curve
tests/testthat/test-bal_*.R New test files for bal_*() function family
tests/testthat/test-autoplot-methods.R New tests for autoplot and plot methods
R/*.R Implementation of new function families and autoplot methods
man/*.Rd Updated documentation reflecting new naming scheme

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

@malcolmbarrett malcolmbarrett merged commit 8162863 into main Aug 12, 2025
9 checks passed
@malcolmbarrett malcolmbarrett deleted the consistency branch August 12, 2025 22:02
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