Describe the bug
import rerun as rr
import numpy as np
rr.log_line_segments("points", [0.0, 0.0], color=np.array([0.5, 0.5, 0.5]))
fails with the following warning
WARNING:root:Ignoring rerun log call: Traceback (most recent call last):
File "/home/leo/.pyenv/versions/widebaseline/lib/python3.10/site-packages/rerun_sdk/rerun/log/log_decorator.py", line 47, in wrapper
return func(*args, **kwargs)
File "/home/leo/.pyenv/versions/widebaseline/lib/python3.10/site-packages/rerun_sdk/rerun/log/lines.py", line 208, in log_line_segments
if color:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
The boolean value of a numpy array with more than one value is not defined and is also False for scalar arrays with 0 value. This can most likely be fixed by changing if color: to if color is not None:. Maybe worth checking if similar code is anywhere else in the codebase.
A workaround is to convert the color to a list first.
Desktop (please complete the following information):
Rerun version
rerun_py 0.7.0 [rustc 1.69.0 (84c898d65 2023-04-16), LLVM 15.0.7] x86_64-unknown-linux-gnu prepare-0.7 9cf3033, built 2023-06-16T15:47:32Z
Describe the bug
fails with the following warning
The boolean value of a numpy array with more than one value is not defined and is also False for scalar arrays with 0 value. This can most likely be fixed by changing
if color:toif color is not None:. Maybe worth checking if similar code is anywhere else in the codebase.A workaround is to convert the color to a list first.
Desktop (please complete the following information):
Rerun version