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
b57f2cfd
Commit
b57f2cfd
authored
Apr 01, 2020
by
Martin Reinecke
Browse files
more tests
parent
6e9dca27
Pipeline
#71955
passed with stages
in 15 minutes and 7 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
test/test_random.py
View file @
b57f2cfd
...
...
@@ -80,6 +80,19 @@ def test_rand5():
np
.
testing
.
assert_equal
(
a
,
b
)
np
.
testing
.
assert_equal
(
c
,
d
)
def
test_rand5b
():
with
ift
.
random
.
Context
(
31
):
a
=
ift
.
random
.
current_rng
().
integers
(
0
,
1000000000
)
with
ift
.
random
.
Context
(
31
):
b
=
ift
.
random
.
current_rng
().
integers
(
0
,
1000000000
)
c
=
ift
.
random
.
current_rng
().
integers
(
0
,
1000000000
)
d
=
ift
.
random
.
current_rng
().
integers
(
0
,
1000000000
)
check_state_back_to_orig
()
np
.
testing
.
assert_equal
(
a
,
b
)
np
.
testing
.
assert_equal
(
c
,
d
)
def
test_rand6
():
ift
.
random
.
push_sseq_from_seed
(
31
)
state
=
ift
.
random
.
getState
()
...
...
@@ -90,3 +103,12 @@ def test_rand6():
ift
.
random
.
pop_sseq
()
check_state_back_to_orig
()
def
test_rand6b
():
with
ift
.
random
.
Context
(
31
):
state
=
ift
.
random
.
getState
()
a
=
ift
.
random
.
current_rng
().
integers
(
0
,
1000000000
)
ift
.
random
.
setState
(
state
)
b
=
ift
.
random
.
current_rng
().
integers
(
0
,
1000000000
)
np
.
testing
.
assert_equal
(
a
,
b
)
check_state_back_to_orig
()
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