diff --git a/nutils/evaluable.py b/nutils/evaluable.py index 81bd2c51b..0dc59bf54 100644 --- a/nutils/evaluable.py +++ b/nutils/evaluable.py @@ -3483,7 +3483,7 @@ def evalf(self, shape, length, *args): def evalf_withtimes(self, times, shape, length, *args): serialized = self._serialized - times[self] = subtimes = collections.defaultdict(_Stats) + subtimes = times.setdefault(self, collections.defaultdict(_Stats)) result = numpy.zeros(shape, self.dtype) for index in range(length): values = [numpy.array(index)] @@ -3686,7 +3686,7 @@ def evalf(self, shapes, length, *args): def evalf_withtimes(self, times, shapes, length, *args): serialized = self._serialized - times[self] = subtimes = collections.defaultdict(_Stats) + subtimes = times.setdefault(self, collections.defaultdict(_Stats)) results = [parallel.shempty(tuple(map(int, shape)), dtype=func.dtype) for func, shape in zip(self._funcs, shapes)] for index in range(length): values = [numpy.array(index)]