Skip to content

feat: validate the LLOQ values in PKNCAconc() - #682

Merged
billdenney merged 2 commits into
mainfrom
feat/lloq-validation
Oct 9, 2026
Merged

billdenney merged 2 commits into
mainfrom
feat/lloq-validation

Conversation

@billdenney

Copy link
Copy Markdown
Member

PKNCAconc() checked only that the lloq column or scalar was numeric, with a checkmate error.

  • Every non-missing lloq value must now be finite, not NaN, and greater than zero. NA stays allowed, since missing LLOQs are ignored downstream.
  • A column or scalar that is entirely NA of any class (for example the logical NA of a column read from a file with no LLOQ) is accepted and stored as numeric NA. An integer column stays integer; an all-NA integer column becomes double.
  • A units column is accepted and stored as given; the checks use the plain numbers.
  • Anything else (a non-numeric class with a value, zero, negative, Inf, NaN) is the classed error pknca_error_conc_invalid_lloq, whose message names up to five offending values, then "...", or the class.

Tests pin the exact class and message for each refused case and the accepted all-NA, mixed, units and valid cases. The lloq roxygen and NEWS.md describe the behavior.

🤖 Generated with Claude Code

billdenney and others added 2 commits October 9, 2026 08:59
PKNCAconc() checked only that the lloq column or scalar was numeric, with a
checkmate error.  Every non-missing value must now be finite and greater than
zero, and a column or scalar that is entirely NA of any class (such as the
logical NA of a column read from a file with no LLOQ) is accepted and stored as
numeric NA.  Everything else is the classed error
pknca_error_conc_invalid_lloq, whose message names the offending values or the
class.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The LLOQ check ran the comparison on the column itself, so a units column hit
the units comparison method and failed with an unclassed error.  The checks now
use the plain numbers and the column is stored as given.  The error lists at
most five distinct invalid values and says when more were cut.  The roxygen and
NEWS now say that NaN is refused and that only an all-NA integer column becomes
double.  Tests pin integer storage, the full scalar message, factor, logical,
and Date columns, an all-NA Date column, the cap, and units columns.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@billdenney
billdenney merged commit 1788921 into main Oct 9, 2026
9 checks passed
@billdenney
billdenney deleted the feat/lloq-validation branch October 9, 2026 13:33
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