Conversation
SarahAlidoost
left a comment
There was a problem hiding this comment.
@ledm thank you for this utility. I had a look at the script, pull request checklist, and its related issues. It seems that this pull request is still a work in progress. Could you please either fix the remaining issues or change it to a draft pull request? Also, to review this task, I run the script on recipe_python using the following diagnostics settings:
pr:
preprocessor: preprocessor1
mip: Amon
start_year: 2000
end_year: 2002
dataset: CanESM2
exp: historical
ensemble: r1i1p1
project: CMIP5
It results in an error TypeError: sequence item 0: expected str instance, list found related to the function get_rootpath(). Because there is a list of CMIP5: [~/cmip5_inputpath1, ~/cmip5_inputpath2] in rootpath section in my config_user.yml file. This needs to be fixed somehow.
|
@ledm I am wondering if you have had a chance to look at my review comment? It would be great if we could update the status of the pull request. Thanks. |
|
Hi Sarah, hope you're well! I won't really have time to work on this for a while, but I believe that @valeriupredoi talked about taking over this utility. Guess he's pretty busy too though! |
|
I am a bit less busy these days so I can defo have a stab at this next week 👍 |
|
OK I started working on this, more tomorrow 👍 🍺 |
|
OK we're ready to get this in @stefsmeets would be so kind and approve or dismiss the change request, mate - we'll tackle your suggestions in a future overhaul of both the data finder and this, for now let's just allow people to use this and report issues that I'll fix on the go, rather than get major overhaul work started 👍 🍺 |
changes suggested fixed, cheers
|
@bouweandela @stefsmeets I would very much like to merge this asap (today or tomorrow) since I would be very happy to include this in the release: Stef, I took care of your suggestions - the ones that dealt with possible changes (like the string formatting etc) and I staled your review to buy you time to just approve this, Bouwe - I got a lot of feedback from both Sarah and Ruth and they both tested it heavily. This is a very useful bit of tool for users, so that's why it'd be very nice to have it released. The only snag is that |
|
@valeriupredoi Can you have a look at the failing tests? I noticed you forgot to add the |
|
It would be really great if we could get this merged soon so diagnostic developers can start using it, but maybe it's not needed for the release, because diagnostic developers will almost always use a development installation of ESMValTool. |
sounds good, lemme fix the private imports and the tests, then I'll merge and leave it for the next release, there may be bugs to fix in it anyway, well- not bugs - but lack of features, that users may unearth by using it in anger |
OK @bouweandela man, I fixed all tests, migrated code from private esmvalcore to here, and the env solves well both on my machine and the CI one, the only caveat is that when the new config module will get in the next core release the config developer file path needs to change here, but we'll bridge that bridge when we get to it. You wouldn't object too much about merging would you? 🍺 |
That would be fine with me, but could you please also fix the other private import? |
|
Thanks for fixing the private imports @valeriupredoi. It would be fine with me to merge this now. |
|
terrific, cheers muchly @bouweandela and the other hard working reviewers, finalmente this one's in 😁 |
Added a script that automates filling out the recipe with available data, it's called recipe_filler.py, in utils.
You write your diagnostic in the unfilled recipe like this:
and it will add an additional_diagnostics section:
So, it works okay. This example is fairly trivial. The more specific your list of requirements, the faster it runs and the fewer datasets it requires. If you wanted to see all datasets, just remove this line from your unfilled recipe:
The problems with this tool:
The additional_datasets is added at the top of the preprocessor, which is ugly.@valeriupredoi fixed this: it is now added under each variable using correct yaml syntax
dataset,ensemble,expin the example above).it doesn't understand yml anchors.@valeriupredoi fixed this by using yaml dump and save appropriately
you most likely only want CMIP6 data from one grid, so there's no way to have a preference.@valeriupredoi fixed this - you can ask for the mother of all grids now
Hard wired path to the configurtation file./config-user.yml.@valeriupredoi fixed this too: you can input your own file or you can not and the default
~/.esmvaltoon/config-user.ymlwill be used insteadIt doesn't check whether the requested years are available.@valeriupredoi fixed this too,
start_yearandend_yearare mandatory fields that will allow file filteringI added a hashable dictionary class and made a dictionary where the index was another dictionary. lol. very cool and very xzibit/pimp my ride. This was from before christmas 2019, so who knows why I did that!@valeriupredoi has totally unpimped your ride because it's not needed 😁
Before you start, please read our contribution guidelines.
Please discuss your idea with the development team before getting started, to avoid disappointment later. The way to do this is to open a new issue on GitHub. If you are planning to modify an existing functionality, please discuss it with the original author(s) by tagging them in the issue.
Tasks
yamllintto check that your YAML files do not contain mistakesIf you need help with any of the tasks above, please do not hesitate to ask by commenting in the issue or pull request.
Closes #671
Closes #1170
EDIT by @valeriupredoi on 28/09/2020
Cheers @ledm for starting this and for the code you wrote! I have taken your draft and rewritten most of it, but the core functionality remains the same; I have fixed a number of outstanding issues which you nicely pointed out in this message and edited the message accordingly. I think it's in an okay shape now, although it still needs testing in anger and actual unit tests for each of the functions plus most of the functions will have to become private (for I am lazy and I really don't want to write a lot of api documentation 😁 ). Can I please ask you and @SarahAlidoost @bouweandela @jvegasbsc @nielsdrost @hb326 @mattiarighi and anyone else who wants to test this and report any issues they encounter, please 🍺 I will then fix the issues, write more documentation and tests and then, Bouwe-willing, we can merge :)