nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
741 stars 524 forks source link

Nipype installation test failure #1880

Open rpalmeida opened 7 years ago

rpalmeida commented 7 years ago

Summary

Hello, As in issue #1864, I was having some troubles with traits so, as it was suggested there, I've updated to nipype-0.13.0 but, nipype.test is still failling. How should I proceed?

Thank you in advance for the help, Raquel

Actual behavior

=================================== FAILURES =================================== ____ test_write_graphruns ____

tmpdir = local('/private/var/folders/8t/45q0dmmn2qn2_wz8wy4pgfxm0000gn/T/pytest-of-Raquel/pytest-0/test_write_graph_runs0')

def test_write_graph_runs(tmpdir):
    os.chdir(str(tmpdir))

    for graph in ('orig', 'flat', 'exec', 'hierarchical', 'colored'):
        for simple in (True, False):
            pipe = pe.Workflow(name='pipe')
            mod1 = pe.Node(interface=EngineTestInterface(), name='mod1')
            mod2 = pe.Node(interface=EngineTestInterface(), name='mod2')
            pipe.connect([(mod1, mod2, [('output1', 'input1')])])
            try:
                pipe.write_graph(graph2use=graph, simple_form=simple)
            except Exception:
              assert False, \

'Failed to plot {} {} graph'.format( 'simple' if simple else 'detailed', graph) E AssertionError: Failed to plot simple orig graph E assert False

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nipype/pipeline/engine/tests/test_engine.py:682: AssertionError ----------------------------- Captured stdout call ----------------------------- 170314-16:04:08,716 workflow INFO: Creating detailed dot file: /private/var/folders/8t/45q0dmmn2qn2_wz8wy4pgfxm0000gn/T/pytest-of-Raquel/pytest-0/test_write_graph_runs0/graph_detailed.dot !!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!! ======== 1 failed, 2306 passed, 32 skipped, 5 xfailed in 61.21 seconds =========

Expected behaviour

test should not fail and print(nipype.get_info()) shouldn't either

How to replicate the behavior

python -c "import nipype; nipype.test()"

Platform details:

print(nipype.get_info()) Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2881, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in print(nipype.get_info()) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nipype/init.py", line 47, in get_info return _get_pkg_info(os.path.dirname(file)) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nipype/pkg_info.py", line 84, in get_pkg_info src, hsh = pkg_commit_hash(pkg_path) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nipype/pkg_info.py", line 52, in pkg_commit_hash archive_subst = cfg_parser.get('commit hash', 'archive_subst_hash') File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/backports/configparser/init.py", line 811, in get d) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/backports/configparser/init.py", line 384, in before_get self._interpolate_some(parser, option, L, value, section, defaults, 1) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/backports/configparser/init.py", line 434, in _interpolate_some "found: %r" % (rest,)) InterpolationSyntaxError: '%' must be followed by '%' or '(', found: u'%h'

but i guess that pip freeze gives the same info, so: pip freeze appdirs==1.4.3 appnope==0.1.0 backports-abc==0.5 backports.shutil-get-terminal-size==1.0.0 blaze==0.10.1 bleach==1.5.0 bokeh==0.12.4 certifi==2017.1.23 click==6.7 cmake==0.6.0 configparser==3.5.0 contextlib2==0.5.4 cycler==0.10.0 datashape==0.5.2 decorator==4.0.11 dipy==0.11.0 entrypoints==0.2.2 enum34==1.1.6 Flask==0.12 Flask-Cors==3.0.2 funcsigs==1.0.2 functools32==3.2.3.post2 future==0.16.0 futures==3.0.5 html5lib==0.9999999 ibm-db-sa==0.3.3 ipykernel==4.5.2 ipython==5.2.2 ipython-genutils==0.1.0 ipywidgets==5.2.2 isodate==0.5.4 itsdangerous==0.24 Jinja2==2.9.5 jsonschema==2.6.0 jupyter==1.0.0 jupyter-client==4.4.0 jupyter-console==5.1.0 jupyter-core==4.2.1 keepalive==0.5 lxml==3.7.3 MarkupSafe==0.23 matplotlib==2.0.0 mistune==0.7.3 mock==2.0.0 multipledispatch==0.4.9 nbconvert==5.1.1 nbformat==4.2.0 networkx==1.11 nibabel==2.1.0 nipype==0.13.0.dev0 nose==1.3.7 notebook==4.4.1 numpy==1.12.0 odo==0.5.0 Orange==2.7.8 packaging==16.8 pandas==0.19.2 pandocfilters==1.4.1 pathlib2==2.2.1 patsy==0.4.1 pbr==1.10.0 pexpect==4.2.1 pickleshare==0.7.4 prompt-toolkit==1.0.13 prov==1.5.0 psutil==5.1.3 psycopg2==2.7.1 ptyprocess==0.5.1 py==1.4.32 pyface==5.1.0 Pygments==2.2.0 PyMySQL==0.7.10 pyparsing==2.2.0 PySide==1.2.4 pytest==3.0.6 python-dateutil==2.6.0 pytz==2016.10 PyYAML==3.12 pyzmq==16.0.2 qpm==1.19 qtconsole==4.2.1 QtPy==1.2.1 rdflib==4.2.2 requests==2.13.0 scandir==1.4 scikit-learn==0.18.1 scipy==0.19.0 simplegeneric==0.8.1 simplejson==3.10.0 singledispatch==3.4.0.3 six==1.10.0 SPARQLWrapper==1.7.6 SQLAlchemy==1.1.5 statsmodels==0.8.0 subprocess32==3.2.7 terminado==0.6 testpath==0.3 toolz==0.8.2 tornado==4.4.2 traitlets==4.3.1 traits==4.6.0 traits-enaml==0.2.1 traitscli==0.1.0 traitsui==5.1.0 wcwidth==0.1.7 webencodings==0.5 Werkzeug==0.11.15 widgetsnbextension==1.2.6 xvfbwrapper==0.2.9

satra commented 7 years ago

@rpalmeida - thanks for the feedback. you should be ok, but yes the tests require a few more things than the basic setup for nipype (@oesteban). we will try to take care of this before we release next.

rpalmeida commented 7 years ago

Hi @satra, thank you so much for the answer. Unfortunately, it is still not working for me. With nipype 0.12 and freesurfer 5.3 everything was fine and running without errors.

After the freesurfer update from version 5.3 to 6.0 nipype started raising a traits error. After installing nipype 0.13, as suggested, I get this error:

File: crash-20170314-175814-raquelalmeida-EM_Register.a1-8e3340a8-7165-4a21-a669-26884fd501e6.pklz
Node: l1workflow.ReconAll.AutoRecon1.EM_Register.a1
Working directory: /Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/AutoRecon1/_subject_id_S149765/EM_Register

Node inputs:

args = <undefined>
environ = {u'SUBJECTS_DIR': '/Applications/freesurfer/subjects'}
ignore_exception = False
in_file = /Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/AutoRecon1/_subject_id_S149765/Add_Transform_to_Orig_Nu/orig_nu.mgz
mask = <undefined>
nbrspacing = <undefined>
num_threads = <undefined>
out_file = talairach_with_skull.lta
skull = True
subjects_dir = /Applications/freesurfer/subjects
template = <undefined>
terminal_output = stream
transform = <undefined>

Traceback: 
Traceback (most recent call last):
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 300, in _send_procs_to_workers
    jobid].hash_exists()
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 238, in hash_exists
    hashed_inputs, hashvalue = self._get_hashval()
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 401, in _get_hashval
    self._get_inputs()
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 461, in _get_inputs
    self.set_input(key, deepcopy(output_value))
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 217, in set_input
    setattr(self.inputs, parameter, deepcopy(val))
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/interfaces/traits_extension.py", line 89, in validate
    self.error(object, name, value)
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/traits/trait_handlers.py", line 172, in error
    value )

TraitError: The 'template' trait of an EMRegisterInputSpec instance must be an existing file name, but a value of '/Applications/freesurfer/average/RB_all_withskull_2014-08-21.gca' <type 'str'> was specified.
Error setting node input:
Node: EM_Register
input: template
results_file: /Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/config/result_config.pklz
value: /Applications/freesurfer/average/RB_all_withskull_2014-08-21.gca

Just to make sure, I downgraded back to freesurfer 5.3. With nipype 0.13 it is raising an error in another place:

File: crash-20170314-183200-raquelalmeida-Bias_correction.a3-d60d571f-a230-4731-bdbe-ab20c3cd3a9c.pklz
Node: l1workflow.ReconAll.AutoRecon1.Bias_correction.a3
Working directory: /Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/AutoRecon1/_subject_id_S205076/Bias_correction

Node inputs:

args = <undefined>
distance = 50
environ = {u'SUBJECTS_DIR': '/Applications/freesurfer/subjects'}
ignore_exception = False
in_file = /Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/AutoRecon1/_subject_id_S205076/Conform_Template/orig.mgz
iterations = 1
mask = <undefined>
no_rescale = True
out_file = orig_nu.mgz
protocol_iterations = 1000
shrink = <undefined>
stop = <undefined>
subjects_dir = /Applications/freesurfer/subjects
terminal_output = stream
transform = <undefined>

Traceback: 
Traceback (most recent call last):
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 52, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 366, in run
    self._run_interface()
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 476, in _run_interface
    self._result = self._run_command(execute)
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 607, in _run_command
    result = self._interface.run()
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/interfaces/freesurfer/base.py", line 126, in run
    return super(FSCommand, self).run(**inputs)
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1085, in run
    runtime = self._run_wrapper(runtime)
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1728, in _run_wrapper
    runtime = self._run_interface(runtime)
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1762, in _run_interface
    self.raise_exception(runtime)
  File "/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/interfaces/base.py", line 1686, in raise_exception
    **runtime.dictcopy()))
RuntimeError: Command:
mri_nu_correct.mni --distance 50 --i /Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/AutoRecon1/_subject_id_S205076/Conform_Template/orig.mgz --n 1 --no-rescale --o orig_nu.mgz --proto-iters 1000
Standard output:
/Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/AutoRecon1/_subject_id_S205076/Bias_correction
/Applications/freesurfer/bin/mri_nu_correct.mni
--distance 50 --i /Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/AutoRecon1/_subject_id_S205076/Conform_Template/orig.mgz --n 1 --no-rescale --o orig_nu.mgz --proto-iters 1000
nIters 1
$Id: mri_nu_correct.mni,v 1.18.2.1 2013/01/09 21:23:42 nicks Exp $
Darwin coriscamacsimac.fc.ul.pt 13.4.0 Darwin Kernel Version 13.4.0: Mon Jan 11 18:17:34 PST 2016; root:xnu-2422.115.15~1/RELEASE_X86_64 x86_64
Tue Mar 14 18:31:56 WET 2017
tmpdir is ./tmp.mri_nu_correct.mni.52620
/Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/AutoRecon1/_subject_id_S205076/Bias_correction
mri_convert /Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/AutoRecon1/_subject_id_S205076/Conform_Template/orig.mgz ./tmp.mri_nu_correct.mni.52620/nu0.mnc -odt float
mri_convert /Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/AutoRecon1/_subject_id_S205076/Conform_Template/orig.mgz ./tmp.mri_nu_correct.mni.52620/nu0.mnc -odt float 
$Id: mri_convert.c,v 1.179.2.7 2012/09/05 21:55:16 mreuter Exp $
reading from /Volumes/LaCie/ADNI_DATA/TESTES/workflow_dir/workflow_dir/l1workflow/ReconAll/AutoRecon1/_subject_id_S205076/Conform_Template/orig.mgz...
TR=2300.00, TE=0.00, TI=0.00, flip angle=0.00
i_ras = (-1, 0, 0)
j_ras = (0, 0, -1)
k_ras = (0, 1, 0)
changing data type from uchar to float (noscale = 0)...
writing to ./tmp.mri_nu_correct.mni.52620/nu0.mnc...

--------------------------------------------------------
Iteration 1 Tue Mar 14 18:32:00 WET 2017
nu_correct -clobber ./tmp.mri_nu_correct.mni.52620/nu0.mnc ./tmp.mri_nu_correct.mni.52620/nu1.mnc -tmpdir ./tmp.mri_nu_correct.mni.52620/0/ -iterations 1000 -distance 50
Can't locate MNI/Startup.pm in @INC (@INC contains: /Applications/freesurfer/mni/lib/../Library/Perl/Updates/5.12.3 /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .) at /Applications/freesurfer/mni/bin/nu_correct line 37.
BEGIN failed--compilation aborted at /Applications/freesurfer/mni/bin/nu_correct line 37.
ERROR: nu_correct

Standard error:
Can't locate MNI/Startup.pm in @INC (@INC contains: /Applications/freesurfer/mni/lib/../Library/Perl/Updates/5.12.3 /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .) at /Applications/freesurfer/mni/bin/nu_correct line 37.
BEGIN failed--compilation aborted at /Applications/freesurfer/mni/bin/nu_correct line 37.

Return code: 1
Interface MNIBiasCorrection failed to run. 

I hope I'm being clear and not too confusing.

Once again thanks for the help, Raquel

oesteban commented 7 years ago

Hi @rpalmeida, let's review the errors:

  1. Test failing: do you have graphviz installed?

  2. Freesurfer 6.0: could you please confirm if the file /Applications/freesurfer/average/RB_all_withskull_2014-08-21.gca actually exists?

  3. Here you seem to have some installation problem of nu_correct from your Freesurfer 5 judging from that Can't locate MNI/Startup.pm:

    
    Can't locate MNI/Startup.pm in @INC (@INC contains: /Applications/freesurfer/mni/lib/../Library/Perl/Updates/5.12.3 /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .) at /Applications/freesurfer/mni/bin/nu_correct line 37.
    BEGIN failed--compilation aborted at /Applications/freesurfer/mni/bin/nu_correct line 37.
    ERROR: nu_correct

Standard error: Can't locate MNI/Startup.pm in @INC (@INC contains: /Applications/freesurfer/mni/lib/../Library/Perl/Updates/5.12.3 /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .) at /Applications/freesurfer/mni/bin/nu_correct line 37. BEGIN failed--compilation aborted at /Applications/freesurfer/mni/bin/nu_correct line 37.


Thanks a lot
rpalmeida commented 7 years ago

Hi @oesteban, Thanks for your answer

  1. graphviz wasn't installed
  2. it exists in freesurfer 6.0 but its name is RB_all_withskull_2016-05-10.vc700.gca should I change the name or is this a problem that everyone who upgrades to freesurfer 6 will have, so it better if you guys update the name on the code?
  3. freesurfer 5.3 was working fine before, I only change the folder name, It should be something else, right? May this be related to the Perl version 5.12.3? I've compared the nu_correct from version 5.3 and 6 and they don't differ that much...
  4. Copied the RB_all_withskull and gave it the name nipype was looking for. Freesurfer 6 did not raised an error in nu_correct. Any thoughts?

Thanks

oesteban commented 7 years ago

Thanks a lot,

  1. I think the test will not fail with graphviz installed (I'll check if nipype skips the test when graphviz is not available).
  2. (and 4.) Right, this is something @effigies can be more knowledgeable than me.
  3. Hard to tell, have you tried running the same command without nipype? If it works, then it is something we are doing wrong. But it seems to me that some environment variables or files are mssing.
satra commented 7 years ago

@oesteban - i believe @rpalmeida is using @hjmjohnson and @dmwelch 's recon-all workflow rather than just the recon-all script.

@dmwelch - have you run the workflow with the released version of freesurfer 6?

rpalmeida commented 7 years ago

@satra - If you are talking about the smri_fsreconall script, then yes this is what I am using.

@dmwelch and @effigies - besides the RB_all_withskull_2014-08-21.gca I also had to change the name of RB_all_2014-08-21.gca on the freesurfer 6 folder; the original files name were RB_all_withskull_2016-05-10.vc700.gca and RB_all_2016-05-10.vc700.gca respectively. I'll give feedback if the workflow eventually stops again.

@oesteban - 3. Since I'm running the workflow for FS 6 now, I will test the recon-all with FS 5 tomorrow but it is strange if it doesn't run correctly since it was working fine (with and without nipype) before I've installed nipype 0.13.

  1. I ran the test again and it is still failing:
=================================== FAILURES ===================================
____________________________ test_write_graph_runs _____________________________

tmpdir = local('/private/var/folders/1v/fnmj49495tdd7vxqbcd1vgxr0000gq/T/pytest-of-raquelalmeida/pytest-3/test_write_graph_runs0')

    def test_write_graph_runs(tmpdir):
        os.chdir(str(tmpdir))

        for graph in ('orig', 'flat', 'exec', 'hierarchical', 'colored'):
            for simple in (True, False):
                pipe = pe.Workflow(name='pipe')
                mod1 = pe.Node(interface=EngineTestInterface(), name='mod1')
                mod2 = pe.Node(interface=EngineTestInterface(), name='mod2')
                pipe.connect([(mod1, mod2, [('output1', 'input1')])])
                try:
                    pipe.write_graph(graph2use=graph, simple_form=simple)
                except Exception:
>                   assert False, \
                        'Failed to plot {} {} graph'.format(
                        'simple' if simple else 'detailed', graph)
E                   AssertionError: Failed to plot simple orig graph
E                   assert False

/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/tests/test_engine.py:682: AssertionError
----------------------------- Captured stdout call -----------------------------
170314-23:02:29,420 workflow INFO:
     Creating detailed dot file: /private/var/folders/1v/fnmj49495tdd7vxqbcd1vgxr0000gq/T/pytest-of-raquelalmeida/pytest-3/test_write_graph_runs0/graph_detailed.dot
!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!
======== 1 failed, 2308 passed, 30 skipped, 5 xfailed in 202.37 seconds ========

Thank you all for the help

mgxd commented 7 years ago

@rpalmeida regarding the fail, I think you'll also need pydotplus

mgxd commented 7 years ago

@rpalmeida still running into errors?

rpalmeida commented 7 years ago

@mgxd - yes... I've installed pydotplus like you suggested and today uninstalled, reinstalled nipype 0.13 and ran the test again: python -c "import nipype; nipype.test()"

=================================== FAILURES ===================================
____________________________ test_write_graph_runs _____________________________

tmpdir = local('/private/var/folders/1v/fnmj49495tdd7vxqbcd1vgxr0000gq/T/pytest-of-raquelalmeida/pytest-0/test_write_graph_runs0')

    def test_write_graph_runs(tmpdir):
        os.chdir(str(tmpdir))

        for graph in ('orig', 'flat', 'exec', 'hierarchical', 'colored'):
            for simple in (True, False):
                pipe = pe.Workflow(name='pipe')
                mod1 = pe.Node(interface=EngineTestInterface(), name='mod1')
                mod2 = pe.Node(interface=EngineTestInterface(), name='mod2')
                pipe.connect([(mod1, mod2, [('output1', 'input1')])])
                try:
                    pipe.write_graph(graph2use=graph, simple_form=simple)
                except Exception:
>                   assert False, \
                        'Failed to plot {} {} graph'.format(
                        'simple' if simple else 'detailed', graph)
E                   AssertionError: Failed to plot simple orig graph
E                   assert False

/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/tests/test_engine.py:682: AssertionError
!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!
======== 1 failed, 2322 passed, 30 skipped, 5 xfailed in 280.87 seconds ========
dmwelch commented 7 years ago

Yeah, I haven't worked with Nipype for several years now and with @FreeSurfer current software dev practices, there's absolutely going to be significant code rot between releases.

Unfortunately I've moved on to other things so @hjmjohnson is going to be your point of contact for this wrapping.

mgxd commented 7 years ago

@rpalmeida this is weird behavior - I could replicate this error in Python 2.7 if graphviz was not installed - but after installation this test was able to pass. If installing graphviz didn't fix it, I would first recommend installing on a fresh environment to ensure if there are no interactions going on.

oesteban commented 7 years ago

@rpalmeida @mgxd Let's try a more verbose output for pytest:

cd /path/to/nipype
py.test -v nipype/pipeline/engine/tests/test_engine.py::test_write_graph_runs
rpalmeida commented 7 years ago

@oesteban, @mgxd - I did the flowing:

coriscamacsimac:~ raquelalmeida$ cd anaconda/lib/python2.7/site-packages/nipype
coriscamacsimac:nipype raquelalmeida$ py.test -v nipype/pipeline/engine/tests/test_engine.py::test_write_graph_runs
============================= test session starts ==============================
platform darwin -- Python 2.7.13, pytest-3.0.6, py-1.4.32, pluggy-0.4.0 -- /Users/raquelalmeida/anaconda/bin/python
cachedir: .cache
rootdir: /Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype, inifile: 

========================= no tests ran in 0.00 seconds =========================
ERROR: file not found: nipype/pipeline/engine/tests/test_engine.py::test_write_graph_runs

Because the file is actually there and I thought this error didn't make sense, I changed the dir to "tests" and ran the test again:

coriscamacsimac:nipype raquelalmeida$ cd /Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/tests
coriscamacsimac:tests raquelalmeida$ py.test -v test_engine.py::test_write_graph_runs
============================= test session starts ==============================
platform darwin -- Python 2.7.13, pytest-3.0.6, py-1.4.32, pluggy-0.4.0 -- /Users/raquelalmeida/anaconda/bin/python
cachedir: .cache
rootdir: /Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/tests, inifile: 
collected 34 items 

test_engine.py::test_write_graph_runs FAILED

=================================== FAILURES ===================================
____________________________ test_write_graph_runs _____________________________

tmpdir = local('/private/var/folders/1v/fnmj49495tdd7vxqbcd1vgxr0000gq/T/pytest-of-raquelalmeida/pytest-3/test_write_graph_runs0')

    def test_write_graph_runs(tmpdir):
        os.chdir(str(tmpdir))

        for graph in ('orig', 'flat', 'exec', 'hierarchical', 'colored'):
            for simple in (True, False):
                pipe = pe.Workflow(name='pipe')
                mod1 = pe.Node(interface=EngineTestInterface(), name='mod1')
                mod2 = pe.Node(interface=EngineTestInterface(), name='mod2')
                pipe.connect([(mod1, mod2, [('output1', 'input1')])])
                try:
                    pipe.write_graph(graph2use=graph, simple_form=simple)
                except Exception:
>                   assert False, \
                        'Failed to plot {} {} graph'.format(
                        'simple' if simple else 'detailed', graph)
E                   AssertionError: Failed to plot simple orig graph
E                   assert False

/Users/raquelalmeida/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/tests/test_engine.py:682: AssertionError
=========================== 1 failed in 1.82 seconds ===========================

The error is the same as before. Anything else I should test?