def distance(self): """ Return the evaluated distance in meters from the distance meter. (Note: this is the ideal distance without any objets on the side, you might have to adapt it depending on your construction) """ raw_data = self.raw_distance if raw_data is UNAVAILABLE: return UNAVAILABLE return interpolate_distance_data(raw_data)
def test_interpolation(): yield assert_equals, interpolate_distance_data(210), 0.46 yield assert_equals, interpolate_distance_data(68), 0 yield assert_equals, interpolate_distance_data(50), 0 yield assert_equals, interpolate_distance_data(175), 0.14