-
Notifications
You must be signed in to change notification settings - Fork 40
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
use built in clip #309
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.
|
@@ -1153,9 +1153,9 @@ def _auc(fpr, tpr, dim="probability_bin"): | |||
area = xr.apply_ufunc( | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isnt np faster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no difference in speed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: