Exemplo n.º 1
0
 def test_AddFeatureArray(self):
     test_data = test_tools.ComplexTestData()
     pc = test_data.get_point_cloud()
     feature_add = np.array([1, 1, 1, 1, 1], dtype=int)
     utils.update_feature(pc, 'test_feature', feature_add)
     self.assertIn('test_feature', pc[keys.point])
     self.assertTrue(
         all(pc[keys.point]['test_feature']['data'] == feature_add))
Exemplo n.º 2
0
 def test_AddFeatureArrayMask(self):
     test_data = test_tools.ComplexTestData()
     pc = test_data.get_point_cloud()
     feature_add = np.array([1, 2, 3, 4], dtype=int)
     mask = np.array([1, 1, 0, 1, 1], dtype=bool)
     utils.update_feature(pc, 'test_feature', feature_add, array_mask=mask)
     self.assertIn('test_feature', pc[keys.point])
     self.assertTrue(
         all(pc[keys.point]['test_feature']['data'] == [1, 2, 0, 3, 4]))
Exemplo n.º 3
0
 def test_AddFeatureValueMaskInvalid(self):
     test_data = test_tools.ComplexTestData()
     pc = test_data.get_point_cloud()
     feature_add = 1.1
     mask = np.array([1, 1, 0, 1, 1, 1], dtype=bool)
     with pytest.raises(AssertionError):
         utils.update_feature(pc,
                              'test_feature',
                              feature_add,
                              array_mask=mask)
Exemplo n.º 4
0
 def test_AddFeatureArrayInvalid(self):
     test_data = test_tools.ComplexTestData()
     pc = test_data.get_point_cloud()
     feature_add = np.array([1, 1, 1, 1, 1, 2], dtype=int)
     with pytest.raises(AssertionError):
         utils.update_feature(pc, 'test_feature', feature_add)