diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b28604e356097583239b9a91e29561b062017a2e..b25da9f8ffc9d2a7fbd6be8760a5e9f78220f01b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,21 @@ This document contains the ``fslpy`` release history in reverse chronological order. +2.6.2 (Monday 7th October 2019) +------------------------------- + + +Changed +^^^^^^^ + + +* Added a debugging hook in the :mod:`.idle` module. +* The :func:`.fslsub.submit` function is now more flexible in the way it + accepts the command and input arguments. +* The :func:`.run.prepareArgs` function has been renamed (from + ``_prepareArgs``). + + 2.6.1 (Thursday 19th September 2019) ------------------------------------ diff --git a/doc/conf.py b/doc/conf.py index 90254c22f1cee57d5fc65a2cdfe395e0a27f3a93..792b358e7bfa05bf7b5dcd050d4360dd61accec2 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -62,7 +62,7 @@ copyright = u'{}, Paul McCarthy, University of Oxford, Oxford, UK'.format( # Links to other things rst_epilog = """ .. |fsleyes_apidoc| replace:: FSLeyes -.. _fsleyes_apidoc: http://users.fmrib.ox.ac.uk/~paulmc/fsleyes_apidoc/index.html +.. _fsleyes_apidoc: http://users.fmrib.ox.ac.uk/~paulmc/fsleyes/userdoc/latest/index.html """ diff --git a/doc/index.rst b/doc/index.rst index dd49636cdcd335a91889bff58318a5ed1b295ea2..2ff98d800e9959b210b874571db3dd7baef8c230 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -4,7 +4,23 @@ The ``fslpy`` package is a collection of utilities and data abstractions used -by |fsleyes_apidoc|_. +within `FSL <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki>`_ and by +|fsleyes_apidoc|_. + + +The top-level Python package for ``fslpy`` is called ``fsl``. It is broadly +split into the following sub-packages: + + +.. autosummary:: + + fsl.data + fsl.utils + fsl.scripts + fsl.transform + fsl.version + fsl.wrappers + .. toctree:: :hidden: diff --git a/fsl/utils/idle.py b/fsl/utils/idle.py index f2fc9d0d2fcba36b3e0851b802d6b498ae908d67..c1184a31a758b685b476e843140a14ce0b284980 100644 --- a/fsl/utils/idle.py +++ b/fsl/utils/idle.py @@ -196,6 +196,13 @@ _idleCallRate = 200 """ +_idleAllowErrors = False +"""Used for testing/debugging. If ``True``, and a function called on the idle +loop raises an error, that error will not be caught, and the idle loop will +stop. +""" + + def idleReset(): """Reset the internal :func:`idle` queue state. @@ -211,6 +218,7 @@ def idleReset(): global _idleQueueDict global _idleTimer global _idleCallRate + global _idleAllowErrors if _idleTimer is not None: _idleTimer.Stop() @@ -221,11 +229,12 @@ def idleReset(): if queue is not None: newQueue = queue.Queue() else: newQueue = None - _idleRegistered = False - _idleQueue = newQueue - _idleQueueDict = {} - _idleTimer = None - _idleCallRate = 200 + _idleRegistered = False + _idleQueue = newQueue + _idleQueueDict = {} + _idleTimer = None + _idleCallRate = 200 + _idleAllowErrors = False # Call idleReset on exit, in @@ -294,6 +303,7 @@ def _wxIdleLoop(ev): global _idleQueueDict global _idleTimer global _idleCallRate + global _idleAllowErrors ev.Skip() @@ -342,6 +352,9 @@ def _wxIdleLoop(ev): log.warning('Idle task {} crashed - {}: {}'.format( taskName, type(e).__name__, str(e)), exc_info=True) + if _idleAllowErrors: + raise e + if task.name is not None: try: _idleQueueDict.pop(task.name) except KeyError: pass