Skip to content

Commit 63566a9

Browse files
author
Ben Cipollini
committed
fix: tweaks for building docs:
* check for NIPYPE_NO_MATLAB before doing code that may throw. * Give better error messages when tools (dot) not installed. * update gitignore for all built files.
1 parent 29d774b commit 63566a9

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/nipype/build
66
/nipype/nipype.egg-info
77
/doc/_build
8+
/doc/preproc
89
/doc/users/examples
910
/doc/api/generated
1011
*.pyc

nipype/interfaces/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@ def _run_interface(self, runtime, correct_return_codes=[0]):
14861486
exist_val, cmd_path = _exists_in_path(executable_name,
14871487
runtime.environ)
14881488
if not exist_val:
1489-
raise IOError("%s could not be found on host %s" %
1489+
raise IOError("command '%s' could not be found on host %s" %
14901490
(self.cmd.split()[0], runtime.hostname))
14911491
setattr(runtime, 'command_path', cmd_path)
14921492
setattr(runtime, 'dependencies', get_dependencies(executable_name,

nipype/interfaces/spm/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def no_spm():
203203
used with nosetests skipif to skip tests
204204
that will fail if spm is not installed"""
205205

206-
if Info.version() is None or 'NIPYPE_NO_MATLAB' in os.environ:
206+
if 'NIPYPE_NO_MATLAB' in os.environ or Info.version() is None:
207207
return True
208208
else:
209209
return False

nipype/pipeline/utils.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,9 +946,17 @@ def export_graph(graph_in, base_dir=None, show=False, use_execgraph=False,
946946

947947

948948
def format_dot(dotfilename, format=None):
949+
"""Dump a directed graph (Linux only; install via `brew` on OSX)"""
949950
cmd = 'dot -T%s -O \'%s\'' % (format, dotfilename)
950-
CommandLine(cmd).run()
951-
logger.info('Converting dotfile: %s to %s format' % (dotfilename, format))
951+
try:
952+
CommandLine(cmd).run()
953+
except IOError as ioe:
954+
if "could not be found" in str(ioe):
955+
raise IOError("Cannot draw directed graph; executable 'dot' is unavailable")
956+
else:
957+
raise ioe
958+
else:
959+
logger.info('Converting dotfile: %s to %s format' % (dotfilename, format))
952960

953961

954962
def make_output_dir(outdir):

0 commit comments

Comments
 (0)