Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Michiel Cottaar
fslpy
Commits
8d948830
Commit
8d948830
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
RF,ENH: run(submit) args can be passed as a dict or as kwargs. submit accepts
env option
parent
6d59ac9e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/utils/fslsub.py
+4
-2
4 additions, 2 deletions
fsl/utils/fslsub.py
fsl/utils/run.py
+2
-2
2 additions, 2 deletions
fsl/utils/run.py
with
6 additions
and
4 deletions
fsl/utils/fslsub.py
+
4
−
2
View file @
8d948830
...
@@ -68,7 +68,8 @@ def submit(*command,
...
@@ -68,7 +68,8 @@ def submit(*command,
output
=
None
,
output
=
None
,
flags
=
False
,
flags
=
False
,
multi_threaded
=
None
,
multi_threaded
=
None
,
verbose
=
False
):
verbose
=
False
,
env
=
None
):
"""
"""
Submits a given command to the cluster
Submits a given command to the cluster
...
@@ -99,6 +100,7 @@ def submit(*command,
...
@@ -99,6 +100,7 @@ def submit(*command,
- <threads>: number of threads to run
- <threads>: number of threads to run
:arg verbose: If True, use verbose mode
:arg verbose: If True, use verbose mode
:arg env: Dict containing environment variables
:return: string of submitted job id
:return: string of submitted job id
"""
"""
...
@@ -136,7 +138,7 @@ def submit(*command,
...
@@ -136,7 +138,7 @@ def submit(*command,
base_cmd
.
extend
(
prepareArgs
(
command
))
base_cmd
.
extend
(
prepareArgs
(
command
))
return
runfsl
(
*
base_cmd
).
strip
()
return
runfsl
(
*
base_cmd
,
env
=
env
).
strip
()
def
info
(
job_id
):
def
info
(
job_id
):
...
...
This diff is collapsed.
Click to expand it.
fsl/utils/run.py
+
2
−
2
View file @
8d948830
...
@@ -168,7 +168,7 @@ def run(*args, **kwargs):
...
@@ -168,7 +168,7 @@ def run(*args, **kwargs):
All other keyword arguments are passed through to the ``subprocess.Popen``
All other keyword arguments are passed through to the ``subprocess.Popen``
object (via :func:`_realrun`), unless ``submit=True``, in which case they
object (via :func:`_realrun`), unless ``submit=True``, in which case they
are
ignored
.
are
passed through to the :func:`.fslsub.submit` function
.
:returns: If ``submit`` is provided, the return value of
:returns: If ``submit`` is provided, the return value of
:func:`.fslsub` is returned. Otherwise returns a single
:func:`.fslsub` is returned. Otherwise returns a single
...
@@ -208,7 +208,7 @@ def run(*args, **kwargs):
...
@@ -208,7 +208,7 @@ def run(*args, **kwargs):
# submit - delegate to fslsub
# submit - delegate to fslsub
if
submit
is
not
None
:
if
submit
is
not
None
:
return
fslsub
.
submit
(
'
'
.
join
(
args
),
**
submit
)
return
fslsub
.
submit
(
'
'
.
join
(
args
),
**
submit
,
**
kwargs
)
# Run directly - delegate to _realrun
# Run directly - delegate to _realrun
stdout
,
stderr
,
exitcode
=
_realrun
(
stdout
,
stderr
,
exitcode
=
_realrun
(
...
...
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