@@ -445,7 +445,9 @@ def test_exec_sed_task_error_handling_with_biosimulators(self):
445
445
def test_exec_sed_task_with_preprocesssed_task (self ):
446
446
# configure simulation
447
447
task = sedml_data_model .Task (
448
+ id = "task1" ,
448
449
model = sedml_data_model .Model (
450
+ id = "model1" ,
449
451
source = self .EXAMPLE_MODEL_FILENAME ,
450
452
language = sedml_data_model .ModelLanguage .SBML .value ,
451
453
changes = [
@@ -522,9 +524,9 @@ def test_exec_sed_task_with_preprocesssed_task(self):
522
524
variable_results , log = core .exec_sed_task (task , variables , preprocessed_task = preprocessed_task )
523
525
with self .assertRaises (AssertionError ):
524
526
numpy .testing .assert_allclose (variable_results ['C' ][- 1 ], end_c )
525
- mid_c = preprocessed_task .road_runner ['C' ]
526
- mid_m = preprocessed_task .road_runner ['M' ]
527
- mid_x = preprocessed_task .road_runner ['X' ]
527
+ mid_c = preprocessed_task .road_runners [ task . id ] ['C' ]
528
+ mid_m = preprocessed_task .road_runners [ task . id ] ['M' ]
529
+ mid_x = preprocessed_task .road_runners [ task . id ] ['X' ]
528
530
self .assertIsInstance (mid_c , float )
529
531
530
532
variable_results , log = core .exec_sed_task (task , variables , preprocessed_task = preprocessed_task )
@@ -547,6 +549,8 @@ def test_exec_sed_task_with_preprocesssed_task(self):
547
549
new_value = mid_x ,
548
550
),
549
551
]
552
+ for change in task .model .changes :
553
+ change .model = task .model .id
550
554
preprocessed_task = core .preprocess_sed_task (task , variables )
551
555
variable_results , log = core .exec_sed_task (task , variables , preprocessed_task = preprocessed_task )
552
556
numpy .testing .assert_allclose (variable_results ['C' ][- 1 ], end_c )
@@ -581,6 +585,9 @@ def test_exec_sed_task_with_preprocesssed_task(self):
581
585
new_value = str (mid_x ),
582
586
),
583
587
]
588
+ for change in task .model .changes :
589
+ change .model = task .model .id
590
+ preprocessed_task = core .preprocess_sed_task (task , variables )
584
591
variable_results , log = core .exec_sed_task (task , variables , preprocessed_task = preprocessed_task )
585
592
numpy .testing .assert_allclose (variable_results ['C' ][- 1 ], end_c )
586
593
@@ -751,8 +758,6 @@ def test_exec_sedml_docs_in_combine_archive(self):
751
758
if log .exception :
752
759
raise log .exception
753
760
754
- self ._assert_curated_combine_archive_outputs (dirname , reports = True , plots = True )
755
-
756
761
def test_exec_sedml_docs_in_combine_archive_with_all_algorithms (self ):
757
762
for sedml_interpreter in SedmlInterpreter .__members__ .values ():
758
763
for alg in gen_algorithms_from_specs (self .SPECIFICATIONS_FILENAME ).values ():
@@ -824,6 +829,57 @@ def test_sim_with_docker_image(self):
824
829
825
830
self ._assert_curated_combine_archive_outputs (self .dirname , reports = True , plots = True )
826
831
832
+ def test_repeated_task_with_change (self ):
833
+ for sedml_interpreter in SedmlInterpreter .__members__ .values ():
834
+ simulator_config = SimulatorConfig ()
835
+ simulator_config .sedml_interpreter = sedml_interpreter
836
+
837
+ archive_filename = 'tests/fixtures/repeat_basic.omex'
838
+
839
+ dirname = os .path .join (self .dirname , sedml_interpreter .name , 'reports' )
840
+ _ , log = core .exec_sedml_docs_in_combine_archive (archive_filename , dirname , simulator_config = simulator_config )
841
+ if log .exception :
842
+ raise log .exception
843
+
844
+
845
+ def test_repeated_task_with_change_and_no_reset (self ):
846
+ for sedml_interpreter in SedmlInterpreter .__members__ .values ():
847
+ simulator_config = SimulatorConfig ()
848
+ simulator_config .sedml_interpreter = sedml_interpreter
849
+
850
+ archive_filename = 'tests/fixtures/repeat_no_reset.omex'
851
+
852
+ dirname = os .path .join (self .dirname , sedml_interpreter .name , 'reports' )
853
+ _ , log = core .exec_sedml_docs_in_combine_archive (archive_filename , dirname , simulator_config = simulator_config )
854
+ if log .exception :
855
+ raise log .exception
856
+
857
+
858
+ def test_repeated_task_with_change_to_initial_assignment (self ):
859
+ for sedml_interpreter in SedmlInterpreter .__members__ .values ():
860
+ simulator_config = SimulatorConfig ()
861
+ simulator_config .sedml_interpreter = sedml_interpreter
862
+
863
+ archive_filename = 'tests/fixtures/repeat_initial_assignment.omex'
864
+
865
+ dirname = os .path .join (self .dirname , sedml_interpreter .name , 'reports' )
866
+ _ , log = core .exec_sedml_docs_in_combine_archive (archive_filename , dirname , simulator_config = simulator_config )
867
+ if log .exception :
868
+ raise log .exception
869
+
870
+
871
+ def test_change_to_initial_assignment (self ):
872
+ for sedml_interpreter in SedmlInterpreter .__members__ .values ():
873
+ simulator_config = SimulatorConfig ()
874
+ simulator_config .sedml_interpreter = sedml_interpreter
875
+
876
+ archive_filename = 'tests/fixtures/change_initial_assignment.omex'
877
+
878
+ dirname = os .path .join (self .dirname , sedml_interpreter .name , 'reports' )
879
+ _ , log = core .exec_sedml_docs_in_combine_archive (archive_filename , dirname , simulator_config = simulator_config )
880
+ if log .exception :
881
+ raise log .exception
882
+
827
883
# helper methods
828
884
def _get_combine_archive_exec_env (self ):
829
885
return {
0 commit comments