nipype / pydra

Pydra Dataflow Engine
https://nipype.github.io/pydra/
Other
119 stars 57 forks source link

Singleton splitter 1D split bug in state.py:_single_op_splits #757

Open ibevers opened 3 weeks ago

ibevers commented 3 weeks ago

For the Bug Report, Include this information:

    ef_wf = pydra.Workflow(
        name="ef_wf",
        input_spec=["bids_dir_path"],
        bids_dir_path=bids_dir_path
    )

    # Get subject paths.
    ef_wf.add(get_dir_paths(
            name="subject_paths",
            dir_path=ef_wf.lzin.bids_dir_path,
            id_prefix=SUBJECT_ID
        )
    )

    # Get session paths for each subject path.
    ef_wf.add(get_dir_paths(
            name="session_paths",
            dir_path=ef_wf.subject_paths.lzout.out,
            id_prefix=SESSION_ID
        ).split(
            "dir_path",
            dir_path=ef_wf.subject_paths.lzout.out
        )
    )

    # Get audio file paths for each session path.
    ef_wf.add(get_audio_files(
            name="audio_files",
            dir_path=ef_wf.session_paths.lzout.out,
            file_extension=AUDIO_FILE_EXTENSION
        ).split(
            "dir_path",
            dir_path=ef_wf.session_paths.lzout.out
        )
    )

Note that the following versions did not cause any errors:

    ef_wf = pydra.Workflow(
        name="ef_wf",
        input_spec=["bids_dir_path"],
        bids_dir_path=bids_dir_path
    )

    # Get subject paths.
    ef_wf.add(get_dir_paths(
            name="subject_paths",
            dir_path=ef_wf.lzin.bids_dir_path,
            id_prefix=SUBJECT_ID
        )
    )

    # Get session paths for each subject path.
    ef_wf.add(get_dir_paths(
            name="session_paths",
            dir_path=ef_wf.subject_paths.lzout.out,
            id_prefix=SESSION_ID
        ).split(
            "dir_path",
            dir_path=ef_wf.subject_paths.lzout.out
        )
    )
    ef_wf = pydra.Workflow(
        name="ef_wf",
        input_spec=["bids_dir_path"],
        bids_dir_path=bids_dir_path
    )

    # Get subject paths.
    ef_wf.add(get_dir_paths(
            name="subject_paths",
            dir_path=ef_wf.lzin.bids_dir_path,
            id_prefix=SUBJECT_ID
        )
    )

    # Get session paths for each subject path.
    ef_wf.add(get_dir_paths(
            name="session_paths",
            dir_path=ef_wf.subject_paths.lzout.out,
            id_prefix=SESSION_ID
        ).split(
            "dir_path",
            dir_path=ef_wf.subject_paths.lzout.out
        )
    )

    # Get audio file paths for each session path.
    ef_wf.add(get_audio_files(
            name="audio_files",
            dir_path=ef_wf.session_paths.lzout.out,
            file_extension=AUDIO_FILE_EXTENSION
        )