@@ -477,22 +477,29 @@ def test_termination(self):
477477 def test_search_tag (self ):
478478 experiment = pybamm .Experiment (
479479 [
480- "Discharge at 1C for 0.5 hours [tag1]" ,
480+ (
481+ "Discharge at 1C for 0.5 hours [tag1]" ,
482+ ),
481483 "Discharge at C/20 for 0.5 hours [tag2,tag3]" ,
482- "Charge at 0.5 C for 45 minutes" ,
483- "Discharge at 1 A for 0.5 hours" ,
484- "Charge at 200 mA for 45 minutes (1 minute period)" ,
485- "Discharge at 1W for 0.5 hours" ,
486- "Charge at 200mW for 45 minutes" ,
487- "Rest for 10 minutes (5 minute period) [tag1,tag3]" ,
488- ],
489- period = "20 seconds" ,
484+ (
485+ "Charge at 0.5 C for 45 minutes [tag2]" ,
486+ "Discharge at 1 A for 0.5 hours [tag3]" ,
487+ ),
488+ "Charge at 200 mA for 45 minutes (1 minute period) [tag5]" ,
489+ (
490+ "Discharge at 1W for 0.5 hours [tag4]" ,
491+ "Charge at 200mW for 45 minutes [tag4]" ,
492+ ),
493+ "Rest for 10 minutes (5 minute period) [tag1,tag3,tag4]" ,
494+ ]
490495 )
491496
492- self .assertEqual (experiment .search_tag ("tag1" ), [0 , 7 ])
493- self .assertEqual (experiment .search_tag ("tag2" ), [1 ])
494- self .assertEqual (experiment .search_tag ("tag3" ), [1 , 7 ])
495- self .assertEqual (experiment .search_tag ("tag4" ), [])
497+ self .assertEqual (experiment .search_tag ("tag1" ), [0 , 5 ])
498+ self .assertEqual (experiment .search_tag ("tag2" ), [1 , 2 ])
499+ self .assertEqual (experiment .search_tag ("tag3" ), [1 , 2 , 5 ])
500+ self .assertEqual (experiment .search_tag ("tag4" ), [4 , 5 ])
501+ self .assertEqual (experiment .search_tag ("tag5" ), [3 ])
502+ self .assertEqual (experiment .search_tag ("no_tag" ), [])
496503
497504
498505if __name__ == "__main__" :
0 commit comments