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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in shared scripts for Schlund et al., JGR: Biogeosciences, 2020 #1845

Merged
merged 3 commits into from Oct 12, 2020

Conversation

schlunma
Copy link
Contributor

@schlunma schlunma commented Oct 7, 2020

This PR adds changes to shared diagnostic script functions necessary for including my recently accepted paper on ("Constraining uncertainty in projected gross primary production with machine learning"). It would be really nice to get this merged as fast as possible so I can open the PR with the actual additions after that. I would really like to have this in v2.1 so I can update the "code availability" section of my paper 馃槃


Tasks

  • Create an issue to discuss what you are going to do, if you haven't done so already (and add the link at the bottom)
  • Give this pull request a descriptive title that can be used as a one line summary in a changelog
  • Make sure your code is composed of functions of no more than 50 lines and uses meaningful names for variables
  • Circle/CI tests pass. Status can be seen below your pull request. If the tests are failing, click the link to find out why.
  • Preferably Codacy code quality checks pass, however a few remaining hard to solve Codacy issues are still acceptable. Status can be seen below your pull request. If there is an error, click the link to find out why. If you suspect Codacy may be wrong, please ask by commenting.
  • Please use yamllint to check that your YAML files do not contain mistakes
  • (Only if really necessary) Add any additional dependencies needed for the diagnostic script to setup.py, esmvaltool/install/R/r_requirements.txt or esmvaltool/install/Julia/Project.toml (depending on the language of your script) and also to package/meta.yaml for conda dependencies (includes Python and others, but not R/Julia)
  • If new dependencies are introduced, check that the license is compatible with Apache2.0

Related to #1844

dict_['var_name'] = dict_.pop('short_name')
return dict_


def iris_project_constraint(projects, cfg, negate=False):
"""Create `iris.Constraint` to select specific projects from data.
def get_mean_cube(datasets):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very close to the multi_model_statistics preprocessor function, do we need an extra function here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is similar to multi_model_statistics but way easier. Also, multi_model_statistics takes products as input, which is inconvenient in this case. I'd like to keep that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multi model statistics also supports cubes since a few months. Actually, I hope that multi model statistics will soon look like this function, once we have lazy vertical interpolation I think it can be implemented like that. However, it's fine if you want to keep it like this, we can always replace this later. When I was first reviewing this, I thought it was part of the public API, but it isn't, so it should be fine to add and remove things.

Copy link
Member

@bouweandela bouweandela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Are the shared functions that are changed in this pull request also used in other diagnostics? If so, it might be good to check that those aren't broken by your changes.

@schlunma
Copy link
Contributor Author

schlunma commented Oct 9, 2020

Thanks for your review! I check if these functions are used in other diagnostics and test all those.

@schlunma
Copy link
Contributor Author

schlunma commented Oct 9, 2020

Succesfully tested recipe_ecs.yml, recipe_cox18nature.yml, recipe_tcr.yml and recipe_ecs_constraints.yml (in v2.1 branch of ESMValCore), so this PR is ready to go 馃憤

@schlunma schlunma merged commit d56760d into master Oct 12, 2020
7 checks passed
@schlunma schlunma deleted the common_changes_for_schlundetal branch October 12, 2020 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants