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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Evan Edmond
fslpy
Commits
85609e78
Commit
85609e78
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Plain Diff
Merge branch 'no_partial_fill' into 'master'
REF: set partial_fill to False again See merge request fsl/fslpy!218
parents
497e0a33
2211bbd6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
fsl/utils/filetree/filetree.py
+1
-1
1 addition, 1 deletion
fsl/utils/filetree/filetree.py
fsl/utils/filetree/query.py
+2
-0
2 additions, 0 deletions
fsl/utils/filetree/query.py
tests/test_filetree/test_read.py
+8
-1
8 additions, 1 deletion
tests/test_filetree/test_read.py
with
11 additions
and
2 deletions
fsl/utils/filetree/filetree.py
+
1
−
1
View file @
85609e78
...
...
@@ -394,7 +394,7 @@ class FileTree(object):
self
.
variables
=
{}
@classmethod
def
read
(
cls
,
tree_name
:
str
,
directory
=
'
.
'
,
partial_fill
=
Tru
e
,
**
variables
)
->
"
FileTree
"
:
def
read
(
cls
,
tree_name
:
str
,
directory
=
'
.
'
,
partial_fill
=
Fals
e
,
**
variables
)
->
"
FileTree
"
:
"""
Reads a FileTree from a specific file
...
...
This diff is collapsed.
Click to expand it.
fsl/utils/filetree/query.py
+
2
−
0
View file @
85609e78
...
...
@@ -89,6 +89,8 @@ class FileTreeQuery(object):
:arg tree: The :class:`.FileTree` object
"""
# Hard-code into the templates any pre-defined variables
tree
=
tree
.
partial_fill
()
# Find all files present in the directory
# (as Match objects), and find all variables,
...
...
This diff is collapsed.
Click to expand it.
tests/test_filetree/test_read.py
+
8
−
1
View file @
85609e78
...
...
@@ -14,14 +14,21 @@ def same_path(p1, p2):
def
test_simple_tree
():
tree
=
filetree
.
FileTree
.
read
(
'
eddy
'
)
assert
'
basename
'
not
in
tree
.
variables
assert
'
basename
'
in
tree
.
variables
same_path
(
tree
.
get
(
'
basename
'
),
'
./eddy_output
'
)
same_path
(
tree
.
get
(
'
image
'
),
'
./eddy_output.nii.gz
'
)
same_path
(
tree
.
update
(
basename
=
'
eddy
'
).
get
(
'
image
'
),
'
./eddy.nii.gz
'
)
tree
=
filetree
.
FileTree
.
read
(
'
eddy.tree
'
,
basename
=
'
out
'
)
assert
'
basename
'
in
tree
.
variables
same_path
(
tree
.
get
(
'
basename
'
),
'
./out
'
)
same_path
(
tree
.
update
(
basename
=
'
eddy
'
).
get
(
'
image
'
),
'
./eddy.nii.gz
'
)
tree
=
filetree
.
FileTree
.
read
(
'
eddy.tree
'
,
basename
=
'
out
'
,
partial_fill
=
True
)
assert
'
basename
'
not
in
tree
.
variables
same_path
(
tree
.
get
(
'
basename
'
),
'
./out
'
)
same_path
(
tree
.
update
(
basename
=
'
eddy
'
).
get
(
'
image
'
),
'
./out.nii.gz
'
)
with
pytest
.
raises
(
ValueError
):
filetree
.
FileTree
.
read
(
'
non_existing
'
)
...
...
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