Commit 77455b97 authored by Félix Hartmann's avatar Félix Hartmann
Browse files

[bugfix] Change in the use of 'exec" within a function to make it works

also in Python3."
parent 0fd36a3f
......@@ -138,10 +138,11 @@ class UserDefined(EvolutionFunction):
def f(self, X):
"""The actual performative function itself."""
exec(self.function_definition) # define a function f
namespace = {}
exec(self.function_definition, namespace) # define a function f
Y = np.zeros(len(X))
for i, x in enumerate(X):
Y[i] = f(x)
Y[i] = namespace['f'](x)
return Y
traits_view = View(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment