@@ -463,6 +463,43 @@ def test_genuinely_missing_output_parameter_still_reported():
463463 assert not any ("net1_output2" in issue .message for issue in results )
464464
465465
466+ # ---------------------------------------------------------------------------
467+ # Experiment -> SBML conversion
468+ # ---------------------------------------------------------------------------
469+
470+ def test_convert_experiments_with_array_data_condition_ids ():
471+ """Conditions defined only in array files are skipped in every period.
472+ """
473+ from petab .v2 .converters import ExperimentsToSbmlConverter
474+
475+ problem = _get_test_problem ()
476+ assert not problem .conditions , "cond1 must not be in the condition table"
477+ array_condition_ids = (
478+ problem .extensions .sciml ._get_array_data_condition_ids ()
479+ )
480+ assert array_condition_ids == {"cond1" }
481+
482+ # Add preequilibration and simulation periods
483+ periods = [(- float ("inf" ), "cond1" ), (0.0 , "cond1" )]
484+ problem .experiments [0 ].periods = [
485+ ExperimentPeriod (time = time , condition_ids = [condition_id ])
486+ for time , condition_id in periods
487+ ]
488+
489+ converted = ExperimentsToSbmlConverter (problem ).convert ()
490+
491+ # No events defined for conditions given by array data
492+ sbml_model = converted .model .sbml_model
493+ assigned_targets = {
494+ ia .getSymbol () for ia in sbml_model .getListOfInitialAssignments ()
495+ } | {
496+ ea .getVariable ()
497+ for event in sbml_model .getListOfEvents ()
498+ for ea in event .getListOfEventAssignments ()
499+ }
500+ assert "net1_input2" not in assigned_targets
501+
502+
466503# ---------------------------------------------------------------------------
467504# Full-problem integration
468505# ---------------------------------------------------------------------------
0 commit comments