Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
5596655d
Commit
5596655d
authored
Jul 14, 2017
by
Martin Reinecke
Browse files
avoid exec statements; they cause problems with Python 3
parent
dd87b630
Pipeline
#14884
passed with stage
in 6 minutes and 20 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/field.py
View file @
5596655d
...
...
@@ -18,6 +18,7 @@
from
__future__
import
division
import
ast
import
itertools
import
numpy
as
np
...
...
@@ -1519,7 +1520,8 @@ class Field(Loggable, Versionable, object):
temp_domain
.
append
(
repository
.
get
(
's_'
+
str
(
i
),
hdf5_group
))
new_field
.
domain
=
tuple
(
temp_domain
)
exec
(
'new_field.domain_axes = '
+
hdf5_group
.
attrs
[
'domain_axes'
])
new_field
.
domain_axes
=
ast
.
literal_eval
(
hdf5_group
.
attrs
[
'domain_axes'
])
try
:
new_field
.
_val
=
repository
.
get
(
'val'
,
hdf5_group
)
...
...
nifty/spaces/power_space/power_space.py
View file @
5596655d
...
...
@@ -16,6 +16,7 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
import
ast
import
numpy
as
np
from
d2o
import
distributed_data_object
...
...
@@ -311,6 +312,6 @@ class PowerSpace(Space):
@
classmethod
def
_from_hdf5
(
cls
,
hdf5_group
,
repository
):
hp
=
repository
.
get
(
'harmonic_partner'
,
hdf5_group
)
exec
(
"bb = "
+
hdf5_group
.
attrs
[
'binbounds'
])
bb
=
ast
.
literal_eval
(
hdf5_group
.
attrs
[
'binbounds'
])
ds
=
hdf5_group
.
attrs
[
'distribution_strategy'
]
return
PowerSpace
(
hp
,
ds
,
binbounds
=
bb
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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