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

Deprecate all of the legacy log_ prefixed APIs. #3564

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions rerun_py/rerun_sdk/rerun/log_deprecated/annotation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

from typing_extensions import deprecated # type: ignore[misc, unused-ignore]

from rerun._log import log
from rerun.archetypes import AnnotationContext
from rerun.datatypes import AnnotationInfo, ClassDescription, ClassDescriptionArrayLike
Expand All @@ -9,6 +11,10 @@
__all__ = ["log_annotation_context", "AnnotationInfo", "ClassDescription", "ClassDescriptionArrayLike"]


@deprecated(
"""Please migrate to `rr.log(…, rr.AnnotationContext(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
@log_decorator
def log_annotation_context(
entity_path: str,
Expand All @@ -20,6 +26,11 @@ def log_annotation_context(
"""
Log an annotation context made up of a collection of [ClassDescription][rerun.log_deprecated.annotation.ClassDescription]s.

!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.AnnotationContext][]

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

Any entity needing to access the annotation context will find it by searching the
path upward. If all entities share the same you can simply log it to the
root ("/"), or if you want a per-entity ClassDescriptions log it to the same path as
Expand Down
10 changes: 10 additions & 0 deletions rerun_py/rerun_sdk/rerun/log_deprecated/arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Any

import numpy.typing as npt
from typing_extensions import deprecated # type: ignore[misc, unused-ignore]

from rerun._log import log
from rerun.archetypes import Arrows3D
Expand All @@ -15,6 +16,10 @@
]


@deprecated(
"""Please migrate to `rr.log(…, rr.Arrows3D(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
@log_decorator
def log_arrow(
entity_path: str,
Expand All @@ -31,6 +36,11 @@ def log_arrow(
"""
Log a 3D arrow.

!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.Arrows3D][].

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

An arrow is defined with an `origin`, and a `vector`. This can also be considered as `start` and `end` positions
for the arrow.

Expand Down
25 changes: 19 additions & 6 deletions rerun_py/rerun_sdk/rerun/log_deprecated/bounding_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import numpy as np
import numpy.typing as npt
from typing_extensions import deprecated # type: ignore[misc, unused-ignore]

from rerun._log import log
from rerun.archetypes import Boxes3D
Expand All @@ -22,6 +23,10 @@
]


@deprecated(
"""Please migrate to `rr.log(…, rr.Boxes3D(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
@log_decorator
def log_obb(
entity_path: str,
Expand All @@ -40,6 +45,11 @@ def log_obb(
"""
Log a 3D Oriented Bounding Box, or OBB.

!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.Boxes3D][].

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

Example:
--------
```
Expand Down Expand Up @@ -89,6 +99,10 @@ def log_obb(
)


@deprecated(
"""Please migrate to `rr.log(…, rr.Boxes3D(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
@log_decorator
def log_obbs(
entity_path: str,
Expand All @@ -105,13 +119,12 @@ def log_obbs(
recording: RecordingStream | None = None,
) -> None:
"""
Log a 3D Oriented Bounding Box, or OBB.
Log a collection of 3D Oriented Bounding Boxes, or OBB.

Example:
--------
```
rr.log_obb("my_obb", half_size=[1.0, 2.0, 3.0], position=[0, 0, 0], rotation_q=[0, 0, 0, 1])
```
!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.Boxes3D][].

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

Parameters
----------
Expand Down
10 changes: 10 additions & 0 deletions rerun_py/rerun_sdk/rerun/log_deprecated/camera.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import numpy.typing as npt
from typing_extensions import deprecated # type: ignore[misc, unused-ignore]

from rerun._log import log
from rerun.archetypes import Pinhole
Expand All @@ -14,6 +15,10 @@
]


@deprecated(
"""Please migrate to `rr.log(…, rr.Pinhole(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
@log_decorator
def log_pinhole(
entity_path: str,
Expand All @@ -30,6 +35,11 @@ def log_pinhole(
"""
Log a perspective camera model.

!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.Pinhole][].

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

This logs the pinhole model that projects points from the parent (camera) space to this space (image) such that:
```
point_image_hom = child_from_parent * point_cam
Expand Down
11 changes: 11 additions & 0 deletions rerun_py/rerun_sdk/rerun/log_deprecated/clear.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
from __future__ import annotations

from typing_extensions import deprecated # type: ignore[misc, unused-ignore]

from rerun._log import log
from rerun.archetypes import Clear
from rerun.recording_stream import RecordingStream


@deprecated(
"""Please migrate to `rr.log(…, rr.Clear(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
def log_cleared(
entity_path: str,
*,
Expand All @@ -14,6 +20,11 @@ def log_cleared(
"""
Indicate that an entity at a given path should no longer be displayed.

!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.Clear][].

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

If `recursive` is True this will also clear all sub-paths

Parameters
Expand Down
10 changes: 10 additions & 0 deletions rerun_py/rerun_sdk/rerun/log_deprecated/extension_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numpy as np
import numpy.typing as npt
import pyarrow as pa
from typing_extensions import deprecated # type: ignore[misc, unused-ignore]

import rerun.error_utils
from rerun import bindings
Expand Down Expand Up @@ -73,6 +74,10 @@ def _add_extension_components(
instanced[name] = pa_value


@deprecated(
"""Please migrate to `rr.log(…, rr.AnyValues(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
@log_decorator
def log_extension_components(
entity_path: str,
Expand All @@ -85,6 +90,11 @@ def log_extension_components(
"""
Log an arbitrary collection of extension components.

!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.AnyValues][].

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

Each item in `ext` will be logged as a separate component.

- The key will be used as the name of the component
Expand Down
19 changes: 19 additions & 0 deletions rerun_py/rerun_sdk/rerun/log_deprecated/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import numpy as np
import numpy.typing as npt
from typing_extensions import deprecated # type: ignore[misc, unused-ignore]

from rerun._log import log
from rerun.archetypes import Asset3D
Expand Down Expand Up @@ -37,6 +38,10 @@ class MeshFormat(Enum):
"""Wavefront .obj format."""


@deprecated(
"""Please migrate to `rr.log(…, rr.Asset3D(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
@log_decorator
def log_mesh_file(
entity_path: str,
Expand All @@ -51,6 +56,11 @@ def log_mesh_file(
"""
Log the contents of a mesh file (.gltf, .glb, .obj, …).

!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.Asset3D][].

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

You must pass either `mesh_bytes` or `mesh_path`.

You can also use [`rerun.log_mesh`] to log raw mesh data.
Expand Down Expand Up @@ -108,6 +118,10 @@ def log_mesh_file(
return log(entity_path, asset3d, timeless=timeless, recording=recording)


@deprecated(
"""Please migrate to `rr.log(…, rr.ImageEncoded(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
@log_decorator
def log_image_file(
entity_path: str,
Expand All @@ -121,6 +135,11 @@ def log_image_file(
"""
Log an image file given its contents or path on disk.

!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.ImageEncoded][].

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

You must pass either `img_bytes` or `img_path`.

Only JPEGs and PNGs are supported right now.
Expand Down
28 changes: 28 additions & 0 deletions rerun_py/rerun_sdk/rerun/log_deprecated/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import numpy as np
import numpy.typing as npt
from typing_extensions import deprecated # type: ignore[misc, unused-ignore]

from rerun._log import log
from rerun.archetypes import DepthImage, Image, SegmentationImage
Expand All @@ -19,6 +20,10 @@
]


@deprecated(
"""Please migrate to `rr.log(…, rr.Image(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
@log_decorator
def log_image(
entity_path: str,
Expand All @@ -33,6 +38,11 @@ def log_image(
"""
Log a gray or color image.

!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.Image][].

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

The image should either have 1, 3 or 4 channels (gray, RGB or RGBA).

Supported dtypes
Expand Down Expand Up @@ -78,6 +88,10 @@ def log_image(
log(entity_path, Image(tensor_data, draw_order=draw_order), ext=ext, timeless=timeless, recording=recording)


@deprecated(
"""Please migrate to `rr.log(…, rr.DepthImage(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
@log_decorator
def log_depth_image(
entity_path: str,
Expand All @@ -92,6 +106,11 @@ def log_depth_image(
"""
Log a depth image.

!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.DepthImage][].

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

The image must be a 2D array.

Supported dtypes
Expand Down Expand Up @@ -134,6 +153,10 @@ def log_depth_image(
)


@deprecated(
"""Please migrate to `rr.log(…, rr.SegmentationImage(…))`.
See: https://www.rerun.io/docs/reference/migration-0-9 for more details."""
)
@log_decorator
def log_segmentation_image(
entity_path: str,
Expand All @@ -147,6 +170,11 @@ def log_segmentation_image(
"""
Log an image made up of integer class-ids.

!!! Warning "Deprecated"
Please migrate to [rerun.log][] with [rerun.SegmentationImage][].

See [the migration guide](https://www.rerun.io/docs/reference/migration-0-9) for more details.

The image should have 1 channel, i.e. be either `H x W` or `H x W x 1`.

See: [rerun.log_annotation_context][] for information on how to map the class-ids to
Expand Down
Loading
Loading