Repository navigation
fix: skip schedule_dosing when scenario has no drugs - #27
Merged
Merged
Conversation
The parity MATLAB exporter crashed on drugless scenarios (e.g.
clinical_progression.yaml, baseline_no_treatment.yaml — both declare
`dosing.drugs: []`) with "No match for drug name" from schedule_dosing.
Root cause: yaml_read parses an empty YAML list as `{[]}` (a 1×1 cell
containing []), not as an empty value. The existing
`~isempty(scenario.dosing.drugs)` guard sees the 1-element outer cell
and proceeds, passing an empty drug name to schedule_dosing.
Normalize the drug list first — wrap in cell, strip empty/whitespace
entries — then check emptiness against the cleaned list. If nothing's
left, skip the dosing block with a "no drugs scheduled" log line.
Verified: clinical_progression now runs end-to-end through MATLAB
(301 time points written); gvax_nivo_neoadjuvant still schedules its
3 dose objects (regression check).
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
The parity MATLAB exporter crashed on drugless scenarios (
drugs: []) with "No match for drug name" fromschedule_dosing.yaml_readparses an empty YAML list as{[]}(a 1×1 cell containing[]), so the existing~isempty(scenario.dosing.drugs)guard let an empty drug name through.Fix: normalize the drug list (wrap in cell, strip empty/whitespace entries) before the emptiness check; skip the dosing block entirely when nothing's left.
Verified
clinical_progression.yaml(drugless) — MATLAB pipeline runs end-to-end, writes 301 time pointsgvax_nivo_neoadjuvant_zheng2022.yaml(dosed) — still schedules 3 dose objects (regression check)Unblocks
test_sbi_scenario_parity[baseline_no_treatment]andtest_sbi_scenario_parity[clinical_progression]in pdac-build.