Add to nlmixr2plot fix - #53
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets a crash in prediction-corrected VPC plotting on censored (LLOQ/ULOQ) fits, where vpc can error in quantile() due to NA handling during pred-correction. It adds regression tests and documents the fix in the changelog.
Changes:
- Add regression tests ensuring
vpcPlot()/vpcPlotTad()withpred_corr=TRUEdo not error on censored fits. - Add pre-filtering logic in the
vpc-backend path to avoid NA-drivenquantile()crashes when pred-correcting censored data. - Document the fix in
NEWS.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/testthat/test-plots-cens.R | Adds regression coverage for pred-corrected VPC/TAD VPC on censored fits. |
| R/vpcPlot.R | Implements a workaround for vpc pred-correction + censoring NA/quantile() crash. |
| NEWS.md | Records the user-visible bug fix in the development NEWS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,5 +1,10 @@ | |||
| # nlmixr2plot 5.0.2.9000 | |||
|
|
|||
| * Fixed a `quantile()` "missing values and NaN's not allowed" error in | |||
- vpcPlot(): drop pred-corrected censored rows with strict comparisons (DV > lloq / DV < uloq). Censored records are encoded at the censoring limit, so the previous >=/<= kept those boundary rows and included them in the pred-corrected VPC, contradicting vpc's non-censored-only behavior (Copilot review). - NEWS.md: fix "NaN's" -> "NaNs" (Copilot review). - vpcPlot(): retain the `cens` column through the pred-corrected observed rebuild so `method = "tidyvpc", cens = TRUE` no longer errors that the observed data has no `cens` column; add regression tests. - .Rbuildignore: ignore .git and .vexp. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mirror nlmixr2est's test partitioning so push/PR R-CMD-check runs a minimal
essential subset that still exercises the core plotting surface, and the
expensive fit-heavy files run weekly.
- tests/testthat.R: add NLMIXR2PLOT_TEST_BATCH partitioning. On push/PR CI the
essential subset runs every file EXCEPT the slow ones in .slowBatches
(measured local run times: plots ~219s + gglist-integration ~12s stay
essential; plots-multiple-endpoints ~527s, plots-cens ~62s and plots-bsv
~156s move to weekly). Batch mode runs only the requested batch; locally and
on CRAN everything runs. Also cap threads/testthat parallelism on CI/CRAN.
- .github/workflows/slow-tests.yaml: new weekly (Sat 04:30 UTC) + manual
workflow running the slow batches one at a time (max-parallel 1).
- .github/workflows/R-CMD-check.yaml: auto-cancel superseded in-progress runs
to stop stale runs starving the runner pool (a cause of the exit-143
"runner received a shutdown signal" failures).
- test-plots-multiple-endpoints.R: guard the multiple-endpoint augPred() call,
which errors ("no applicable method ... nlmixr2FitCore") in some nlmixr2est
versions, so the weekly batch still exercises the rest of the plots.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rename the batch-partitioning locals (.on_cran, .on_ci, .slow_batches, .slow_all) to snake_case so object_name_linter / CodeFactor reports no style issues. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
Author
|
@copilot resolve the merge conflicts in this pull request |
Copilot stopped work on behalf of
mattfidler due to an error
August 4, 2026 18:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.