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
706b4326
Commit
706b4326
authored
Nov 13, 2017
by
Martin Reinecke
Browse files
fixes
parent
57ef1b82
Pipeline
#21470
passed with stage
in 4 minutes and 28 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/data_objects/distributed_do.py
View file @
706b4326
...
...
@@ -233,10 +233,10 @@ class data_object(object):
return
data_object
(
self
.
_shape
,
np
.
abs
(
self
.
_data
),
self
.
_distaxis
)
def
all
(
self
):
return
self
.
_data
.
all
()
return
self
.
sum
()
==
self
.
size
def
any
(
self
):
return
self
.
_data
.
any
()
return
self
.
sum
()
!=
0
def
full
(
shape
,
fill_value
,
dtype
=
None
,
distaxis
=
0
):
...
...
nifty/operators/fft_operator_support.py
View file @
706b4326
...
...
@@ -82,8 +82,12 @@ class RGRGTransformation(Transformation):
Tval
=
Field
(
tdom
,
tmp
)
else
:
ldat
=
dobj
.
local_data
(
x
.
val
)
ldat
=
fftn
(
ldat
,
axes
=
axes
)
ldat
=
ldat
.
real
+
ldat
.
imag
# these two alternatives are equivalent, with the second being faster
if
False
:
ldat
=
fftn
(
ldat
,
axes
=
axes
)
ldat
=
ldat
.
real
+
ldat
.
imag
else
:
ldat
=
hartley
(
ldat
,
axes
=
axes
)
tmp
=
dobj
.
from_local_data
(
x
.
val
.
shape
,
ldat
,
distaxis
=
dobj
.
distaxis
(
x
.
val
))
Tval
=
Field
(
tdom
,
tmp
)
fct
=
self
.
fct_p2h
if
p2h
else
self
.
fct_h2p
...
...
nifty/spaces/power_space.py
View file @
706b4326
...
...
@@ -153,6 +153,10 @@ class PowerSpace(Space):
temp_k_lengths
=
np
.
bincount
(
dobj
.
local_data
(
temp_pindex
).
ravel
(),
weights
=
dobj
.
local_data
(
k_length_array
.
val
).
ravel
(),
minlength
=
nbin
)
# This conversion is necessary because bincount sometimes returns
# its result as an integer array, even when floating-point weights
# are present ...
temp_k_lengths
=
temp_k_lengths
.
astype
(
np
.
float64
)
temp_k_lengths
=
dobj
.
np_allreduce_sum
(
temp_k_lengths
)
/
temp_rho
temp_dvol
=
temp_rho
*
pdvol
self
.
_powerIndexCache
[
key
]
=
(
binbounds
,
...
...
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