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
Make it possible to use write_plots and write_netcdf from recipe instead of config-user.yml #2018
Conversation
@esmvalbot Please run examples/recipe_python.yml |
Since @bouweandela asked, ESMValBot will run recipe examples/recipe_python.yml as soon as possible, output will be generated here |
ESMValBot is happy to report recipe examples/recipe_python.yml ran OK, output has been generated here |
Following the conversations in the other related pull requests and issues - shouldn't it be a default to write netcdf/plot files, so add it more as an optional argument to turn it off ("no_plots"/"no_netcdf"), rather than on? This would feel more in line with the diagnostics that currently don't have the on/off capabilities. I don't think changing the example recipe that new developers might look at to include an option to turn it on when it should be on by default is a good idea. Might also just be me nitpicking though ^^ |
@esmvalbot Please run recipe_seaice.yml |
ESMValBot is sorry to report it failed to run recipe recipe_seaice.yml: exit is 1, output has been generated here |
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.
Some general comments in addition to the comments on the code:
- I agree that
write_netcdf
andwrite_plots
might not be optimal names, but since some python diagnostics are using them we should stick to it for consistency. - I agree with @bettina-gier that we should not use
write_netcdf
in an example recipe if we think that user's should not use it. - The new optional attributes for all affected diagnostics need to documented in the docstring/header of the diagnostic and in the
rst
file of the corresponding recipe. - We should make sure that all python diagnostics still run when
write_plots
andwrite_netcdf
are not added tocfg
automatically, e.g. by making sure to usecfg.get('write_plots', True)
instead ofcfg['write_plots']
. - I think we should not use custom diagnostic options in code that affects all diagnostics, i.e. remove this check here:
if cfg.get('write_netcdf', True):
Thanks for your feedback @bettina-gier and @schlunma.
That latter remark was also my thinking in keeping the name
@schlunma I would prefer to leave this for now. I think it is up to the recipe maintainers to update their recipes and associated documentation before the feature is removed. I just made the changes to the .ncl files so it's actually possible to run the recipe by just updating that, without the need to change code. Would that be acceptable for you? |
Thanks for the changes!
This would of course be the optimal solution, but in practice this is most likely not feasible. All of the affected recipes/diagnostics will fail in Do we have a proper documentation for the deprecation (an issue and maybe also in the documentation itself)? If yes, I can live with that, but I'm not super happy with it. Can you please remove the
? I don't like this hidden condition on diagnostic specific variables. I think if this feature is desired it should be used in the diagnostic like this: if cfg.get('write_netcdf', True):
save_data(...) |
Yes, we have issue #2005, a mention in the ESMValCore changelog and it is also mentioned in the documentation on config-user.yml here, though for some reason the documentation build looks outdated.
There is the documentation that describes the feature as deprecated and technical reviewers should be aware of this too.
Will do |
@esmvalbot Please run examples/recipe_python.yml |
ESMValBot is happy to report recipe examples/recipe_python.yml ran OK, output has been generated here |
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.
Great! Ready to merge now π
Thanks for reviewing! |
* add woa18 cmorizer * fix units * add test * fixes after review * fixing test * remove commented out lines * fixing style * Consolidate WOA cmorizer for 2018 dataset (#1812) - use WOA 2018 data at 1 degree monthly fields - set to OBS6 Info to enable the derivation of surface and Oyr variables - add automatic download if raw data are not available * fix codacy * update reference and input.rst for WOA (#1812) * try to fix test check for woa (#1812) * add missing docstring to functions * remove obsolete _fix_data function (#1812) * put back unit fix for WOA nutrients (#1812) * try to fix test_cmorize_obs.py for woa * fix codacy * add correct size command * redo fix test woa * still working on test * fix nfile number count * Always derive WOA Oyr data and fix related small bug in computation. * adjust WOA dict in recipe_check_obs.yml * add more cases to bgc units handling * step back on woa cmorizer and create a single script for WOA13 and WOA18 * comment multimodel in preprocessor as only one model is used * fix bug in surface variable extraction for cmorize_obs_woa.py * update references and docs for WOA obs * use WOA2018 observations in recipe_ocean_bgc.yml * add woa2013v2 bibtex reference * fix indentation in bgc_units of diagnostic_tools * correct commented lines in cmor_config/WOA.yml * update list of variables for WOA in recipe_check_obs.yml * revise comments in header of cmorize_obs_woa.py (see #1812) * update recipe_check_obs.yml with WOA data and vars (see #1812) * set correct number of woa datafiles in test_cmorize_obs.py (#1812) * update recipe_ocean_bgc.yml with use of write_plots (see #2018) * revert recipe_ocean_bgc.yml to use WOA2013v2 * remove changes to recipe_ocean_bgc, update to the recipe will follow in #2324 * revert deleted datasets * added vars to test Co-authored-by: Valeriu Predoi <valeriu.predoi@gmail.com> Co-authored-by: Tomas Lovato <tomas.lovato@cmcc.it> Co-authored-by: remi-kazeroni <remi.kazeroni@dlr.de>
Description
Make it possible to use write_plots and write_netcdf from recipe instead of config-user.yml and update the Python example recipe so it does this.
Before you get started
Checklist
It is the responsibility of the author to make sure the PR is ready to review. The icons indicate whether the item will be subject to the π Technical or π§ͺ Scientific review.
pre-commit
oryamllint
checksNew or updated recipe/diagnostic:
@esmvalbot
or some other machine without modificationTo help with the number pull requests: