Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Numpy 2.0 and rr.AnyValues #9375

Closed
pd-stuart opened this issue Mar 25, 2025 · 1 comment
Closed

Issue with Numpy 2.0 and rr.AnyValues #9375

pd-stuart opened this issue Mar 25, 2025 · 1 comment
Labels
🐑🐑 duplicate This issue or pull request already exists

Comments

@pd-stuart
Copy link

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:

  1. 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]))
  1. 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

@pd-stuart pd-stuart added 👀 needs triage This issue needs to be triaged by the Rerun team 🪳 bug Something isn't working labels Mar 25, 2025
@Wumpf
Copy link
Member

Wumpf commented Mar 31, 2025

Duplicate of

Got fixed in

@pd-stuart if you're blocked on this you can try building from main or use a nightly development build

@Wumpf Wumpf closed this as completed Mar 31, 2025
@Wumpf Wumpf added 🐑🐑 duplicate This issue or pull request already exists and removed 🪳 bug Something isn't working 👀 needs triage This issue needs to be triaged by the Rerun team labels Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐑🐑 duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants