Skip to content

Commit

Permalink
Update mean's variables to match other functions (#73)
Browse files Browse the repository at this point in the history
As the input image has been summed over, it doesn't really make sense to
include that in the variable names in `mean`. This same rational is used
in other functions. So update `mean`'s variable names accordingly.

Also fix the `com_lbl` name for the result variable in `mean` in the
process. This was an old copy-paste error from the `center_of_mass`
function, which makes no sense in the context of `mean`. It is now
`mean_lbl`, which is more fitting.
  • Loading branch information
jakirkham committed Sep 30, 2018
1 parent 783c109 commit 2e1abea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dask_image/ndmeasure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,16 +446,16 @@ def mean(input, labels=None, index=None):
input, labels, index
)

input_sum = sum(input, labels, index)
input_norm = sum(
sum_lbl = sum(input, labels, index)
norm_lbl = sum(
dask.array.ones(input.shape, dtype=input.dtype, chunks=input.chunks),
labels,
index
)

com_lbl = input_sum / input_norm
mean_lbl = sum_lbl / norm_lbl

return com_lbl
return mean_lbl


def median(input, labels=None, index=None):
Expand Down

0 comments on commit 2e1abea

Please sign in to comment.