Skip to content
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

set default value of stop_if(keep_output) to True. #1161

Closed
BoPeng opened this issue Jan 7, 2019 · 5 comments
Closed

set default value of stop_if(keep_output) to True. #1161

BoPeng opened this issue Jan 7, 2019 · 5 comments

Comments

@BoPeng
Copy link
Contributor

BoPeng commented Jan 7, 2019

The default value of keep_output of action stop_if is currently set to False.

Suppose users do not know this option at all and keep_output=True by default, the output file will be kept if it is already generated before the stop_if call, and will not be available if it is not generated. There is no surprise.

If the default is set to False, the output will not exist in both cases, which can be a surprise to users. So, from a less surprise point of view, this option should better be set it to False by default.

@gaow
Copy link
Member

gaow commented Jan 7, 2019

Sure. But if the output is not generated then SoS will know it and not complain at the end of the step?

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 7, 2019

Yes but the point is that removing a file is an aggressive action that should not be done by default.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 7, 2019

But then the parameter name should be changed from a negative to a positive one, something like

stop_if(cond, remove_output=True)

instead of

stop_if(cond, keep_output=False)

because the consequence of the option is to remove _output from step_output, and the files if they exist.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 7, 2019

stop_if(cond, discard_output=True)

sounds more appropriate.

@BoPeng
Copy link
Contributor Author

BoPeng commented Jan 7, 2019

stop_if(cond, no_output=True)

is used because discard or remove implies that the output already exists, and no_output is more neutral (and shorter) in this regard. Hopefully you have not used this new parameter somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants