You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I was wondering how I could go about if I wanted to have a module setup some configuration parameters that are later used by another module as setup: e.g. imagine
[pipeline]
modules = module1 module2
can module1 use something like configuration.put_double('section', 'name', value)
to setup parameter 'name' in 'section' and then module2 read such configuration?
This is routine in the execute() function of modules, but I cannot make it work for the setup(), in fact trying as I wrote above gives a BlockNameNotFound error, and if I use a place holder and then use replace_double method I get the placeholder value and not the replaced one. I can save it and pass it during execute(), but that would be less ideal for my purposes.
I hope my question is clear.
Thank you,
Vittorio
The text was updated successfully, but these errors were encountered:
Yes, this behaviour isn't currently supported directly. But there are a few ways to do something like it:
Specify this value yourself in the parameter file, rather than computing it in the module itself. If you put it in a special section called [DEFAULT] then it will be available to any module.
Defer computing this value until the execute function is called, when it can be passed through the data block to subsequent modules like any other value. Then if you returned e.g. a dictionary from the setup function then the value can be stored in that dictionary and it will still be there the next time execute is called, for the next parameter set. So the next time you can just get it out of the dictionary in both modules.
I hope this is useful - let me know if one of these could work for you.
Dear Joe,
Thanks a lot for your prompt reply.
Both works although they are not elegant for my case.
As the value module1 computes depends itself on configuration of module1 I could make a lookup table in configuration and assert the value I calculate is the tabulated one.
This fan also work, however I make visualization plots in the setup to visualize the data (which depend on the calculated value) so the plots I made would not be corrected by the values I calculate.
Hello,
I was wondering how I could go about if I wanted to have a module setup some configuration parameters that are later used by another module as setup: e.g. imagine
can module1 use something like
configuration.put_double('section', 'name', value)
to setup parameter 'name' in 'section' and then module2 read such configuration?
This is routine in the execute() function of modules, but I cannot make it work for the setup(), in fact trying as I wrote above gives a
BlockNameNotFound
error, and if I use a place holder and then use replace_double method I get the placeholder value and not the replaced one. I can save it and pass it during execute(), but that would be less ideal for my purposes.I hope my question is clear.
Thank you,
Vittorio
The text was updated successfully, but these errors were encountered: