Beispiel #1
0
 def test_partial_anticlockwise_turn(self):
     stroke_array = []
     stroke_array.append([800, 2])
     stroke_array.append([810, 1])
     tsb = IRBatcher(stroke_array)
     converted_ary = tsb.convert_stroke_array_to_display_array(1000)
     self.assertEquals([0], converted_ary)
Beispiel #2
0
 def test_anticlockwise_turn_spread_across_more_than_one_sample(self):
     stroke_array = []
     stroke_array.append([800, 3])
     stroke_array.append([810, 2])
     stroke_array.append([1110, 1])
     tsb = IRBatcher(stroke_array)
     converted_ary = tsb.convert_stroke_array_to_display_array(1000)
     self.assertEquals([0, -1], converted_ary)
Beispiel #3
0
 def test_turn_then_no_turn_then_turn(self):
     stroke_array = []
     tsb = IRBatcher(stroke_array)
     stroke_array.append([800, 3])
     stroke_array.append([810, 2])
     stroke_array.append([820, 1])
     stroke_array.append([2800, 3])
     stroke_array.append([2810, 2])
     stroke_array.append([2820, 1])
     converted_ary = tsb.convert_stroke_array_to_display_array(1000)
     self.assertEquals([-1, 0, -1], converted_ary)
Beispiel #4
0
 def test_two_anticlockwise_turns(self):
     stroke_array = []
     stroke_array.append([800, 2])
     stroke_array.append([810, 1])
     stroke_array.append([820, 3])
     stroke_array.append([830, 2])
     stroke_array.append([840, 1])
     stroke_array.append([850, 3])
     tsb = IRBatcher(stroke_array)
     converted_ary = tsb.convert_stroke_array_to_display_array(1000)
     self.assertEquals([-2], converted_ary)
Beispiel #5
0
 def test_multiple_full_anticlockwise_turns_spread_over_more_than_1_sample(
         self):
     stroke_array = []
     stroke_array.append([800, 3])
     stroke_array.append([810, 2])
     stroke_array.append([820, 1])
     stroke_array.append([1800, 3])
     stroke_array.append([1810, 2])
     stroke_array.append([1820, 1])
     tsb = IRBatcher(stroke_array)
     converted_ary = tsb.convert_stroke_array_to_display_array(1000)
     self.assertEquals([-1, -1], converted_ary)
Beispiel #6
0
    def __init__(self,
                 gst_img_path,
                 data_filename,
                 x,
                 trial_length,
                 display_sample,
                 layer_multiplier=1):

        #super(PreBatchGhost, self).__init__(gst_img_path, data_filename, x, trial_length, display_sample)
        #can't use super on an old style class
        Ghost.__init__(self, gst_img_path, data_filename, x, layer_multiplier)

        tb = TimestampBatcher(self.timestamp_ary)
        self.batched_ts_ary = []
        self.batched_ts_ary = tb.convert_ts_array_to_display_array(
            trial_length, display_sample)

        irtb = IRBatcher(self.ir_timestamp_ary)
        self.batched_ir_ts_ary = []
        self.batched_ir_ts_ary = irtb.convert_stroke_array_to_display_array(
            display_sample)

        self.sample_index = 0
        self.stroke_index = 0
Beispiel #7
0
 def test_empty_stroke_array(self):
     stroke_array = []
     tsb = IRBatcher(stroke_array)
     converted_ary = tsb.convert_stroke_array_to_display_array(1000)
     self.assertEquals([], converted_ary)