-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop vendored copy of indices and uses thereof (#56)
* Rewrite `center_of_mass` to use `arange` Instead of using the vendored `indices` function to multiply the image with, rewrite `center_of_mass` to just use `arange` and rely on Dask to handle the broadcasting when multiplying with the image. Should be a bit more efficient and should avoid the need for a compatibility function using `indices` in `center_of_mass`. * Rewrite `_ravel_shape_indices` without `indices` Instead of relying on a vendored copy of `indices` to construct the raveled shape indices, just use `arange` for each dimension and rely on Dask to handle the broadcasting for us. Also handle any scalar multiplication that would occur within the arguments to `arange`. This creates a much simpler Dask graph and avoids relying on a vendored copy of `indices`. * Drop note in `_ravel_shape_indices` As we now are leveraging just `arange` to handle construction of the indices in `_ravel_shape_indices`, this note no longer applies. Plus we are better able to handle chunking with what we are doing in this code than would happen with `reshape` naively. So this really isn't a workaround any more, but an efficient solution to the problem. * Drop vendored copy of `indices` As we are no longer using `indices` in `ndmeasure`, we no longer need to include a vendored copy of `indices`. So go ahead and drop this function from the `_compat` module. * Drop tests for vendored `indices` As we no longer include a vendored copy of `indices` in `ndmeasure`, there is no need to have tests for it. So go ahead and drop the tests.
- Loading branch information
Showing
4 changed files
with
18 additions
and
149 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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