Skip to content

Conversation

@schlunma
Copy link
Contributor

@schlunma schlunma commented Oct 23, 2019

This PR adds a land/sea fraction weighting preprocessor as suggested by @ChrisJones-MOHC in #298 (I borrowed some text of your issue for the documentation, I hope that's okay 😁). With this change, many derived variables are not needed anymore, so there are a few changes necessary in ESMValTool after that.

Requires #230.

  • 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)
  • This pull request has a descriptive title that can be used in a changelog
  • Add unit tests
  • Public functions should have a numpy-style docstring so they appear properly in the API documentation. For all other functions a one line docstring is sufficient.
  • If writing a new/modified preprocessor function, please update the documentation
  • Circle/CI tests pass. Status can be seen below your pull request. If the tests are failing, click the link to find out why.
  • Codacy code quality checks pass. 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
  • If you make backward incompatible changes to the recipe format, make a new pull request in the ESMValTool repository and add the link below

If you need help with any of the tasks above, please do not hesitate to ask by commenting in the issue or pull request.


Closes #298. Necessary for ESMValGroup/ESMValTool#473.

Necessary changes for ESMValTool: ESMValGroup/ESMValTool#1466.

@schlunma schlunma added enhancement New feature or request preprocessor Related to the preprocessor labels Oct 23, 2019
@schlunma schlunma self-assigned this Oct 23, 2019
@schlunma
Copy link
Contributor Author

In my opinion explicitly having to set an option to False is not silently ignoring it (note that there is also a warning). I think it's comparable to the --skip-nonexistent switch, which also allows missing data if explicitly desired.

Is there a reason to want to use a single preprocessor profile for all datasets? E.g. because you want to apply multi model mean or masking functions?

Because it's way more user friendly. Using two different preprocessors requires another block in the variables section for the same variable with its own additional_datasets, etc.

BTW, all the _grid variables (which implicitly used this preprocessor) had the same behavior (and there was no even a warning).

@schlunma
Copy link
Contributor Author

It would be really nice if we could merge this soon, since I need it for ESMValGroup/ESMValTool#473.

Maybe someone else has an opinion on this? @valeriupredoi @mattiarighi

@valeriupredoi
Copy link
Contributor

valeriupredoi commented Nov 12, 2019 via email

@mattiarighi
Copy link
Contributor

mattiarighi commented Nov 12, 2019

I'm fine with this, although I had no time to test it.

@schlunma
Copy link
Contributor Author

@bouweandela, do you have further comments?

@bouweandela
Copy link
Member

I'm still not convinced that this is a good approach, for the reasons mentioned above. If you really insist on using one preprocessor profile to do two different preprocessing chains, maybe an exclude argument taking a list with the names of datasets, like we have for the multi model functions, could be an option instead of strict? At least that makes it immediately clear from the recipe which datasets will skip this preprocessing step.

@schlunma
Copy link
Contributor Author

All right, that sounds like a reasonable compromise to me. I will implement this as soon as possible.

@schlunma
Copy link
Contributor Author

@bouweandela I made all necessary changes, hopefully we can merge this soon now.

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 to me now. Could you please also make the pull request to adapt exiting recipes so they use the new preprocessor function instead of a derived variable?

@bouweandela
Copy link
Member

@mattiarighi Please test before merging, I only looked at the code.

@schlunma
Copy link
Contributor Author

Will do 👍

@mattiarighi
Copy link
Contributor

I can only test this together with the corresponding PR in ESMValTool where the recipes are adjusted.

@schlunma
Copy link
Contributor Author

schlunma commented Dec 2, 2019

You can test this recipe in this branch.

@mattiarighi
Copy link
Contributor

Tested successfully! 🎉

@mattiarighi mattiarighi merged commit 0eda231 into development Dec 3, 2019
@mattiarighi mattiarighi deleted the landsea_fraction_preprocessor branch December 3, 2019 07:47
@bouweandela
Copy link
Member

@schlunma @mattiarighi Is there a corresponding pull request in the ESMValTool repository already? Or is this not needed? Already done?

@schlunma
Copy link
Contributor Author

schlunma commented Jan 2, 2020

@bouweandela Only small changes were necessary, they have already been addressed in ESMValGroup/ESMValTool#1466.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request preprocessor Related to the preprocessor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add land/ocean-fraction weighting preprocessor

5 participants