コード例 #1
0
ファイル: __init__.py プロジェクト: itdaniher/WeDoMore
    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)
コード例 #2
0
    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)
コード例 #3
0
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
コード例 #4
0
ファイル: test_distances.py プロジェクト: JCoxwell/WeDoMore
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