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

Allow for overwriting options deep in task graph #5

Closed
hazbottles opened this issue Jul 28, 2021 · 0 comments · Fixed by #13
Closed

Allow for overwriting options deep in task graph #5

hazbottles opened this issue Jul 28, 2021 · 0 comments · Fixed by #13

Comments

@hazbottles
Copy link
Owner

import flonb

@flonb.task_func
def add(a, b):
    return a + b


@flonb.task_func
def multiply(a, b):
    return a * b


@flonb.task_func
def my_calc(
    added=flonb.Dep(add),
    multiplied=flonb.DynamicDep(lambda x, y: multiply.partial(a=x, b=y)),
):
    return added, multiply


>>> my_calc.compute(a=1, b=2, x=4, y=5)
ValueError: Options ['a', 'b'] have already been pre-supplied to 'multiply'.

This should pass, mutliply.partial(a=x, b=y) should ignore the higher level a=1, b=2 values.

@hazbottles hazbottles linked a pull request Jul 1, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant