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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug in time weights calculation #695

Merged
merged 3 commits into from
Jul 9, 2020
Merged

Conversation

schlunma
Copy link
Contributor

@schlunma schlunma commented Jul 3, 2020

This PR fixes the the bug in the calculation of the time weights introduced by #684. I know that this implementation does not use dask anymore, but unfortunately iris.util.broadcast_to_shape does not support dask.

This needs to be included for v2.0.0.

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)
  • 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 #694.

@schlunma schlunma added the bug Something isn't working label Jul 3, 2020
@schlunma schlunma added this to the v2.0.0 milestone Jul 3, 2020
@schlunma schlunma self-assigned this Jul 3, 2020
@mattiarighi mattiarighi added the preprocessor Related to the preprocessor label Jul 6, 2020
Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

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

nice find and fix, are we 100% sure we can not keep things lazy (see my in-line suggestion) 🍺

esmvalcore/preprocessor/_time.py Outdated Show resolved Hide resolved
@valeriupredoi
Copy link
Contributor

@bjoernbroetz pls keep an eye on this one -> when it gets merged into master, if the automated merge into the AR6 branch is broken again, this will have to be merged asap since it breaks a lot of recipes (yeh, my bad for not properly testing the merge commit that fixed the weights upstream) 🍺

@valeriupredoi
Copy link
Contributor

it's good by me, cheers @schlunma - let's get it in!

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.

@mattiarighi Could you please test?

@mattiarighi mattiarighi merged commit 556f1c7 into master Jul 9, 2020
@mattiarighi mattiarighi deleted the fix_time_weights branch July 9, 2020 10:27
@mattiarighi
Copy link
Contributor

@bouweandela can you please include this in the v2.0.0 branch?

bouweandela pushed a commit that referenced this pull request Jul 9, 2020
* Fixed calculation of time weights

* Fixed failing FLAKE8 test

* Added more test for time weighting and fixed cube dimensions in test
@bouweandela
Copy link
Member

Thanks! Done!

mattiarighi pushed a commit that referenced this pull request Jul 13, 2020
* Remove utils section (#697)

Moved the last script from esmvalcore/utils to ESMValTool

* Fixed bug in time weights calculation (#695)

* Fixed calculation of time weights

* Fixed failing FLAKE8 test

* Added more test for time weighting and fixed cube dimensions in test

* Avoid pytest version that crashes (#707)

* Suggested Documentation changes (#690)

Update documentation on relative diagnostics paths and preprocessor order.

Co-authored-by: Bouwe Andela <[email protected]>

* Options arg in read_config_user_file now optional

* Fix codacy warning

Co-authored-by: Bouwe Andela <[email protected]>
Co-authored-by: Manuel Schlund <[email protected]>
Co-authored-by: Steve Smith <[email protected]>
Co-authored-by: Bouwe Andela <[email protected]>
jvegreg pushed a commit that referenced this pull request Jul 16, 2020
* Remove utils section (#697)

Moved the last script from esmvalcore/utils to ESMValTool

* Fixed bug in time weights calculation (#695)

* Fixed calculation of time weights

* Fixed failing FLAKE8 test

* Added more test for time weighting and fixed cube dimensions in test

* Avoid pytest version that crashes (#707)

* Suggested Documentation changes (#690)

Update documentation on relative diagnostics paths and preprocessor order.

Co-authored-by: Bouwe Andela <[email protected]>

* Options arg in read_config_user_file now optional

* Fix codacy warning

Co-authored-by: Bouwe Andela <[email protected]>
Co-authored-by: Manuel Schlund <[email protected]>
Co-authored-by: Steve Smith <[email protected]>
Co-authored-by: Bouwe Andela <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preprocessor Related to the preprocessor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preprocessor climate_statistics fails
4 participants