コード例 #1
0
ファイル: test_feature.py プロジェクト: vanthaiunghoa/kwiver
    def test_set_location(self):
        f = Feature(ctype='d')
        expected = [random.random(), random.random()]
        f.location = expected
        # making sure that we went through the setter, and not just setting the
        # exact value to the property
        numpy.testing.assert_almost_equal(f.location, expected, 16)

        f = Feature(ctype='f')
        expected = [random.random(), random.random()]
        f.location = expected
        numpy.testing.assert_almost_equal(f.location, expected, 6)
コード例 #2
0
    def test_set_location(self):
        f = Feature(ctype=ctypes.c_double)
        expected = [[random.random()], [random.random()]]
        f.location = expected
        # making sure that we went through the setter, and not just setting the
        # exact value to the property
        nose.tools.assert_is_instance(f.location, EigenArray)
        numpy.testing.assert_almost_equal(f.location, expected, 16)

        f = Feature(ctype=ctypes.c_float)
        expected = [[random.random()], [random.random()]]
        f.location = expected
        nose.tools.assert_is_instance(f.location, EigenArray)
        numpy.testing.assert_almost_equal(f.location, expected, 6)
コード例 #3
0
ファイル: test_feature.py プロジェクト: Kitware/kwiver
    def test_set_location(self):
        f = Feature(ctype='d')
        expected = [random.random(),
                    random.random()]
        f.location = expected
        # making sure that we went through the setter, and not just setting the
        # exact value to the property
        numpy.testing.assert_almost_equal(f.location, expected, 16)

        f = Feature(ctype='f')
        expected = [random.random(),
                    random.random()]
        f.location = expected
        numpy.testing.assert_almost_equal(f.location, expected, 6)
コード例 #4
0
ファイル: test_feature.py プロジェクト: ALouis38/vital
    def test_set_location(self):
        f = Feature(ctype=ctypes.c_double)
        expected = [[random.random()],
                    [random.random()]]
        f.location = expected
        # making sure that we went through the setter, and not just setting the
        # exact value to the property
        nose.tools.assert_is_instance(f.location, EigenArray)
        numpy.testing.assert_almost_equal(f.location, expected, 16)

        f = Feature(ctype=ctypes.c_float)
        expected = [[random.random()],
                    [random.random()]]
        f.location = expected
        nose.tools.assert_is_instance(f.location, EigenArray)
        numpy.testing.assert_almost_equal(f.location, expected, 6)