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
1be2685f
Commit
1be2685f
authored
Jul 18, 2018
by
Reimar H Leike
Browse files
some tweaks to make test deterministic
parent
520e69e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test_operators/test_adjoint.py
View file @
1be2685f
...
...
@@ -39,18 +39,13 @@ class Consistency_Tests(unittest.TestCase):
+
_pow_spaces
,
[
np
.
float64
,
np
.
complex128
]))
def
testDOFDistributor
(
self
,
sp
,
dtype
):
#TODO: Test for DomainTuple
if
sp
.
size
<
4
:
return
N_tries
=
10
for
i
in
range
(
N_tries
):
try
:
dofdex
=
np
.
random
.
choice
(
np
.
arange
(
3
),
size
=
sp
.
shape
)
dofdex
=
ift
.
Field
.
from_global_data
(
sp
,
dofdex
)
op
=
ift
.
DOFDistributor
(
dofdex
)
ift
.
extra
.
consistency_check
(
op
,
dtype
,
dtype
)
return
except
ValueError
:
pass
dofdex
=
np
.
arange
(
sp
.
size
).
reshape
(
sp
.
shape
)
%
3
dofdex
=
ift
.
Field
.
from_global_data
(
sp
,
dofdex
)
op
=
ift
.
DOFDistributor
(
dofdex
)
ift
.
extra
.
consistency_check
(
op
,
dtype
,
dtype
)
@
expand
(
product
(
_h_spaces
,
[
np
.
float64
,
np
.
complex128
]))
...
...
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