Skip to content

Import error for nipype.interfaces.dipy.base #3411

@koenhelwegen

Description

@koenhelwegen

Summary

import nipype.interfaces.dipy generates an error for me, with Python 3.9 and 3.8, Dipy 4.12 (latest release) and latest release or current master of nipype.

Actual behavior

Running the above import generates the error TypeError: 'NoneType' object is not iterable generated from dipy_to_nipype_interface at:

for args, val in zip(parser.output_parameters, default_values[start:])

This function is executed during import in interfaces.dipy.preprocess. It seems this works correctly for several workflows (LabelsBundles, MedianOtsu, RecoBundles, LocalFiberTrackingPAM, PFTrackingPAM) but crashes for GibbsRingingFlow because default_values is None.

How to replicate the behavior

  • create a fresh venv
  • pip install the latest dipy and nipype packages
  • open python and run import nipype.interfaces.dipy

Expected behavior

A working import. This seems an easy fix, if others can reproduce the issue I would be happy to make a PR replacing

default_values = inspect.getfullargspec(flow.run).defaults
with:

 default_values = inspect.getfullargspec(flow.run).defaults or []

Platform details:

{'commit_hash': 'f756b7111', 'commit_source': 'repository', 'networkx_version': '2.6.3', 'nibabel_version': '3.2.1', 'nipype_version': '1.7.1-dev+gf756b7111', 'numpy_version': '1.21.4', 'pkg_path': '/home/.../basedir/nipype/nipype', 'scipy_version': '1.7.2', 'sys_executable': '/home/.../basedir/venv/bin/python', 'sys_platform': 'linux', 'sys_version': '3.9.9 (main, Nov 16 2021, 03:08:02) \n[GCC 9.3.0]', 'traits_version': '6.3.2'} 

(Error is the same for Python 3.8)

Execution environment

  • My python environment outside container

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions