-
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
Add snake_case to params normalization #3884
base: master
Are you sure you want to change the base?
Conversation
9397ed1
to
390effc
Compare
Signed-off-by: Arthur Vigil <arthur.vigil@invitae.com>
@@ -133,7 +134,7 @@ class ScriptBindingTest extends Specification { | |||
|
|||
then: | |||
map['field1'] == 1 | |||
map['field-1'] == null |
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.
this test case changes because camel case is a bit ambiguous with numbers- field-1
normalizes to field1
but field1 wasn't converting via camelCaseToHyphen
into field-1
.
@@ -184,7 +185,7 @@ class ScriptBindingTest extends Specification { | |||
when: | |||
def params = new ScriptBinding.ParamsMap('foo-bar':1) | |||
then: | |||
params.size() == 2 | |||
params.size() == 1 |
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.
ParamsMap.size
now more accurately reflects the number of params it contains.
CLI is being rewritten in #3600 so this code will soon be deprecated, closing |
Since the params normalization code is separate from the CLI, it should not be affected by the new CLI, so let's keep this open. However I would prefer to merge this fix #4188 first. |
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Signed-off-by: Arthur Vigil <arthur.vigil@invitae.com>
Signed-off-by: Arthur Vigil <arthur.vigil@invitae.com>
updated with merge from |
Looks like this is not merged. Any idea when this feature will be available? |
Unfortunately I don't think this will be merged soon because the params are being overhauled (#4669) and this change would likely need to be incorporated into that. Feel free to comment there to share your thoughts. I have been thinking about snake case though, and I think, if we have a params schema then we can intelligently convert kebab-case CLI params to either snake-case or camel-case depending on whether that param is defined in the schema. Also there is no need to keep the kebab-case params in the params map for the script since you wouldn't access those anyway (see #4702) |
fixes #3878. There are two changes here:
snake_case
pipeline param names are now handled in a way that is consistent with what nextflow does forkebab-case
andcamelCase
params, which are already interchangeable on the command line. That means--long-name
,--longName
, and--long_name
are parsed as the same param.ParamsMap('foo-bar':1)
produces a ParamsMap of size 2, which seems kind of confusing.