Skip to content

Outputs from the custom interface are removed after update to 1.0.3 #2601

Open
@achetverikov

Description

@achetverikov

Summary

I'm using my own interface that calls a compiled MATLAB function for fMRI decoding. It used to work before I updated to 1.0.3 from pre-1.0 version. After the update I get the following error:

180527-14:20:08,700 workflow ERROR:
         Saving crash info to /home/visual/andche/MRI_DATA/crash-20180527-142008-andche-_decoding_wrapper9-965b775a-1fbf-4755-9689-fce87bfce87c.pklz
Traceback (most recent call last):
  File "/home/visual/andche/MU/MainSessions/TMP/decoding/_TR_-2/_label_id_all_subject_id_P03/_topn_100_tvals_type_feat_useVOI_useVOI/_feature_space_360/decoding_wrapper/mapflow/batch/pyscript_20180527_141219__decoding_wrapper9.py", line 33, in <module>
    result = info['node'].run(updatehash=info['updatehash'])
  File "/project/3019005.02/conda_env/nipype_v1x/lib/python3.5/site-packages/nipype/pipeline/engine/nodes.py", line 480, in run
    result = self._run_interface(execute=True)
  File "/project/3019005.02/conda_env/nipype_v1x/lib/python3.5/site-packages/nipype/pipeline/engine/nodes.py", line 564, in _run_interface
    return self._run_command(execute)
  File "/project/3019005.02/conda_env/nipype_v1x/lib/python3.5/site-packages/nipype/pipeline/engine/nodes.py", line 662, in _run_command
    _save_resultfile(result, outdir, self.name)
  File "/project/3019005.02/conda_env/nipype_v1x/lib/python3.5/site-packages/nipype/pipeline/engine/utils.py", line 246, in save_resultfile
    result.outputs.set(**modify_paths(outputs, relative=True, basedir=cwd))
  File "/project/3019005.02/conda_env/nipype_v1x/lib/python3.5/site-packages/traits/util/deprecated.py", line 32, in wrapper
    return fn(*args, **kw)
  File "/project/3019005.02/conda_env/nipype_v1x/lib/python3.5/site-packages/traits/has_traits.py", line 1552, in set
    trait_change_notify=trait_change_notify, **traits)
  File "/project/3019005.02/conda_env/nipype_v1x/lib/python3.5/site-packages/traits/has_traits.py", line 1544, in trait_set
    setattr( self, name, value )
  File "/project/3019005.02/conda_env/nipype_v1x/lib/python3.5/site-packages/nipype/interfaces/base/traits_extension.py", line 114, in validate
    self.info_text, value))
traits.trait_errors.TraitError: The trait 'out_file' of a DecodingMatShellOutputSpec instance is an existing file name, but the path  '/project/3019005.02/MainSessions/TMP/decoding/_TR_-2/_label_id_all_subject_id_P03/_topn_100_tvals_type_feat_useVOI_useVOI/_feature_space_360/decoding_wrapper/mapflow/_decoding_wrapper9/TR_-2_testrun_10_out.mat' does not exist.

Now, the strange part is that:

  1. I check for the file existence in _list_outputs() of my interface twice and everything's fine.

  2. even weirder, the error disappears if I turn on the debug logging like this:

from nipype import config, logging
config.enable_debug_mode()
logging.update_logging(config)
  1. I then realized that the node parameter remove_unnecessary_outputs is no longer in the docs for node. Was it removed? Anyway, with the new needed_outputs all outputs should be saved by default, but it doesn't seem to be the case.

  2. setting needed_outputs to ['out_file'] does not help.

So far it seems, the only way to avoid the error is to set config.set('execution', 'remove_unnecessary_outputs', 'false').

I'm attaching my interface, maybe there are some specifications that changed with the update to nipype 1.0.3 that I've missed:
decodingMatShell.py.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions