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

Make sure area_statistics preprocessor always returns original dtype #1239

Merged
merged 2 commits into from
Jul 20, 2021

Conversation

zklaus
Copy link

@zklaus zklaus commented Jul 20, 2021

Description

This adds code to the area_statistics preprocessor to detect whether it has changed the dtype of the cube. If this is the case, it changes the dtype back to the original dtype.

Closes #1236

Link to documentation:


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@zklaus zklaus added bug Something isn't working preprocessor Related to the preprocessor labels Jul 20, 2021
@codecov
Copy link

codecov bot commented Jul 20, 2021

Codecov Report

Merging #1239 (29f695a) into main (2a0bb11) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1239   +/-   ##
=======================================
  Coverage   85.54%   85.55%           
=======================================
  Files         188      188           
  Lines        9150     9156    +6     
=======================================
+ Hits         7827     7833    +6     
  Misses       1323     1323           
Impacted Files Coverage Δ
esmvalcore/preprocessor/_area.py 90.98% <100.00%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a0bb11...29f695a. Read the comment docs.

@zklaus
Copy link
Author

zklaus commented Jul 20, 2021

@jvegasbsc, this is essentially the same PR as for the climate_statistics (#1237) that you just reviewed, only now for area_statistics. Would you mind having a look?

@zklaus zklaus merged commit 8c9a151 into main Jul 20, 2021
@zklaus zklaus deleted the fix-area-statistics-dtype branch July 20, 2021 13:02
zklaus pushed a commit that referenced this pull request Jul 21, 2021
…1239)

* Make sure area_statistics returns same dtype as input

* Use consistently dtype float32 in area_statistics tests
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.

The area_statistics preprocessor sometimes changes the dtype
2 participants