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

Support parameter defaults that depend on other parameters #139

Open
avicennax opened this issue Feb 23, 2020 · 2 comments
Open

Support parameter defaults that depend on other parameters #139

avicennax opened this issue Feb 23, 2020 · 2 comments

Comments

@avicennax
Copy link

avicennax commented Feb 23, 2020

I'd like to be able to define parameters in my Flow as such:

experiment_name = Parameter(
    'run_name',
    help="Experiment version",
    default="v0"
)

data_path = Parameter(
    'data_path',
    default=f"s3://bucket/experiments/{experiment_name}/data"
)

scripts_path = Parameter(
    'scripts_path',
    default=f"s3://bucket/experiments/{experiment_name}/scripts"
)

Is there a way to easily do this or plans to support it? Naturally the example above fails since the string form parameters aren't generated until the flow is instantiated. However, the flow instance parameters are properties with no setters so they can't be formatted at flow run-time. I've also tried creating function wrappers but they fail due to type violations.

While I can create new formatted parameter string objects and bind them to the flow to use downstream - it feels like an anti-pattern.

@savingoyal
Copy link
Collaborator

Thanks, interesting idea indeed but we will have to think through the evaluation order if parameters depend on other parameters.

@savingoyal
Copy link
Collaborator

while not exactly what's asked in this issue, #1962 should help in many similar use cases.

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

No branches or pull requests

2 participants