Repository navigation
Take times without a unit to be hours when detecting the dosing interval - #667
Merged
Merged
Conversation
With no time unit, find.dose.regimen() and so find.tau(), choose.auc.intervals(), PKNCAdata() and pk.nca() now match the dosing interval to the built-in nominal set in hours, the same assumption PKNCA already makes for date-times: find.tau(c(0, 24, 50)) is 24 rather than the median spacing of 25. A stated unit overrides the assumption. timeu = NA now says that a unit is stated but cannot be used, which leaves the interval to the data as an unusable unit did before. pknca_group_timeu() returns NULL for no unit (hours) and NA for several units in a group or a unit that cannot be converted, so an arbitrary unit label in PKNCAconc() still gives the data-derived interval. The date-time flag is no longer needed and is removed. Tests that pinned data-derived medians without a unit now expect the snapped values (24 and 121.5 rather than 24.5 and 122), with the data-derived values pinned under timeu = NA or an unusable unit. Tests of times in days, minutes, or abstract units now assert the not-nominal warning, or pass timeu = NA where the units are abstract. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…feat/intervals-unit-aware
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.
Summary
find.tau(),find.dose.regimen(),choose.auc.intervals(),PKNCAdata()andpk.nca()now match the dosing interval to the built-in nominal intervals in hours, the same assumption PKNCA already makes for date-times.find.tau(c(0, 24, 50))is 24 (once daily) rather than the median spacing of 25.timeuoverrides the assumption. A stated unit that cannot be converted to hours still leaves the interval to the dose times.timeu = NAsays so explicitly.Behaviour changes
mrt.md.obs.pknca_warning_tau_not_nominal. StatetimeuinPKNCAconc()to avoid it.Tests
timeu = NA. Tests of times in days, minutes or abstract units assert the new warning or passtimeu = NA.🤖 Generated with Claude Code