Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
866b4ab0
Commit
866b4ab0
authored
Jan 25, 2018
by
Philipp Arras
Browse files
Merge branch 'NIFTy_4' into PlottingWithUnits
parents
f44986c7
e4e5039f
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty4/domain_object.py
View file @
866b4ab0
...
@@ -111,7 +111,6 @@ class DomainObject(with_metaclass(
...
@@ -111,7 +111,6 @@ class DomainObject(with_metaclass(
"""
"""
return
self
.
scalar_dvol
()
return
self
.
scalar_dvol
()
@
property
def
total_volume
(
self
):
def
total_volume
(
self
):
tmp
=
self
.
dvol
()
tmp
=
self
.
dvol
()
return
self
.
dim
*
tmp
if
np
.
isscalar
(
tmp
)
else
np
.
sum
(
tmp
)
return
self
.
dim
*
tmp
if
np
.
isscalar
(
tmp
)
else
np
.
sum
(
tmp
)
test/test_operators/test_fft_operator.py
View file @
866b4ab0
...
@@ -151,14 +151,23 @@ class FFTOperatorTests(unittest.TestCase):
...
@@ -151,14 +151,23 @@ class FFTOperatorTests(unittest.TestCase):
assert_allclose
(
v1
,
v2
,
rtol
=
tol
,
atol
=
tol
)
assert_allclose
(
v1
,
v2
,
rtol
=
tol
,
atol
=
tol
)
@
expand
(
product
([
ift
.
RGSpace
(
128
,
distances
=
3.76
,
harmonic
=
True
),
@
expand
(
product
([
ift
.
RGSpace
(
128
,
distances
=
3.76
,
harmonic
=
True
),
ift
.
RGSpace
((
15
,
27
),
distances
=
(
1.7
,
3.33
),
harmonic
=
True
),
ift
.
RGSpace
(
73
,
distances
=
0.5643
),
ift
.
RGSpace
(
73
,
distances
=
0.5643
),
ift
.
LMSpace
(
lmax
=
30
,
mmax
=
25
)],
ift
.
LMSpace
(
lmax
=
30
,
mmax
=
25
)],
[
np
.
float64
,
np
.
float32
,
np
.
complex64
,
np
.
complex128
]))
[
np
.
float64
,
np
.
float32
,
np
.
complex64
,
np
.
complex128
]))
def
test_normalisation
(
self
,
space
,
tp
):
def
test_normalisation
(
self
,
space
,
tp
):
tol
=
10
*
_get_rtol
(
tp
)
tol
=
10
*
_get_rtol
(
tp
)
fft
=
ift
.
FFTOperator
(
space
)
cospace
=
space
.
get_default_codomain
()
fft
=
ift
.
FFTOperator
(
space
,
cospace
)
inp
=
ift
.
Field
.
from_random
(
domain
=
space
,
random_type
=
'normal'
,
inp
=
ift
.
Field
.
from_random
(
domain
=
space
,
random_type
=
'normal'
,
std
=
1
,
mean
=
2
,
dtype
=
tp
)
std
=
1
,
mean
=
2
,
dtype
=
tp
)
out
=
fft
.
times
(
inp
)
out
=
fft
.
times
(
inp
)
assert_allclose
(
ift
.
dobj
.
to_global_data
(
inp
.
val
)[
0
],
out
.
integrate
(),
fft2
=
ift
.
FFTOperator
(
cospace
,
space
)
out2
=
fft2
.
inverse_times
(
inp
)
zero_idx
=
tuple
([
0
]
*
len
(
space
.
shape
))
assert_allclose
(
ift
.
dobj
.
to_global_data
(
inp
.
val
)[
zero_idx
],
out
.
integrate
(),
rtol
=
tol
,
atol
=
tol
)
assert_allclose
(
ift
.
dobj
.
to_global_data
(
out
.
val
),
ift
.
dobj
.
to_global_data
(
out2
.
val
),
rtol
=
tol
,
atol
=
tol
)
rtol
=
tol
,
atol
=
tol
)
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