-
Notifications
You must be signed in to change notification settings - Fork 532
Bunch has no attribute insert (from neurostars) #1690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@oesteban just following up here instead of on neurostars: if I disable the debug mode, the pipeline seems to execute that node |
And for reference:
|
Any word on this? I'm also running into it when trying anything that uses a MapNode |
@mvdoc - any chance you could test this with current master? |
I get the same error on 0.13.0-g5e0597b.dev |
@mattcieslak - thanks for the update. it would really help if you can create a simple example? because we do run many pipelines with mapnodes in our test suite, so we are trying to figure out why we don't see this error. |
@satra I found something interesting and subtle while writing up a small example. It seems that if there is an error in the pipeline, and This is the small working example from nipype import MapNode, config
from nipype.interfaces import Function
config.enable_debug_mode()
def myfunction(string):
return string + 'meh'
node = MapNode(Function(input_names=['string'],
output_names=['newstring'],
function=myfunction),
iterfield=['string'],
name='myfunc')
node.inputs.string = ['string' + str(i) for i in range(3)]
node.run() And this is the output, running fine with contematto@talete ~/Documents/experiments_work/pipelines (master*) $ python example-mapnode.py
161107-19:43:37,85 workflow INFO:
Executing node myfunc in dir: /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/tmp43HUxH/myfunc
161107-19:43:37,97 workflow INFO:
Executing node _myfunc0 in dir: /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/tmp43HUxH/myfunc/mapflow/_myfunc0
161107-19:43:37,123 workflow INFO:
Runtime memory and threads stats unavailable
161107-19:43:37,125 workflow INFO:
Executing node _myfunc1 in dir: /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/tmp43HUxH/myfunc/mapflow/_myfunc1
161107-19:43:37,139 workflow INFO:
Runtime memory and threads stats unavailable
161107-19:43:37,141 workflow INFO:
Executing node _myfunc2 in dir: /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/tmp43HUxH/myfunc/mapflow/_myfunc2
161107-19:43:37,154 workflow INFO:
Runtime memory and threads stats unavailable Now if I introduce a small error in the code, and run the following code (note the from nipype import MapNode, config
from nipype.interfaces import Function
config.enable_debug_mode()
def myfunction(string):
return string + 'meh'
node = MapNode(Function(input_names=['WRONG'],
output_names=['newstring'],
function=myfunction),
iterfield=['WRONG'],
name='myfunc')
node.inputs.WRONG = ['string' + str(i) for i in range(3)]
node.run() here's the output contematto@talete ~/Documents/experiments_work/pipelines (master*) $ python example-mapnode.py
161107-19:46:02,754 workflow INFO:
Executing node myfunc in dir: /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/tmpZUoT2V/myfunc
161107-19:46:02,767 workflow INFO:
Executing node _myfunc0 in dir: /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/tmpZUoT2V/myfunc/mapflow/_myfunc0
Traceback (most recent call last):
File "example-mapnode.py", line 16, in <module>
node.run()
File "/Users/contematto/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 394, in run
self._run_interface()
File "/Users/contematto/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 1306, in _run_interface
updatehash=updatehash))
File "/Users/contematto/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 1170, in _collate_results
self._result.runtime.insert(i, None)
AttributeError: 'Bunch' object has no attribute 'insert' If I disable the contematto@talete ~/Documents/experiments_work/pipelines (master*) $ python example-mapnode.py
161107-19:47:19,859 workflow INFO:
Executing node myfunc in dir: /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/tmp5fBpWk/myfunc
161107-19:47:19,876 workflow INFO:
Executing node _myfunc0 in dir: /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/tmp5fBpWk/myfunc/mapflow/_myfunc0
161107-19:47:19,909 workflow INFO:
Executing node _myfunc1 in dir: /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/tmp5fBpWk/myfunc/mapflow/_myfunc1
161107-19:47:19,919 workflow INFO:
Executing node _myfunc2 in dir: /var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/tmp5fBpWk/myfunc/mapflow/_myfunc2
Traceback (most recent call last):
File "example-mapnode.py", line 16, in <module>
node.run()
File "/Users/contematto/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 394, in run
self._run_interface()
File "/Users/contematto/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 1306, in _run_interface
updatehash=updatehash))
File "/Users/contematto/anaconda/lib/python2.7/site-packages/nipype/pipeline/engine/nodes.py", line 1211, in _collate_results
(self.name, '\n'.join(msg)))
Exception: Subnodes of node: myfunc failed:
Subnode 0 failed
Error:
myfunction() got an unexpected keyword argument 'WRONG'
Interface Function failed to run.
Subnode 1 failed
Error:
myfunction() got an unexpected keyword argument 'WRONG'
Interface Function failed to run.
Subnode 2 failed
Error:
myfunction() got an unexpected keyword argument 'WRONG'
Interface Function failed to run. And for reference, this is with 0.12.1 contematto@talete ~/Documents/experiments_work/pipelines (master*) $ python -c "import nipype; print(nipype.__version__)"
0.12.1 |
@mvdoc - awesome that helps a lot - we need to create a pipeline+mapnode test with an error :) - i'll add this as a test. should be a relatively easy fix. |
Just run with master and got the same error
|
Just seen this in neurostars:
The text was updated successfully, but these errors were encountered: