Open HalfPhoton opened 1 year ago
Hi all! I have similar issue with config and dict: I set my config file like this:
params {
jellyfish {
mer_len = 30
size = '100M'
keep_jf = 'false'
}
}
When I run the command, willing to change one of the value, I proceed like this:
nextflow run --jellyfish.mer_len 50 main.nf
The value is correctly set, but the two other (size and keep_jf) disappeared and are unset. It seems that the variables set in jellyfish{} are reinitialized instead of being updated. Is it a wanted behavior ? Should not jellyfish be updated instead ? Thanks!
Any advance on this issue ?
I think nested params were never fully supported. Some things work like defining nested params in config, assigning them in the script or on the command line, but there are many edge cases like the ones you have identified
Overall, I would discourage the use of nested params in favor of a flat set of params. You can still have map/dict params with nested values, and still access them as if they were nested params e.g. params.foo.bar.baz
, but they should always be defined as a group rather than assuming that they will be deeply merged.
In future I think we should try to clarify this behavior and phase out nested params more explicitly
OK, thanks a lot for your answer.
Bug report
Expected behavior and actual behavior
The parameter resolution / prioritisation
main.nf
<nextflow.config
< cli, doesn't work as expected for dictionaries which are defined in the "assignment style" as shown in the example:I'd expect both to assignment style and dict style definitions to resolve in the same way.
In this example we see that
where
resolves tonextflow.config
as expected. For dicts however, we see that the style used to define the parameters inmain.nf
has an effect on the resolution. This behaviour is the same for cli arguments too.Steps to reproduce the problem
Example code above with:
nextflow main.nf --cli_bad.where "cli" --cli_ok.where "cli"
Program output
Shown in the example above
Environment
Additional context
This might not be a bug but a misunderstanding but it would be nice if this was mentioned in the docs.
I hope this helps anyone else out as well.