Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Félix Hartmann
XyDyS
Commits
77455b97
Commit
77455b97
authored
Feb 27, 2018
by
Félix Hartmann
Browse files
[bugfix] Change in the use of 'exec" within a function to make it works
also in Python3."
parent
0fd36a3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
evolution_function.py
View file @
77455b97
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment