Skip to content

Commit

Permalink
fighting mypy, round #2345235923523099837
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jun 14, 2023
1 parent 02499c2 commit cd2f54d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions rerun_py/rerun_sdk/rerun2/components/color_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ def _from_similar(
# Rust expects colors in 0-255 uint8
if array.dtype.type in [np.float32, np.float64]:
# Assume gamma-space colors
array = np.asarray(data).reshape((-1, 4))
array = u8_array_to_rgba(np.asarray(np.round(array * 255.0), np.uint8))
array = u8_array_to_rgba(np.asarray(np.round(np.asarray(data).reshape((-1, 4)) * 255.0), np.uint8))
elif array.dtype.type == np.uint32:
array = np.asarray(data).flatten()
else:
array = np.asarray(data, dtype=np.uint8).reshape((-1, 4))
array = u8_array_to_rgba(array)
array = u8_array_to_rgba(np.asarray(data, dtype=np.uint8).reshape((-1, 4)))

return arrow().wrap_array(pa.array(array, type=arrow().storage_type))

0 comments on commit cd2f54d

Please sign in to comment.