Skip to content

Commit

Permalink
legacy log_points' positions parameter is now mandatory
Browse files Browse the repository at this point in the history
This is fine because A) this won't ever be released and B) as [1] shows, nobody as ever used
```
rr.log_points("a/b/c", colors=[red, blue, blue])
```
since that simply never worked.

[1] https://github.com/rerun-io/rerun/blob/main/rerun_py/rerun_sdk/rerun/log/points.py#L225-L226
  • Loading branch information
teh-cmc committed Jul 24, 2023
1 parent 5cefcd4 commit be81054
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rerun_py/rerun_sdk/rerun/log/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@log_decorator
def log_point(
entity_path: str,
position: npt.ArrayLike | None = None,
position: npt.ArrayLike,
*,
radius: float | None = None,
color: Color | None = None,
Expand Down Expand Up @@ -93,6 +93,8 @@ def log_point(
class_id = 0
if position is not None:
position = np.require(position, dtype="float32")
else:
raise ValueError("`position` argument must be set")

if position is not None:
if position.size == 2:
Expand Down Expand Up @@ -124,7 +126,7 @@ def log_point(
@log_decorator
def log_points(
entity_path: str,
positions: npt.ArrayLike | None = None,
positions: npt.ArrayLike,
*,
identifiers: npt.ArrayLike | None = None,
colors: Color | Colors | None = None,
Expand Down Expand Up @@ -200,7 +202,7 @@ def log_points(
if keypoint_ids is not None and class_ids is None:
class_ids = 0
if positions is None:
positions = np.require([], dtype="float32")
raise ValueError("`positions` argument must be set")
else:
positions = np.require(positions, dtype="float32")

Expand Down

0 comments on commit be81054

Please sign in to comment.