Skip to content

fix: skip schedule_dosing when scenario has no drugs - #27

Merged
jeliason merged 1 commit into
mainfrom
fix/parity-drugless-scenarios
May 12, 2026
Merged

jeliason merged 1 commit into
mainfrom
fix/parity-drugless-scenarios

Conversation

@jeliason

Copy link
Copy Markdown
Member

Summary

The parity MATLAB exporter crashed on drugless scenarios (drugs: []) with "No match for drug name" from schedule_dosing. yaml_read parses 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 points
  • gvax_nivo_neoadjuvant_zheng2022.yaml (dosed) — still schedules 3 dose objects (regression check)

Unblocks test_sbi_scenario_parity[baseline_no_treatment] and test_sbi_scenario_parity[clinical_progression] in pdac-build.

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).
@jeliason
jeliason merged commit 86d2bed into main May 12, 2026
2 checks passed
@jeliason
jeliason deleted the fix/parity-drugless-scenarios branch May 12, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant