Closed
Description
This works with numpy < 2:
$ python tests/python/release_checklist/check_focus.py
# works
But fails in an environment with numpy >= 2:
$ python tests/python/release_checklist/check_focus.py
Traceback (most recent call last):
File "/home/cmc/dev/rerun-io/rerun/tests/python/release_checklist/check_focus.py", line 57, in <module>
run(args)
File "/home/cmc/dev/rerun-io/rerun/tests/python/release_checklist/check_focus.py", line 48, in run
log_some_views()
File "/home/cmc/dev/rerun-io/rerun/tests/python/release_checklist/check_focus.py", line 36, in log_some_views
rr.log(f"a_entity_{i}", rr.AnyValues(empty=0))
^^^^^^^^^^^^^^^^^^^^^
File "/home/cmc/dev/rerun-io/rerun/venv312/lib/python3.12/site-packages/rerun_sdk/rerun/any_value.py", line 192, in __init__
batch = AnyBatchValue(name, value, drop_untyped_nones=drop_untyped_nones)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cmc/dev/rerun-io/rerun/venv312/lib/python3.12/site-packages/rerun_sdk/rerun/any_value.py", line 91, in __init__
np_value = np.atleast_1d(np.array(value, copy=False))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
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.