-
Notifications
You must be signed in to change notification settings - Fork 12
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
specify default values in function definition #31
Comments
Thanks for bringing that up, @gregcaporaso. Yeah, I was not sure how to go about this initially and your guess is correct: I felt like leaving those undefined and letting the tools themselves pick the default values. I was not so much concerned with the text becoming outdated as I thought that on a tool version update one would need to review the text anyways to see whether anything else changed (to keep the q2 help in-line with the underlying tool) - under this assumption I'd need to review something somewhere anyway... However, your provenance argument absolutely speaks to me much more - I'll update that in another PR. Thanks! 🙏 |
That's definitely a reasonable assumption and good practice, but in my experience these things have a way of getting out of date. For example, if someone else takes over maintenance of the plugin in the future, they may not be fully aware of where all the changes need to be made. |
how should we handle the
The options I see:
Is there any way to edit provenance? So, e.g., if a preset is passed then the preset values get written into provenance instead of the param setting that was passed? Maybe I am being overly alarmist because, after all, the preset would also be written to provenance so the effect is reproducible... but it just seems misleading. EDIT: for now I am going with "option 3" in #43 , i.e., to warn whenever the presets parameter is used. But it would be interesting to know if we can overwrite provenance to write in the presets. |
@nbokulich, I agree with the approach you're taking now, and that it would be good to better support this type of situation in the future. |
At present, it looks like you tend to define default values implicitly, and it would be better to do this explicitly (i.e., when you define the function the action is mapped to).
I suspect that you are doing this so that the defaults are actually set by the underlying code if not overridden by the user, which makes sense intuitively but is not ideal for a few reasons. First, it could result in your help text becoming outdated and misleading (e.g., if you specify the default is 1, and the underlying code is changed so it's 16, the help text your user is referring to will be wrong). Next, and probably most importantly, if not specified explicitly the parameter values won't be stored in data provenance. And finally, if you define explicitly on function definition, the default value will autopopulate in the help text for your action.
As an example of how I recommend doing this, take a look at this snippet of the help text from
dada2 denoise-single
:That default value is specified here.
I recommend ultimately making this change across the whole code base.
The text was updated successfully, but these errors were encountered: