Sorry, thought I was putting those previous messag...
# questions
Sorry, thought I was putting those previous messages in a single thread. Fixed New question, new thread: Is there a way to set a parameter in a node? If my first node calls a function
that simply gets the datetime date, can I assign that date to a parameter?
You will probably want to set it as parameters instead of changing your parameters in a pipeline - this makes your pipeline very hard to debug. As your previous question is asking about how to output the parameters, imagine if your parameters later actually get assigned a different value.
The easiest way to do so is probably to register a custom resolver with
(itโ€™s merge but not released yet) Essentially you will register a function
in your OmegaConfigLoader And then in your parameter.yml you can reference it with
Copy code
my_date : ${my_date}
Oh that is very fun, I'll have to try that out. Thanks!
@Nok Lam Chan is right - after the next release (or if you use the
branch of the source code), you would be able to set custom resolvers through
in your
like this :
Copy code
def mydate():
    return whatever

    "custom_resolvers": {
        "date_resolver": lambda: mydate(),
And then in your
Copy code
my_date: "${date_resolver:}"
--- Right now you can also do in your
Copy code
def mydate():
    return whatever

from omegaconf import OmegaConf
if not OmegaConf.has_resolver("date_resolver"):
    OmegaConf.register_new_resolver("date_resolver, lamda: mydate())
๐Ÿ‘ 1
๐Ÿ‘๐Ÿผ 1