Skip to content

fix: warn when an AUCinf-based AUCint needs a missing half-life - #721

Open
billdenney wants to merge 3 commits into
mainfrom
fix/aucint-halflife-missing
Open

billdenney wants to merge 3 commits into
mainfrom
fix/aucint-halflife-missing

Conversation

@billdenney

Copy link
Copy Markdown
Member

aucint.inf.obs, aucint.inf.pred, aumcint.inf.obs, and aumcint.inf.pred now give a pknca_warning_aucint_halflife_missing warning, naming the parameter, wherever they need the half-life and it is missing (#450). No value, exclude text, or method text changes. There are three places:

  • A finite interval that ends after Tlast: "aucint.inf.obs: the half-life is missing, so the part of the interval after Tlast is not extrapolated with it, and the result is calculated as aucint.all is". The value is that of aucint.all (or aumcint.all), as it has been since the AUCall fallback of AUCINT differences with mixed BLQ and above LOQ time points #508. The text says how the value is calculated rather than what it is, because the value can still be NA for another reason, such as a start concentration that cannot be estimated.
  • An interval to infinity: "... an interval to infinity has no finite fallback, so NA is returned".
  • An interval that starts at a dose with no concentration measured there: the concentration at the start is past the Tlast of the profile before the dose, and would be extrapolated with the half-life.

A direct call of pk.calc.aucint() or pk.calc.aumcint() with auc.type = "AUCinf" gives the same warning, naming "the AUCinf-based AUCint" or "the AUMCinf-based AUMCint". Each parameter gives one warning per interval, and other warnings pass through with their own classes. An interval that ends at or before Tlast, and needs no concentration from the profile before a dose, needs no half-life and gives no warning.

A test enumerates the registered parameters that integrate with pk.calc.aucint() or pk.calc.aumcint() and take the half-life, and checks each of the three cases for every one of them.

🤖 Generated with Claude Code

billdenney and others added 3 commits November 13, 2026 09:02
…f-life

Over a finite interval that ends after Tlast, aucint.inf.obs,
aucint.inf.pred, aumcint.inf.obs, and aumcint.inf.pred without a
half-life have given the aucint.all (or aumcint.all) value since the
dose-aware AUCint work, without saying so.  They now give a
pknca_warning_aucint_halflife_missing warning that names the parameter
and the one whose value it has.  The values and the exclusion
("DO NOT EXCLUDE") do not change, and an interval that ends at or before
Tlast stays silent.

The method text of that fallback is a shared constant, as the half-life
one is, so the writer and the check that warns cannot drift.  A test
enumerates every registered parameter that takes lambda.z and integrates
with pk.calc.aucint() or pk.calc.aumcint(), so a new one fails until it
is covered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bill's answers:  an interval to infinity without a half-life stays NA
with the same warning, and so does a start concentration extrapolated
from the profile before the dose past its Tlast (value unchanged).

pk.calc.auxcint() now gives pknca_warning_aucint_halflife_missing where
it decides that it has no half-life to use (after Tlast, to infinity, or
for the start concentration, which interp.extrap.conc.dose() reports as
an extrapolation), with the case in a halflife_missing field.  The
aucint.inf.* and aumcint.inf.* functions give it again with their name.
This replaces reading the method text afterwards, which could not see
the other two cases.  The enumerating test covers all three and a first
dose, which needs no half-life; NEWS says no value changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd names the AUMC

The warning for a finite interval past Tlast is given before the value is
known, and the value can still be NA for another reason (a start
concentration that cannot be estimated).  It now says the part after Tlast is
not extrapolated with the half-life and the result is calculated as the
AUCall-based one is, which holds in every case.

pk.calc.aumcint() gives the warning again with "The AUMCinf-based AUMCint"
and "the AUMCall-based one", so a direct call names the AUMC.  The
aumcint.inf.* parameters still give one warning, with their own name.

The comment of the enumerating test states its two limits:  the integrator
call must be in the parameter's own function body, and the .all and .last
names are derived by a regular expression.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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