Repository navigation
Histogram update: support range, weights and density - #3124
Merged
Merged
Conversation
emcastillo
reviewed
Feb 28, 2020
emcastillo
reviewed
Feb 28, 2020
emcastillo
reviewed
Feb 28, 2020
fix variable name in docstring Co-Authored-By: emcastillo <[email protected]>
use cupy.float64 rather than float or cupy.double use cupy.complex128 rather than complex
Member
|
Jenkins, test this please |
Collaborator
|
Successfully created a job for commit 8bd4177: |
Member
|
Jenkins CI test (for commit 8bd4177, target branch master) succeeded! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the
histogramfunction to support therange,weightsanddensitykwargs.It should be easiest to review the 3 commits sequentially as each of them deals with a separate kwarg.
Details
The helpers
_get_outer_edges,_get_bin_edgesand_ravel_and_check_weightsare closely based on their NumPy implementations (except that they do not automatically convert array-likes tondarray).NumPy itself has a fast code path for uniform bins that loops over blocks of ~65k elements using
bincountand then a second path for non-uniform bins that usessearchsorted. I have not made any changes related to those here, but left the current implementation based onElementwiseKernel.One question on API:
In NumPy there is also a
normedargument, but its use is deprecated, so I did not add it here. My question is whether the argument should still be in the function signature and just raise aNotImplementedErrorif the user tries to use it?Potential follow-ups:
histogramdd(I have an implementation for this, and can make a follow-up PR)cupy.histogram. I haven't worked on this but it looks like it would be easy to add.