Skip to content
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

func as function input variable name #417

Open
htwangtw opened this issue Feb 17, 2021 · 1 comment
Open

func as function input variable name #417

htwangtw opened this issue Feb 17, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@htwangtw
Copy link

htwangtw commented Feb 17, 2021

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'
@htwangtw htwangtw added the bug Something isn't working label Feb 17, 2021
@effigies
Copy link
Contributor

The minimal reproduction is:

@pydra.mark.task
def f(func):
    print(func)

task = f(func="some_val")

This feels like it might be related to #295 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants