-
Notifications
You must be signed in to change notification settings - Fork 629
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
Document params-file and improve self-update #2673
Conversation
docs/cli.rst
Outdated
@@ -1265,6 +1265,12 @@ facilitates rapid iterations, inspections of any pipeline as well as debugging. | |||
$ nextflow run nextflow-io/hello -with-tower | |||
|
|||
|
|||
- Invoke the nextflow pipeline execution with a custom parameters ``YML`` file. | |||
The parameters which are specified through this mechanism are merged with the resolved configuration (base configuration and profiles) and only the common fields are overwritten by the ``YML`` file.:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The params file can be YAML or JSON. I would say YAML/JSON file instead of YML
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also @pditommaso we should clarify what happens if you provide params through a config file and a params file via CLI arguments. I think the params file takes priority but I'm not certain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this question has come up recently #2662
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was missing this conversation. The CLI params overrides the ones the json/yaml file.
You can see it here, it reads the params file and put it into the result
map. then if there are cli params
copy them over the result
map.
nextflow/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy
Lines 496 to 513 in 0f63f1a
final result = [:] | |
final file = getParamsFile() | |
if( file ) { | |
def path = validateParamsFile(file) | |
def type = path.extension.toLowerCase() ?: null | |
if( type == 'json' ) | |
readJsonFile(path, configVars, result) | |
else if( type == 'yml' || type == 'yaml' ) | |
readYamlFile(path, configVars, result) | |
} | |
// set the CLI params | |
if( !params ) | |
return result | |
for( Map.Entry<String,String> entry : params ) { | |
addParam( result, entry.key, entry.value ) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accomodate Ben's review about the JSON optoin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, updated it removing the refence to the NXF_VER. Eventually it could be added into a tip section
Updated the documentation for
--params-file
andself-update