georgiesamaha / configBuilder-nf

Nextflow config builder scripts for supported HPC infrastructures.
7 stars 1 forks source link

Fix writing of config to ensure no 'nonsense' output #38

Closed jfy133 closed 9 months ago

jfy133 commented 11 months ago

Due to the earlier fix of skipping the selection of executor, we opted to use a 'none' indicator. However the writing function still executed but setting 'executor' to none, which makes no sense.

This PR deactivates writing of the executor option, and also the entire process scope, if executor is set to none (and in the future other process related parameters).

I do wonder if we should refactor how all the information is saved and then written to file. I wonder if it would be easier to save a (nested) dictionary like format, and then just write what is in there, rather than (as I've done here) just evaluate if each scope is not none (or false etc.)

To make the writing easier, we could also use the 'long form' of writing configs, e.g. instead of

process {
    executor = 'slurm'
}

we could write

process.executor = 'slurm'