Closed as duplicate of#8486
Description
Describe the bug
Usage of numpy 2.0 with rr.AnyValues leads to a numpy error because line 90 of rerun_sdk/rerun/any_value.py
has not been updated for numpy 2.0.
To Reproduce
Steps to reproduce the behavior:
- Use rr.log() with an rr.AnyValues object. I've provided a simple script to repro this below
import rerun as rr
rr.init(application_id="test", recording_id="testing")
rr.spawn()
rr.log("world",rr.AnyValues(edge_ids=[1,2,3]))
- This will result in the following error
Converting data for 'edge_ids': ValueError(Unable to avoid copy while creating an array as requested.
If using `np.array(obj, copy=False)` replace it with `np.asarray(obj)` to allow a copy when needed (no behavior change in NumPy 1.x).
For more details, see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.)
Expected behavior
This should not error. The cause of this is line 90 in rerun_sdk/rerun/any_value.py
which should be updated to the following:
np_value = np.atleast_1d(np.asarray(value))
I think there are numerous other places where np.array()
is used with copy=False
where this error may occur.
Rerun version
0.22.1
Numpy version
2.2.4