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

re-run diagnostic script stuck #136

Closed
tomaslovato opened this issue Jul 2, 2019 · 5 comments
Closed

re-run diagnostic script stuck #136

tomaslovato opened this issue Jul 2, 2019 · 5 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@tomaslovato
Copy link
Contributor

After the successful execution of a recipe, re-running the diagnostic script stop with the following message:

Script will abort to prevent accidentally overwriting your data in these directories
Use -f or --force to force emptying the output directories or use -i or --ignore-existing to ignore existing output directories.
Script will abort to prevent accidentally overwriting your data in these directories

This can be easily solved by adding the suggested options -f or -i, but I fell like that the re-run message produced by code at the end of diagnostic function should more clear, e.g. by including at least -i.

In particular, -i can be added in rerun_msg variable within the following piece of code:

rerun_msg = 'cd {}; '.format(cwd)
if env:
rerun_msg += ' '.join('{}="{}"'.format(k, env[k]) for k in env
if k not in os.environ)
rerun_msg += ' ' + ' '.join(cmd)
logger.info("To re-run this diagnostic script, run:\n%s", rerun_msg)

It could be also an idea to add in the log informations the need to specify -f or -i options.

@tomaslovato tomaslovato added the bug Something isn't working label Jul 2, 2019
@bouweandela
Copy link
Member

Note that those options are specific for Python diagnostics, they are not implemented in NCL, R, or Julia.

@bouweandela bouweandela added documentation Improvements or additions to documentation enhancement New feature or request and removed bug Something isn't working labels Jul 3, 2019
@tomaslovato
Copy link
Contributor Author

@bouweandela I recognize it is rather trivial, although not immediate, so I'll close this issue if you agree...

@bouweandela
Copy link
Member

It's up to you, I think it's a good suggestion for improving the user friendliness of the tool. Unfortunately we have limited time available to implement all of those suggestions...

@tomaslovato
Copy link
Contributor Author

@bouweandela I report here below a tiny change to the above referred code to incldue the -i options in the log info when using python diags ...

@@ -411,6 +411,8 @@ class DiagnosticTask(BaseTask):
             rerun_msg += ' '.join('{}="{}"'.format(k, env[k]) for k in env
                                   if k not in os.environ)
         rerun_msg += ' ' + ' '.join(cmd)
+        if cmd[1].endswith('.py'):
+            rerun_msg = rerun_msg.replace('.py', '.py -i', 1)
         logger.info("To re-run this diagnostic script, run:\n%s", rerun_msg)

         try:

If it looks ok, should I open a PR or you want to add it in the code ....

@tomaslovato
Copy link
Contributor Author

This was solved via #326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants