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
Sean Fitzgibbon
fslpy
Commits
9a5e4fa3
Commit
9a5e4fa3
authored
Nov 23, 2018
by
Michiel Cottaar
Committed by
Paul McCarthy
Nov 28, 2018
Browse files
BUG: also allow job-ids to be integers
parent
3287a371
Changes
2
Hide whitespace changes
Inline
Side-by-side
fsl/utils/fslsub.py
View file @
9a5e4fa3
...
@@ -225,6 +225,8 @@ def _flatten_job_ids(job_ids):
...
@@ -225,6 +225,8 @@ def _flatten_job_ids(job_ids):
"""Unpack the (nested) job-ids in a single set"""
"""Unpack the (nested) job-ids in a single set"""
if
isinstance
(
job_ids
,
str
):
if
isinstance
(
job_ids
,
str
):
return
{
job_ids
}
return
{
job_ids
}
elif
isinstance
(
job_ids
,
int
):
return
{
str
(
job_ids
)}
else
:
else
:
res
=
set
()
res
=
set
()
for
job_id
in
job_ids
:
for
job_id
in
job_ids
:
...
...
tests/test_fslsub.py
View file @
9a5e4fa3
...
@@ -9,7 +9,7 @@ from fsl.utils import fslsub
...
@@ -9,7 +9,7 @@ from fsl.utils import fslsub
def
test_flatten_jobids
():
def
test_flatten_jobids
():
job_ids
=
(
'12'
,
'27'
,
'35'
,
'41'
,
'
721
'
)
job_ids
=
(
'12'
,
'27'
,
'35'
,
'41'
,
721
)
res
=
'12,27,35,41,721'
res
=
'12,27,35,41,721'
assert
fslsub
.
_flatten_job_ids
(
job_ids
)
==
res
assert
fslsub
.
_flatten_job_ids
(
job_ids
)
==
res
...
...
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