ESMValGroup / ESMValTool

ESMValTool: A community diagnostic and performance metrics tool for routine evaluation of Earth system models in CMIP
https://www.esmvaltool.org
Apache License 2.0
217 stars 127 forks source link

Two problems with re-running diagnostics #1271

Closed ledm closed 4 years ago

ledm commented 5 years ago

If a diagnostic fails, we get the message

 INFO    To re-run this diagnostic script, run:

This message is so helpful! It has saved several hours of work many times. However, if you add the -f argument to force an overwrite, it deletes not just the failed diagnostic, but the contents of the entire plots directory.

Furthermore, there is no easy way to re-run all diagnostics without re-running the entire recipe. This means that if a diagnostic fails, we have to delete all the plots, fix the bug that causes the break, then re-run the entire recipe instead of just the broken diagnostic.

There are two easy solutions to this problem:

  1. the -f argument should only delete the plots linked to the specific diagnostic, not all plots.
  2. A message at the end of the recipe saying
    INFO    To re-run this and all diagnostic scripts, run:

    Thought?

valeriupredoi commented 5 years ago

Ill have a looksee today, cheers dude :beer:

schlunma commented 5 years ago
1. the `-f` argument should only delete the plots linked to the specific diagnostic, not all plots.

I think there's an -i option which ignores existing files and does not delete them. Have you tried that?

valeriupredoi commented 5 years ago

indeed -i or --ignore-existing seems to do the trick for me (it's an option of the run_diagnostic context manager)

ledm commented 5 years ago

Okay, that manages the overwrite problem. Thanks!

What about when a diagnostic crashes ESMValTool before other diagnostics have finished? Sometimes we need to re-run all diagnostics just to fill in the gaps. Is there a command to run all the diagnostics?

valeriupredoi commented 5 years ago

yeah, it's the following:

esmvaltool -c config-user.yml recipe.yml

:rofl:

But seriously, no, not yet...

ledm commented 5 years ago

It's a joke, but some of my recipes take 3-4 hours to run the preprocessors. (Other people have recipes that take much longer than that.)

Re-running all the preprocessors, just to be lazy seems a bit much.

Could we just pipe the output lines "To re-run this diagnostic script, run:" into a shell script and save it in the run directory? Surely that wouldn't be too hard to implement for one of you pros?

valeriupredoi commented 5 years ago

added info in https://github.com/ESMValGroup/ESMValTool/pull/1317

valeriupredoi commented 4 years ago

closed via https://github.com/ESMValGroup/ESMValTool/pull/1317

mattiarighi commented 4 years ago

@valeriupredoi is in "cleaning mode". :smile:

valeriupredoi commented 4 years ago

if I was too harsh do let me know by re-opening issues, but expect retributions :grin:

mattiarighi commented 4 years ago

No worries, it's much appreciated!