Skip to content

Commit

Permalink
Use full to construct 1-D NumPy array (#83)
Browse files Browse the repository at this point in the history
* Use `full` to construct 1-D NumPy array

In `labeled_comprehension`, instead of using `empty` and assigning
`default_1d` the `default` value, simply use `numpy.full` to construct
the `default_1d` array with the `default` value.

* Drop blank line

As these are both arguments being passed into `labeled_comprehension`,
simply group them together.
  • Loading branch information
jakirkham committed Oct 1, 2018
1 parent 58e7111 commit b7ec2ad
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions dask_image/ndmeasure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,7 @@ def labeled_comprehension(input,
)

out_dtype = numpy.dtype(out_dtype)

default_1d = numpy.empty((1,), dtype=out_dtype)
default_1d[0] = default
default_1d = numpy.full((1,), default, dtype=out_dtype)

pass_positions = bool(pass_positions)

Expand Down

0 comments on commit b7ec2ad

Please sign in to comment.