fix: keep generated datasets readable for simulation and bootstrap - #147
Open
nptaylor-irx wants to merge 1 commit into
Open
nptaylor-irx wants to merge 1 commit into
nptaylor-irx wants to merge 1 commit into
Conversation
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.
Fixes CSV header parsing failures that blocked simulation and bootstrap during the Sep 16 Astra bug bash. Generated datasets now remain readable when loaded and written into a run folder.
What failed and why
"TAI"as a number. Passing a CSV filename tocreate_model_from_file()bypassed the unquoted rewrite used for data frames;IGNORE=@does not skip a row starting with a quote.IDandEVID: those models had no characterIGNORErule, so unquoting alone could not fix them.The fix
A shared writer binds the working CSV and its model’s
$DATArecord together. It writes unquoted data fields and makes the header match the existing characterIGNORErule, addingIGNORE=#when none exists. Run-folder preparation uses the same writer so it cannot undo the repair.Existing character and conditional filters,
$INPUTDROP flags, column order, and NONMEM null behavior are preserved. Source files are untouched. BlanketIGNORE=@would broaden some existing filters and silently discard valid rows, so the fix preserves each model’s rule. Package version:0.0.0.9141.Validation
Regression tests reproduce both failures and cover CSV/data-frame inputs, filters, DROP columns, source preservation, nulls, and reloading prepared models. Focused tests passed on Pharmpy 2.0 (8 skips: 7 runtime-dependent and 1 explicitly skipped); loader tests passed on Pharmpy 1.8 with no skips. Full NONMEM simulation/bootstrap execution was not run.
After merge, rebuild the
pharma_ai_rimage with this package version and run simulation/bootstrap smoke tests.Related: Sep 16 bug-bash feedback.