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
Zahra Rajabi
pymdptoolbox
Commits
99b18251
Commit
99b18251
authored
Sep 11, 2013
by
Steven Cordwell
Browse files
rename tests to reflect name of modules
parent
966a1f43
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/tests/test_examples.py
View file @
99b18251
...
...
@@ -12,7 +12,7 @@ import mdptoolbox.example
from
.utils
import
ACTIONS
,
STATES
,
P_forest
,
R_forest
,
P_rand
,
R_rand
from
.utils
import
P_rand_sparse
,
R_rand_sparse
def
test_example
F
orest_P_shape
():
def
test_example
_f
orest_P_shape
():
assert
(
P_forest
==
np
.
array
([[[
0.1
,
0.9
,
0.0
],
[
0.1
,
0.0
,
0.9
],
[
0.1
,
0.0
,
0.9
]],
...
...
@@ -20,35 +20,35 @@ def test_exampleForest_P_shape():
[
1
,
0
,
0
],
[
1
,
0
,
0
]]])).
all
()
def
test_example
F
orest_R_shape
():
def
test_example
_f
orest_R_shape
():
assert
(
R_forest
==
np
.
array
([[
0
,
0
],
[
0
,
1
],
[
4
,
2
]])).
all
()
def
test_example
F
orest_check
():
def
test_example
_f
orest_check
():
P
,
R
=
mdptoolbox
.
example
.
forest
(
10
,
5
,
3
,
0.2
)
assert
mdptoolbox
.
utils
.
check
(
P
,
R
)
==
None
# exampleRand
def
test_example
R
and_dense_P_shape
():
def
test_example
_r
and_dense_P_shape
():
assert
(
P_rand
.
shape
==
(
ACTIONS
,
STATES
,
STATES
))
def
test_example
R
and_dense_R_shape
():
def
test_example
_r
and_dense_R_shape
():
assert
(
R_rand
.
shape
==
(
ACTIONS
,
STATES
,
STATES
))
def
test_example
R
and_dense_check
():
def
test_example
_r
and_dense_check
():
assert
mdptoolbox
.
utils
.
check
(
P_rand
,
R_rand
)
==
None
def
test_example
R
and_sparse_P_shape
():
def
test_example
_r
and_sparse_P_shape
():
assert
(
len
(
P_rand_sparse
)
==
ACTIONS
)
for
a
in
range
(
ACTIONS
):
assert
(
P_rand_sparse
[
a
].
shape
==
(
STATES
,
STATES
))
def
test_example
R
and_sparse_R_shape
():
def
test_example
_r
and_sparse_R_shape
():
assert
(
len
(
R_rand_sparse
)
==
ACTIONS
)
for
a
in
range
(
ACTIONS
):
assert
(
R_rand_sparse
[
a
].
shape
==
(
STATES
,
STATES
))
def
test_example
R
and_sparse_check
():
def
test_example
_r
and_sparse_check
():
assert
mdptoolbox
.
utils
.
check
(
P_rand_sparse
,
R_rand_sparse
)
==
None
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