Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
funpack
Commits
7e254bd4
Commit
7e254bd4
authored
Mar 03, 2021
by
Paul McCarthy
🚵
Browse files
TEST: I think it's fair to require navalues/rawlevels/newlevels to be numpy
arrays and not lists
parent
3f00b4b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
funpack/tests/test_cleaning.py
View file @
7e254bd4
...
...
@@ -298,7 +298,7 @@ def test_applyNewLevels():
codes1
=
np
.
random
.
randint
(
100
,
200
,
10
)
codes2
=
np
.
random
.
randint
(
100
,
200
,
10
)
codes3
=
list
(
reversed
(
range
(
10
))
)
codes3
=
np
.
arange
(
9
,
-
1
,
-
1
)
exp1
=
[
codes1
[
data
[
i
,
1
]]
for
i
in
range
(
50
)]
exp2
=
[
codes2
[
data
[
i
,
2
]]
for
i
in
range
(
50
)]
...
...
@@ -308,11 +308,11 @@ def test_applyNewLevels():
with
warnings
.
catch_warnings
():
warnings
.
simplefilter
(
'ignore'
)
vartable
[
'RawLevels'
][
1
]
=
list
(
range
(
10
)
)
vartable
[
'RawLevels'
][
1
]
=
np
.
a
range
(
10
)
vartable
[
'NewLevels'
][
1
]
=
codes1
vartable
[
'RawLevels'
][
2
]
=
list
(
range
(
10
)
)
vartable
[
'RawLevels'
][
2
]
=
np
.
a
range
(
10
)
vartable
[
'NewLevels'
][
2
]
=
codes2
vartable
[
'RawLevels'
][
3
]
=
list
(
range
(
10
)
)
vartable
[
'RawLevels'
][
3
]
=
np
.
a
range
(
10
)
vartable
[
'NewLevels'
][
3
]
=
codes3
...
...
@@ -347,8 +347,8 @@ def test_applyNAInsertion():
data
=
np
.
random
.
randint
(
0
,
10
,
(
100
,
3
)).
astype
(
np
.
float32
)
data
[:,
0
]
=
np
.
arange
(
1
,
101
)
miss1
=
list
(
np
.
random
.
choice
(
range
(
10
),
4
,
replace
=
False
)
)
miss2
=
list
(
np
.
random
.
choice
(
range
(
10
),
4
,
replace
=
False
)
)
miss1
=
np
.
random
.
choice
(
range
(
10
),
4
,
replace
=
False
)
miss2
=
np
.
random
.
choice
(
range
(
10
),
4
,
replace
=
False
)
exp1
=
data
[:,
1
].
copy
()
exp2
=
data
[:,
2
].
copy
()
...
...
@@ -362,7 +362,7 @@ def test_applyNAInsertion():
warnings
.
simplefilter
(
"ignore"
)
vartable
[
'NAValues'
][
1
]
=
miss1
vartable
[
'NAValues'
][
2
]
=
miss2
vartable
[
'NAValues'
][
3
]
=
[
1
,
2
,
3
]
vartable
[
'NAValues'
][
3
]
=
np
.
array
(
[
1
,
2
,
3
]
)
cols
=
[
'eid'
,
'1-0.0'
,
'2-0.0'
]
...
...
Write
Preview
Supports
Markdown
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