Repository navigation
fix: warn when an AUCinf-based AUCint needs a missing half-life - #721
Open
billdenney wants to merge 3 commits into
Open
billdenney wants to merge 3 commits into
billdenney wants to merge 3 commits into
Conversation
…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
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.
aucint.inf.obs,aucint.inf.pred,aumcint.inf.obs, andaumcint.inf.prednow give apknca_warning_aucint_halflife_missingwarning, 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:aucint.all(oraumcint.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 beNAfor another reason, such as a start concentration that cannot be estimated.A direct call of
pk.calc.aucint()orpk.calc.aumcint()withauc.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()orpk.calc.aumcint()and take the half-life, and checks each of the three cases for every one of them.🤖 Generated with Claude Code