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
2211bbd6
Commit
2211bbd6
authored
4 years ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
REF: set partial_fill to False again
Still using `partial_fill` when creating FileTreeQuery
parent
dd48efe0
No related branches found
Branches containing commit
No related tags found
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 @
2211bbd6
...
...
@@ -354,7 +354,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 @
2211bbd6
...
...
@@ -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 @
2211bbd6
...
...
@@ -13,14 +13,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