Skip to content

func as function input variable name #417

Open
@htwangtw

Description

@htwangtw

func as function input variable name creates conflict with mark.task(func)

Pydra version: 0.14
Minimal example to recreate the bug:

import nibabel as nb
import numpy as np
import pydra


@pydra.mark.task
def get_func_affine(func: str)-> np.array:
    aff_orig = nb.load(func).affine[:, -1]
    return aff_orig

wf = pydra.engine.Workflow(name="wf1",
                           input_spec=["func"])
wf.add(get_func_affine(name="get_func_affine",
                 func=wf.lzin.func))
wf.set_output([("out", wf.get_func_affine.lzout.out)])

Error:

TypeError                                 Traceback (most recent call last)
<ipython-input-1-6fa711100f80> in <module>
     10                            input_spec=["func"])
     11 wf.add(get_func_affine(name="get_func_affine",
---> 12                  func=wf.lzin.func))
     13 wf.set_output([("out", wf.get_func_affine.lzout.out)])

~/git_repos/pydra_playground/pydra/pydra/mark/functions.py in decorate(**kwargs)
     42 
     43     def decorate(**kwargs):
---> 44         return FunctionTask(func=func, **kwargs)
     45 
     46     return decorate

TypeError: type object got multiple values for keyword argument 'func'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

v1.0

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions