Skip to content

Conversation

@roninsightrx
Copy link
Contributor

@roninsightrx roninsightrx commented Jan 16, 2026

  • Consolidates (most) model compilations in setup.R
  • Consolidates tests in filename test_<function> (some where grouped more by topic).

No changes to actual code, just tests.

roninsightrx and others added 9 commits January 15, 2026 20:39
Move shared model compilations from individual test files to setup.R
to reduce redundant compilation during test runs. Models are compiled
once at test session startup and reused across test files.

Models moved include IOV models, multi-observation models, mixture
models, time-varying covariate models, and various library models
(3cmt, 2cmt oral, MM kinetics). Conditional compilation (NOT_CRAN)
preserved for slower models.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@roninsightrx roninsightrx changed the title RXR-2598: move tests RXR-2598: consolidate model compilation & move tests Jan 17, 2026
@roninsightrx roninsightrx changed the title RXR-2598: consolidate model compilation & move tests RXR-2598: consolidate model compilation & tests Jan 17, 2026
Copy link

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 consolidates model compilations and reorganizes test files to improve test organization and reduce compilation time during testing. Models that were previously compiled separately in individual test files are now compiled once in setup.R, and tests have been reorganized to follow a test_<function> naming convention.

Changes:

  • Models consolidated into setup.R for one-time compilation at test session startup
  • Tests from multiple files (test_iov.R, test_multi_obs.R, test_mixture_model.R, test_compare_results.R, test_cmt_mapping.R, test_timevar_cov.R, test_t_init.R, test_sim_lagtime.R, test_time_rounding_bug.R) moved into test_sim.R
  • Tests from test_bioav_def.R moved into test_new_ode_model.R
  • Tests from test_advan_with_auc.R and test_advan_with_covariates.R consolidated into test_advan.R
  • New test files created for specific functions (test_new_adherence.R, test_check_mixture_model.R, test_calculate_parameters.R, test_pkpdsim_to_nlmixr.R)
  • New R implementation file R/new_adherence.R added with adherence simulation functions

Reviewed changes

Copilot reviewed 22 out of 26 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/testthat/setup.R Centralized model compilation with clear organization and comments
tests/testthat/test_sim.R Consolidated tests from multiple files into describe() blocks
tests/testthat/test_new_ode_model.R Added IOV and bioavailability tests from test_bioav_def.R
tests/testthat/test_advan.R Added AUC and covariate tests from separate files
tests/testthat/test_new_adherence.R New test file for adherence functions
tests/testthat/test_check_mixture_model.R New test file extracted from test_mixture_model.R
tests/testthat/test_calculate_parameters.R New test file for parameter calculation
tests/testthat/test_pkpdsim_to_nlmixr.R New test file for nlmixr conversion
R/new_adherence.R New implementation of adherence simulation functions
tests/testthat/test_get_var_y.R Added seed parameters for reproducibility
tests/testthat/test_reparametrization.R Updated to use models from setup.R
tests/testthat/test_parameters_table.R Updated to use models from setup.R
tests/testthat/test_calc_ss_analytic.R Updated to use models from setup.R

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@mccarthy-m-g mccarthy-m-g left a comment

Choose a reason for hiding this comment

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

lgtm! Nice clean up 🧹

Comment on lines +299 to +301
## there is slight difference in how bolus doses are handled.
## Analytical equation is perhaps more consistent, so not testing
## simulations at dose times. Should look into later.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a TODO here?

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