Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
5f42941c
Commit
5f42941c
authored
4 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Test vest convert scripts
parent
d878d612
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_scripts/test_vest2text.py
+47
-0
47 additions, 0 deletions
tests/test_scripts/test_vest2text.py
with
47 additions
and
0 deletions
tests/test_scripts/test_vest2text.py
0 → 100644
+
47
−
0
View file @
5f42941c
#!/usr/bin/env python
#
# test_vest2text.py -
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
import
numpy
as
np
import
fsl.data.vest
as
fslvest
import
fsl.scripts.Text2Vest
as
Text2Vest
import
fsl.scripts.Vest2Text
as
Vest2Text
from
tests
import
tempdir
def
test_usage
():
assert
Vest2Text
.
main
([])
==
0
assert
Text2Vest
.
main
([])
==
0
def
test_Vest2Text
():
with
tempdir
():
data
=
np
.
random
.
random
((
20
,
10
))
vest
=
fslvest
.
generateVest
(
data
)
with
open
(
'
data.vest
'
,
'
wt
'
)
as
f
:
f
.
write
(
vest
)
assert
Vest2Text
.
main
([
'
data.vest
'
,
'
data.txt
'
])
==
0
got
=
np
.
loadtxt
(
'
data.txt
'
)
assert
np
.
all
(
np
.
isclose
(
data
,
got
))
def
test_Text2Vest
():
with
tempdir
():
data
=
np
.
random
.
random
((
20
,
10
))
np
.
savetxt
(
'
data.txt
'
,
data
)
assert
Text2Vest
.
main
([
'
data.txt
'
,
'
data.vest
'
])
==
0
got
=
fslvest
.
loadVestFile
(
'
data.vest
'
,
ignoreHeader
=
False
)
assert
np
.
all
(
np
.
isclose
(
data
,
got
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment