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

log_point expected shape and error on wrong shape #1642

Closed
roym899 opened this issue Mar 21, 2023 · 0 comments · Fixed by #1663
Closed

log_point expected shape and error on wrong shape #1642

roym899 opened this issue Mar 21, 2023 · 0 comments · Fixed by #1663
Assignees
Labels
😤 annoying Something in the UI / SDK is annoying to use good first issue Good for newcomers 🐍 Python API Python logging API

Comments

@roym899
Copy link
Collaborator

roym899 commented Mar 21, 2023

Describe the annoyance
Docs for log_point suggests that it requires shape (2,1) or (3,1). However it also works with (2,) and (3,) which would arguably be more standard. So the docs should be changed on this point. The shape suggested in the docs is also inconsistent, since log_points takes (N,2) or (N,3).

Furthermore it does not work when passing a (1,2) or (1,3) array instead giving a wrong error message:

  File "/home/leo/.pyenv/versions/rerun_playground/lib/python3.8/site-packages/rerun_sdk/rerun/log/log_decorator.py", line 35, in wrapper
    return func(*args, **kwargs)
  File "/home/leo/.pyenv/versions/rerun_playground/lib/python3.8/site-packages/rerun_sdk/rerun/log/points.py", line 104, in log_point
    raise TypeError("Positions should be either 1x2 or 1x3")
TypeError: Positions should be either 1x2 or 1x3

To Reproduce

import numpy as np
import rerun as rr
rr.log_point("point", np.random.rand(1,2))  # also (2,) and (2,1) should work.
rr.save("test.rrd")

Expected behavior
I see two reasonable options:

  • any 2 or 3 element array-like should be supported
  • only support (2,) or (3,) shapes. This would be consistent with (N,2) and (N,3) shapes required for log_points, since iterating over such an array yields arrays with shape (2,) and (3,).

Whichever is chosen, the docs should reflect this. Right now one might do some unnecessary reshaping before calling the function.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
@roym899 roym899 added 👀 needs triage This issue needs to be triaged by the Rerun team 😤 annoying Something in the UI / SDK is annoying to use labels Mar 21, 2023
@emilk emilk added good first issue Good for newcomers 🐍 Python API Python logging API and removed 👀 needs triage This issue needs to be triaged by the Rerun team labels Mar 21, 2023
@jleibs jleibs self-assigned this Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😤 annoying Something in the UI / SDK is annoying to use good first issue Good for newcomers 🐍 Python API Python logging API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants