Skip to content
Snippets Groups Projects
Commit 38789e94 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

ENH: add warning message if fslsub.info gets called more than 2 time

parent e01f95f8
No related branches found
No related tags found
No related merge requests found
......@@ -299,6 +299,12 @@ def info(job_ids) -> Dict[str, Optional[Dict[str, str]]]:
:return: dictionary of jobid -> another dictionary with job information
(or None if job does not exist)
"""
if not hasattr(info, '_ncall'):
info._ncall = 0
info._ncall += 1
if info._ncall == 3:
warnings.warn("Please do not call `fslsub.info` repeatably, because it slows down the cluster. You can avoid this message by simply passing all the job IDs you are interested in to a single `fslsub.info` call.")
from fsl.utils.run import run
job_ids_string = _flatten_job_ids(job_ids)
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment