Skip to content

Commit

Permalink
MRG, FIX: parallel n_jobs check (#7566)
Browse files Browse the repository at this point in the history
* fix njobs type checker

* update what's new

* use int_like
  • Loading branch information
drammock authored Apr 7, 2020
1 parent cf1f8c6 commit 50d6540
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/changes/latest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Bug

- Fix bug with :func:`mne.make_forward_dipole` where :func:`mne.write_forward_solution` could not be used by `Eric Larson`_

- Fix bug that prevents ``n_jobs`` from being a NumPy integer type, by `Daniel McCloy`_.

API
~~~

Expand Down
3 changes: 2 additions & 1 deletion mne/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from . import get_config
from .utils import logger, verbose, warn, ProgressBar
from .utils.check import int_like
from .fixes import _get_args

if 'MNE_FORCE_SERIAL' in os.environ:
Expand Down Expand Up @@ -153,7 +154,7 @@ def check_n_jobs(n_jobs, allow_cuda=False):
The checked number of jobs. Always positive (or 'cuda' if
applicable).
"""
if not isinstance(n_jobs, int):
if not isinstance(n_jobs, int_like):
if not allow_cuda:
raise ValueError('n_jobs must be an integer')
elif not isinstance(n_jobs, str) or n_jobs != 'cuda':
Expand Down

0 comments on commit 50d6540

Please sign in to comment.