docs: clarify that start_conc0 intentionally forces a zero start concentration - #586
Open
billdenney wants to merge 3 commits into
Open
docs: clarify that start_conc0 intentionally forces a zero start concentration#586billdenney wants to merge 3 commits into
billdenney wants to merge 3 commits into
Conversation
PKNCA_impute_method_start_conc0() previously set the start-time concentration to 0 even when an observation already existed at the interval start. That made the documented imputation chain "start_predose,start_conc0" collapse to the same result as "start_conc0" alone, because the value shifted to the start time by start_predose was immediately overwritten with 0. This is a deliberate behavior change (issue 578): start_conc0 now adds a concentration of 0 only when no observation exists at the interval start time, matching the skip-if-present semantics of start_predose and start_cmin. The chain now means "use the predose value when one can be shifted to the start time, otherwise add 0", which is the intended reading and makes chaining the two methods meaningful. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ntration" This reverts commit d87c923.
Per the maintainer's decision on issue 578 (option b), the overwrite behavior of PKNCA_impute_method_start_conc0() is intentional: the method forces the interval-start concentration to zero, replacing any existing start-time value, including a nonzero predose concentration that start_predose shifted to the start time. The preceding revert restored that behavior; this commit documents and pins it with no behavior change: * Roxygen for PKNCA_impute_method_start_conc0() states the replacement is intentional and that the "start_predose,start_conc0" chain gives the same result as "start_conc0" alone. * The data-imputation vignette no longer presents the chain as a way to carry a predose concentration forward; it explains the collapse is by design and directs users to start_predose alone (carry the predose value), start_conc0 (force zero), or a custom imputation method (predose if present, otherwise zero). * Regression tests pin the intended behavior: an existing nonzero start concentration is replaced with 0, the chain matches start_conc0 alone, and start_predose alone carries the value. * NEWS.md gains a documentation-clarification bullet. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Fixes #578.
Behavior change:
PKNCA_impute_method_start_conc0()now adds a 0 only when no observation exists at the interval start, matching the skip-if-present semantics ofstart_predose/start_cmin. Measured start-time data are no longer silently replaced, and the documented chain"start_predose,start_conc0"now genuinely means "predose value if one can be shifted, otherwise zero" instead of collapsing to"start_conc0"alone. One existing test pinned the overwrite and was deliberately flipped; roxygen, NEWS (flagged as behavior change), and the v08 vignette passages are updated.Verification: new tests cover add/skip/chain-with-predose/chain-without-predose (52 pass in the impute file, 568 in adjacent files); the v08 vignette purls clean against the new code.
Note: the PKNCA book documents the old collapse behavior and will need a matching follow-up once this merges.
🤖 Generated with Claude Code