use built in clip - #309
Conversation
Codecov Report
@@ Coverage Diff @@
## main #309 +/- ##
=======================================
Coverage 94.50% 94.50%
=======================================
Files 23 23
Lines 2566 2566
=======================================
Hits 2425 2425
Misses 141 141
Continue to review full report at Codecov.
|
| np.trapz, tpr, fpr, input_core_dims=[[dim], [dim]], dask="allowed" | ||
| ) | ||
| area = np.abs(area) | ||
| area = abs(area) |
There was a problem hiding this comment.
I see no difference in speed
There was a problem hiding this comment.
It calls __abs__ (unlike using the builtin sum, which would be much slower)
|
any idea why this got closed @aaronspring ? |
Ups. Sorry. No. |
|
I used fixed and then mentioned this PR in my climpred PR. Didn’t know this works across repos |
|
I don’t see how I could reopen… |
|
No worries. Seems crazy that GitHub allows that |
Closes errors seen in #308
The latest xarray did some refactoring on the built in clip method. It broke something in xskillscore but it helped identify areas of improvement
we were calling
np.clip(xarray object, min, max). There is the built in clip method which is preferred:We were calling
np.abs(xarray object). We can use the python abs method to do the same:For what it's worth here's how the clip refactor showed up in xskillscore.
Latest:
xarray v0.17.0: