diff --git a/nutils/evaluable.py b/nutils/evaluable.py index d00f83c6b..076b6d079 100644 --- a/nutils/evaluable.py +++ b/nutils/evaluable.py @@ -1753,7 +1753,7 @@ def __init__(self, args: typing.Tuple[Array, ...], args_idx: typing.Tuple[typing try: shape = tuple(lengths[i] for i in out_idx) except KeyError: - raise ValueError('Output axis {} is not listed in any of the arguments.'.format(', '.join(i for i in out_idx if i not in lengths))) + raise ValueError('Output axis {} is not listed in any of the arguments.'.format(', '.join(str(i) for i in out_idx if i not in lengths))) self.args = args self.args_idx = args_idx self.out_idx = out_idx diff --git a/tests/test_evaluable.py b/tests/test_evaluable.py index fda0dc645..f05065f23 100644 --- a/tests/test_evaluable.py +++ b/tests/test_evaluable.py @@ -68,8 +68,6 @@ def assertFunctionAlmostEqual(self, actual, desired, decimal): self.assertArrayAlmostEqual(actual.eval(**evalargs), desired, decimal) with self.subTest('simplified'): self.assertArrayAlmostEqual(actual.simplified.eval(**evalargs), desired, decimal) - with self.subTest('optimized'): - self.assertArrayAlmostEqual(actual.optimized_for_numpy.eval(**evalargs), desired, decimal) if actual.dtype != bool: with self.subTest('sparse'): indices, values, shape = sparse.extract(evaluable.eval_sparse(actual, **evalargs)) diff --git a/tests/test_function.py b/tests/test_function.py index e2f21baa5..d28554f4d 100644 --- a/tests/test_function.py +++ b/tests/test_function.py @@ -1187,11 +1187,11 @@ def test_lower(self): points = ref.getpoints('bezier', 4) coordinates = evaluable.constant(points.coords) lowerargs = function.LowerArgs.for_space('X', (self.checktransforms,), evaluable.Argument('ielem', (), int), coordinates) - lowered = self.basis.lower(lowerargs) + lowered = evaluable.compile(self.basis.lower(lowerargs), stats=False) with _builtin_warnings.catch_warnings(): _builtin_warnings.simplefilter('ignore', category=evaluable.ExpensiveEvaluationWarning) for ielem in range(self.checknelems): - value = lowered.eval(ielem=ielem) + value = lowered(ielem=ielem) if value.shape[0] == 1: value = numpy.tile(value, (points.npoints, 1)) self.assertAllAlmostEqual(value, self.checkeval(ielem, points)) diff --git a/tests/test_sample.py b/tests/test_sample.py index 186143db4..6a117022f 100644 --- a/tests/test_sample.py +++ b/tests/test_sample.py @@ -56,10 +56,11 @@ def test_get_evaluable_weights(self): def test_get_lower_args(self): assert len(self.desired_transform_chains) == len(self.desired_points) == self.desired_nelems args = self.sample.get_lower_args(evaluable.Argument('ielem', (), int)) + args_points_shape = evaluable.compile(args.points_shape) for ielem, (desired_chains, desired_points) in enumerate(zip(self.desired_transform_chains, self.desired_points)): assert len(desired_chains) == len(desired_points) == len(self.desired_spaces) desired_shape = tuple(p.coords.shape[0] for p in desired_points) - actual_shape = tuple(n.__index__() for n in evaluable.Tuple(args.points_shape).eval(ielem=ielem)) + actual_shape = tuple(n.__index__() for n in args_points_shape(ielem=ielem)) self.assertEqual(actual_shape, desired_shape) offset = 0 for space, desired_chain, desired_point in zip(self.desired_spaces, desired_chains, desired_points):