def test_locate_wrong_shape(self): nodes = np.asfortranarray([ [0.0, 0.0], [1.0, 1.0], ]) curve = self._make_one(nodes, 1) point = np.asfortranarray([[0.0, 1.0, 2.0]]) with self.assertRaises(ValueError): curve.locate(point)
def test_locate(self): nodes = np.asfortranarray([[0.0, 1.0, 2.0, 5.0], [0.0, 1.0, -1.0, 1.0]]) curve = self._make_one(nodes, 3) s_val = 0.75 point = curve.evaluate(s_val) result = curve.locate(point) self.assertEqual(result, s_val)