@@ -136,21 +136,21 @@ def test_biggest_comma_fan(self):
136
136
# engaged, invisible driver, down to orange, driver touches wheel; then down to orange again, driver appears
137
137
# - both actions should clear the alert, but momentary appearance should not
138
138
def test_sometimes_transparent_commuter (self ):
139
- _visible_time = np .random .choice ([0.5 , 10 ])
140
- ds_vector = always_no_face [:]* 2
141
- interaction_vector = always_false [:]* 2
142
- ds_vector [int ((2 * INVISIBLE_SECONDS_TO_ORANGE + 1 )/ DT_DMON ):int ((2 * INVISIBLE_SECONDS_TO_ORANGE + 1 + _visible_time )/ DT_DMON )] = [msg_ATTENTIVE ] * int (_visible_time / DT_DMON )
143
- interaction_vector [int ((INVISIBLE_SECONDS_TO_ORANGE )/ DT_DMON ):int ((INVISIBLE_SECONDS_TO_ORANGE + 1 )/ DT_DMON )] = [True ] * int (1 / DT_DMON )
144
- events , _ = self ._run_seq (ds_vector , interaction_vector , 2 * always_true , 2 * always_false )
145
- self .assertTrue (len (events [int (INVISIBLE_SECONDS_TO_ORANGE * 0.5 / DT_DMON )]) == 0 )
146
- self .assertEqual (events [int ((INVISIBLE_SECONDS_TO_ORANGE - 0.1 )/ DT_DMON )].names [0 ], EventName .promptDriverUnresponsive )
147
- self .assertTrue (len (events [int ((INVISIBLE_SECONDS_TO_ORANGE + 0.1 )/ DT_DMON )]) == 0 )
148
- if _visible_time == 0.5 :
149
- self .assertEqual (events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 - 0.1 )/ DT_DMON )].names [0 ], EventName .promptDriverUnresponsive )
150
- self .assertEqual (events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 + 0.1 + _visible_time )/ DT_DMON )].names [0 ], EventName .preDriverUnresponsive )
151
- elif _visible_time == 10 :
152
- self .assertEqual (events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 - 0.1 )/ DT_DMON )].names [0 ], EventName .promptDriverUnresponsive )
153
- self .assertTrue (len (events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 + 0.1 + _visible_time )/ DT_DMON )]) == 0 )
139
+ _visible_time = np .random .choice ([0.5 , 10 ])
140
+ ds_vector = always_no_face [:]* 2
141
+ interaction_vector = always_false [:]* 2
142
+ ds_vector [int ((2 * INVISIBLE_SECONDS_TO_ORANGE + 1 )/ DT_DMON ):int ((2 * INVISIBLE_SECONDS_TO_ORANGE + 1 + _visible_time )/ DT_DMON )] = [msg_ATTENTIVE ] * int (_visible_time / DT_DMON )
143
+ interaction_vector [int ((INVISIBLE_SECONDS_TO_ORANGE )/ DT_DMON ):int ((INVISIBLE_SECONDS_TO_ORANGE + 1 )/ DT_DMON )] = [True ] * int (1 / DT_DMON )
144
+ events , _ = self ._run_seq (ds_vector , interaction_vector , 2 * always_true , 2 * always_false )
145
+ self .assertTrue (len (events [int (INVISIBLE_SECONDS_TO_ORANGE * 0.5 / DT_DMON )]) == 0 )
146
+ self .assertEqual (events [int ((INVISIBLE_SECONDS_TO_ORANGE - 0.1 )/ DT_DMON )].names [0 ], EventName .promptDriverUnresponsive )
147
+ self .assertTrue (len (events [int ((INVISIBLE_SECONDS_TO_ORANGE + 0.1 )/ DT_DMON )]) == 0 )
148
+ if _visible_time == 0.5 :
149
+ self .assertEqual (events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 - 0.1 )/ DT_DMON )].names [0 ], EventName .promptDriverUnresponsive )
150
+ self .assertEqual (events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 + 0.1 + _visible_time )/ DT_DMON )].names [0 ], EventName .preDriverUnresponsive )
151
+ elif _visible_time == 10 :
152
+ self .assertEqual (events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 - 0.1 )/ DT_DMON )].names [0 ], EventName .promptDriverUnresponsive )
153
+ self .assertTrue (len (events [int ((INVISIBLE_SECONDS_TO_ORANGE * 2 + 1 + 0.1 + _visible_time )/ DT_DMON )]) == 0 )
154
154
155
155
# engaged, invisible driver, down to red, driver appears and then touches wheel, then disengages/reengages
156
156
# - only disengage will clear the alert
0 commit comments