From 2bfe327c427ef6941939186599ae9157c55fd351 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 5 Mar 2025 12:12:05 +0100 Subject: [PATCH 1/8] Remove deprecated `log_components` API --- rerun_py/rerun_sdk/rerun/__init__.py | 1 - rerun_py/rerun_sdk/rerun/_log.py | 64 ---------------------------- 2 files changed, 65 deletions(-) diff --git a/rerun_py/rerun_sdk/rerun/__init__.py b/rerun_py/rerun_sdk/rerun/__init__.py index a43d1ebede1d..5eff8c9b84ac 100644 --- a/rerun_py/rerun_sdk/rerun/__init__.py +++ b/rerun_py/rerun_sdk/rerun/__init__.py @@ -47,7 +47,6 @@ IndicatorComponentBatch as IndicatorComponentBatch, escape_entity_path_part as escape_entity_path_part, log as log, - log_components as log_components, log_file_from_contents as log_file_from_contents, log_file_from_path as log_file_from_path, new_entity_path as new_entity_path, diff --git a/rerun_py/rerun_sdk/rerun/_log.py b/rerun_py/rerun_sdk/rerun/_log.py index 93951c83c149..ddccd666d506 100644 --- a/rerun_py/rerun_sdk/rerun/_log.py +++ b/rerun_py/rerun_sdk/rerun/_log.py @@ -6,7 +6,6 @@ import pyarrow as pa import rerun_bindings as bindings -from typing_extensions import deprecated from ._baseclasses import AsComponents, ComponentDescriptor, DescribedComponentBatch from .error_utils import _send_warning_or_raise, catch_and_log_exceptions @@ -171,69 +170,6 @@ def log( ) -@deprecated( - """Use `log` with partial update APIs instead. - See: https://www.rerun.io/docs/reference/migration/migration-0-22 for more details.""" -) -@catch_and_log_exceptions() -def log_components( - entity_path: str | list[str], - components: Iterable[DescribedComponentBatch], - *, - static: bool = False, - recording: RecordingStream | None = None, - strict: bool | None = None, -) -> None: - r""" - Log an entity from a collection of `ComponentBatchLike` objects. - - See also: [`rerun.log`][]. - - Parameters - ---------- - entity_path: - Path to the entity in the space hierarchy. - - The entity path can either be a string - (with special characters escaped, split on unescaped slashes) - or a list of unescaped strings. - This means that logging to `"world/my\ image\!"` is the same as logging - to ["world", "my image!"]. - - See for more on entity paths. - - components: - A collection of `ComponentBatchLike` objects. - - static: - If true, the components will be logged as static data. - - Static data has no time associated with it, exists on all timelines, and unconditionally shadows - any temporal data of the same type. - - Otherwise, the data will be timestamped automatically with `log_time` and `log_tick`. - Additional timelines set by [`rerun.set_index`][] will also be included. - - recording: - Specifies the [`rerun.RecordingStream`][] to use. If left unspecified, - defaults to the current active data recording, if there is one. See - also: [`rerun.init`][], [`rerun.set_global_data_recording`][]. - - strict: - If True, raise exceptions on non-loggable data. - If False, warn on non-loggable data. - if None, use the global default from `rerun.strict_mode()` - - """ - - _log_components( - entity_path=entity_path, - components=list(components), - static=static, - recording=recording, # NOLINT - ) - - def _log_components( entity_path: str | list[str], components: list[DescribedComponentBatch], From d3b2a56f3afc5e1727bd35111bd3b145fe7a57c4 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 5 Mar 2025 12:13:57 +0100 Subject: [PATCH 2/8] Remove deprecated `connect` and `connect_tcp` APIs --- rerun_py/rerun_sdk/rerun/__init__.py | 1 - rerun_py/rerun_sdk/rerun/blueprint/api.py | 37 ---------- rerun_py/rerun_sdk/rerun/sinks.py | 90 ----------------------- 3 files changed, 128 deletions(-) diff --git a/rerun_py/rerun_sdk/rerun/__init__.py b/rerun_py/rerun_sdk/rerun/__init__.py index 5eff8c9b84ac..dc8dc9085618 100644 --- a/rerun_py/rerun_sdk/rerun/__init__.py +++ b/rerun_py/rerun_sdk/rerun/__init__.py @@ -170,7 +170,6 @@ script_teardown as script_teardown, ) from .sinks import ( - connect as connect, connect_grpc as connect_grpc, disconnect as disconnect, save as save, diff --git a/rerun_py/rerun_sdk/rerun/blueprint/api.py b/rerun_py/rerun_sdk/rerun/blueprint/api.py index 3dce41c525ed..8170442ef980 100644 --- a/rerun_py/rerun_sdk/rerun/blueprint/api.py +++ b/rerun_py/rerun_sdk/rerun/blueprint/api.py @@ -5,7 +5,6 @@ from typing import Optional, Union import rerun_bindings as bindings -from typing_extensions import deprecated # type: ignore[misc, unused-ignore] from .._baseclasses import AsComponents, ComponentBatchLike from .._spawn import _spawn_viewer @@ -562,42 +561,6 @@ def _ipython_display_(self) -> None: Viewer(blueprint=self).display() - @deprecated( - """Please migrate to `connect_grpc(…)`. - See: https://www.rerun.io/docs/reference/migration/migration-0-22 for more details.""" - ) - def connect( - self, - application_id: str, - *, - url: str | None = None, - make_active: bool = True, - make_default: bool = True, - ) -> None: - """ - Connect to a remote Rerun Viewer on the given HTTP(S) URL and send this blueprint. - - Parameters - ---------- - application_id: - The application ID to use for this blueprint. This must match the application ID used - when initiating rerun for any data logging you wish to associate with this blueprint. - url: - The HTTP(S) URL to connect to - make_active: - Immediately make this the active blueprint for the associated `app_id`. - Note that setting this to `false` does not mean the blueprint may not still end - up becoming active. In particular, if `make_default` is true and there is no other - currently active blueprint. - make_default: - Make this the default blueprint for the `app_id`. - The default blueprint will be used as the template when the user resets the - blueprint for the app. It will also become the active blueprint if no other - blueprint is currently active. - - """ - return self.connect_grpc(application_id, url=url, make_active=make_active, make_default=make_default) - def connect_grpc( self, application_id: str, diff --git a/rerun_py/rerun_sdk/rerun/sinks.py b/rerun_py/rerun_sdk/rerun/sinks.py index 9d9645161bbb..84fa398b8b95 100644 --- a/rerun_py/rerun_sdk/rerun/sinks.py +++ b/rerun_py/rerun_sdk/rerun/sinks.py @@ -25,96 +25,6 @@ def is_recording_enabled(recording: RecordingStream | None) -> bool: return bindings.is_enabled() # type: ignore[no-any-return] -@deprecated( - """Please migrate to `connect_grpc(…)`. - See: https://www.rerun.io/docs/reference/migration/migration-0-22 for more details.""" -) -def connect( - addr: str | None = None, - *, - flush_timeout_sec: float | None = 2.0, - default_blueprint: BlueprintLike | None = None, - recording: RecordingStream | None = None, -) -> None: - """ - Connect to a remote Rerun Viewer on the given ip:port. - - This function returns immediately. - - Parameters - ---------- - addr: - The ip:port to connect to - flush_timeout_sec: - The minimum time the SDK will wait during a flush before potentially - dropping data if progress is not being made. Passing `None` indicates no timeout, - and can cause a call to `flush` to block indefinitely. - default_blueprint: - Optionally set a default blueprint to use for this application. If the application - already has an active blueprint, the new blueprint won't become active until the user - clicks the "reset blueprint" button. If you want to activate the new blueprint - immediately, instead use the [`rerun.send_blueprint`][] API. - recording: - Specifies the [`rerun.RecordingStream`][] to use. - If left unspecified, defaults to the current active data recording, if there is one. - See also: [`rerun.init`][], [`rerun.set_global_data_recording`][]. - - """ - if addr is not None: - addr = f"rerun+http://{addr}/proxy" - return connect_grpc( - url=addr, - flush_timeout_sec=flush_timeout_sec, - default_blueprint=default_blueprint, - recording=recording, # NOLINT: conversion not needed - ) - - -@deprecated( - """Please migrate to `connect_grpc(…)`. - See: https://www.rerun.io/docs/reference/migration/migration-0-22 for more details.""" -) -def connect_tcp( - addr: str | None = None, - *, - flush_timeout_sec: float | None = 2.0, - default_blueprint: BlueprintLike | None = None, - recording: RecordingStream | None = None, -) -> None: - """ - Connect to a remote Rerun Viewer on the given ip:port. - - This function returns immediately. - - Parameters - ---------- - addr: - The ip:port to connect to - flush_timeout_sec: - The minimum time the SDK will wait during a flush before potentially - dropping data if progress is not being made. Passing `None` indicates no timeout, - and can cause a call to `flush` to block indefinitely. - default_blueprint: - Optionally set a default blueprint to use for this application. If the application - already has an active blueprint, the new blueprint won't become active until the user - clicks the "reset blueprint" button. If you want to activate the new blueprint - immediately, instead use the [`rerun.send_blueprint`][] API. - recording: - Specifies the [`rerun.RecordingStream`][] to use. - If left unspecified, defaults to the current active data recording, if there is one. - See also: [`rerun.init`][], [`rerun.set_global_data_recording`][]. - - """ - if addr is not None: - addr = f"rerun+http://{addr}/proxy" - return connect_grpc( - url=addr, - flush_timeout_sec=flush_timeout_sec, - default_blueprint=default_blueprint, - recording=recording, # NOLINT: conversion not needed - ) - - def connect_grpc( url: str | None = None, *, From 471d137a1297420791401f0766a094c5d638446f Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 5 Mar 2025 13:06:54 +0100 Subject: [PATCH 3/8] Add note in migration guide --- docs/content/reference/migration/migration-0-23.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/content/reference/migration/migration-0-23.md b/docs/content/reference/migration/migration-0-23.md index 6a50d834b14c..67b1428df872 100644 --- a/docs/content/reference/migration/migration-0-23.md +++ b/docs/content/reference/migration/migration-0-23.md @@ -81,3 +81,6 @@ Either: The former is subject to (double-precision) floating point precision loss (still microsecond precision for the next century), while the latter is lossless. +## 🐍 Python: removed `rr.log_components()`, `rr.connect()`, and `rr.connect_tcp()` + +These functions were [deprecated](migration-0-22#python-api-changes) in 0.22 and are no longer available. See the [0.22 migration guide](migration-0-22.md) for detailed information about the new APIs and how to migrate to them. \ No newline at end of file From d9029f82854e504ae1fd0c10f219be9f4b2c1a2e Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 5 Mar 2025 13:10:47 +0100 Subject: [PATCH 4/8] Lint + remove connect from python docs --- docs/content/reference/migration/migration-0-23.md | 2 +- rerun_py/docs/gen_common_index.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/content/reference/migration/migration-0-23.md b/docs/content/reference/migration/migration-0-23.md index 67b1428df872..7c886e94a2c3 100644 --- a/docs/content/reference/migration/migration-0-23.md +++ b/docs/content/reference/migration/migration-0-23.md @@ -83,4 +83,4 @@ The former is subject to (double-precision) floating point precision loss (still ## 🐍 Python: removed `rr.log_components()`, `rr.connect()`, and `rr.connect_tcp()` -These functions were [deprecated](migration-0-22#python-api-changes) in 0.22 and are no longer available. See the [0.22 migration guide](migration-0-22.md) for detailed information about the new APIs and how to migrate to them. \ No newline at end of file +These functions were [deprecated](migration-0-22#python-api-changes) in 0.22 and are no longer available. See the [0.22 migration guide](migration-0-22.md) for detailed information about the new APIs and how to migrate to them. diff --git a/rerun_py/docs/gen_common_index.py b/rerun_py/docs/gen_common_index.py index 9a8a271965c3..83ef89c8df6f 100755 --- a/rerun_py/docs/gen_common_index.py +++ b/rerun_py/docs/gen_common_index.py @@ -84,7 +84,6 @@ class Section: title="Initialization functions", func_list=[ "init", - "connect", "connect_grpc", "disconnect", "save", From bed40535b1c66225d252a401772d15619a54d3e0 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 5 Mar 2025 13:24:49 +0100 Subject: [PATCH 5/8] Clarified migration guide --- docs/content/reference/migration/migration-0-23.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/content/reference/migration/migration-0-23.md b/docs/content/reference/migration/migration-0-23.md index 7c886e94a2c3..863e2bf086fd 100644 --- a/docs/content/reference/migration/migration-0-23.md +++ b/docs/content/reference/migration/migration-0-23.md @@ -83,4 +83,8 @@ The former is subject to (double-precision) floating point precision loss (still ## 🐍 Python: removed `rr.log_components()`, `rr.connect()`, and `rr.connect_tcp()` -These functions were [deprecated](migration-0-22#python-api-changes) in 0.22 and are no longer available. See the [0.22 migration guide](migration-0-22.md) for detailed information about the new APIs and how to migrate to them. +These functions were [deprecated](migration-0-22#python-api-changes) in 0.22 and are no longer available. + +Calls to `rr.log_components()` API are now superseded by the new partial update API. See the [documentation](../../concepts/latest-at#partial-updates) and the [migration instructions](migration-0-22.md#partial-updates). + +Calls to `rr.connect()` and `rr.connect_tcp()` must be changed to [`rr.connect_grpc()`](https://ref.rerun.io/docs/python/0.22.1/common/initialization_functions/#rerun.connect_grpc?speculative-link). \ No newline at end of file From b42d46a856f279c3b17483c54ac2d929158539a9 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 5 Mar 2025 13:26:17 +0100 Subject: [PATCH 6/8] Fix cross-references to `connect_grpc` --- rerun_py/rerun_sdk/rerun/recording_stream.py | 6 +++--- rerun_py/rerun_sdk/rerun/sinks.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rerun_py/rerun_sdk/rerun/recording_stream.py b/rerun_py/rerun_sdk/rerun/recording_stream.py index cfe8ea880faf..30ad54207776 100644 --- a/rerun_py/rerun_sdk/rerun/recording_stream.py +++ b/rerun_py/rerun_sdk/rerun/recording_stream.py @@ -40,7 +40,7 @@ def new_recording( If you only need a single global recording, [`rerun.init`][] might be simpler. Note that unless setting `spawn=True` new recording streams always begin connected to a buffered sink. - To send the data to a viewer or file you will likely want to call [`rerun.connect`][] or [`rerun.save`][] + To send the data to a viewer or file you will likely want to call [`rerun.connect_grpc`][] or [`rerun.save`][] explicitly. !!! Warning @@ -331,7 +331,7 @@ class RecordingStream: - Metadata-related functions: [`rerun.is_enabled`][], [`rerun.get_recording_id`][], … - Sink-related functions: - [`rerun.connect`][], [`rerun.spawn`][], … + [`rerun.connect_grpc`][], [`rerun.spawn`][], … - Time-related functions: [`rerun.set_index`][], [`rerun.disable_timeline`][], [`rerun.reset_time`][], … - Log-related functions: @@ -526,7 +526,7 @@ def disconnect(self) -> None: Closes all TCP connections, servers, and files. Closes all TCP connections, servers, and files that have been opened with - [`rerun.connect`], [`rerun.serve`], [`rerun.save`] or [`rerun.spawn`]. + [`rerun.connect_grpc`], [`rerun.serve`], [`rerun.save`] or [`rerun.spawn`]. """ from .sinks import disconnect diff --git a/rerun_py/rerun_sdk/rerun/sinks.py b/rerun_py/rerun_sdk/rerun/sinks.py index 84fa398b8b95..47818a3b2f49 100644 --- a/rerun_py/rerun_sdk/rerun/sinks.py +++ b/rerun_py/rerun_sdk/rerun/sinks.py @@ -192,7 +192,7 @@ def disconnect(recording: RecordingStream | None = None) -> None: Closes all TCP connections, servers, and files. Closes all TCP connections, servers, and files that have been opened with - [`rerun.connect`], [`rerun.serve`], [`rerun.save`] or [`rerun.spawn`]. + [`rerun.connect_grpc`], [`rerun.serve`], [`rerun.save`] or [`rerun.spawn`]. Parameters ---------- From cedd0d863f9ff258249730d53dd1933fc387a68a Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 5 Mar 2025 13:29:51 +0100 Subject: [PATCH 7/8] lint :/ --- docs/content/reference/migration/migration-0-23.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/reference/migration/migration-0-23.md b/docs/content/reference/migration/migration-0-23.md index 863e2bf086fd..ad9b6376f969 100644 --- a/docs/content/reference/migration/migration-0-23.md +++ b/docs/content/reference/migration/migration-0-23.md @@ -87,4 +87,4 @@ These functions were [deprecated](migration-0-22#python-api-changes) in 0.22 and Calls to `rr.log_components()` API are now superseded by the new partial update API. See the [documentation](../../concepts/latest-at#partial-updates) and the [migration instructions](migration-0-22.md#partial-updates). -Calls to `rr.connect()` and `rr.connect_tcp()` must be changed to [`rr.connect_grpc()`](https://ref.rerun.io/docs/python/0.22.1/common/initialization_functions/#rerun.connect_grpc?speculative-link). \ No newline at end of file +Calls to `rr.connect()` and `rr.connect_tcp()` must be changed to [`rr.connect_grpc()`](https://ref.rerun.io/docs/python/0.22.1/common/initialization_functions/#rerun.connect_grpc?speculative-link). From bda75d3156c118887252ba293c85850507c4a1ad Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 5 Mar 2025 14:13:17 +0100 Subject: [PATCH 8/8] proper links --- docs/content/reference/migration/migration-0-23.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/reference/migration/migration-0-23.md b/docs/content/reference/migration/migration-0-23.md index ad9b6376f969..cb33fb5e6aa1 100644 --- a/docs/content/reference/migration/migration-0-23.md +++ b/docs/content/reference/migration/migration-0-23.md @@ -83,8 +83,8 @@ The former is subject to (double-precision) floating point precision loss (still ## 🐍 Python: removed `rr.log_components()`, `rr.connect()`, and `rr.connect_tcp()` -These functions were [deprecated](migration-0-22#python-api-changes) in 0.22 and are no longer available. +These functions were [deprecated](migration-0-22.md#python-api-changes) in 0.22 and are no longer available. -Calls to `rr.log_components()` API are now superseded by the new partial update API. See the [documentation](../../concepts/latest-at#partial-updates) and the [migration instructions](migration-0-22.md#partial-updates). +Calls to `rr.log_components()` API are now superseded by the new partial update API. See the [documentation](../../concepts/latest-at.md#partial-updates) and the [migration instructions](migration-0-22.md#partial-updates). Calls to `rr.connect()` and `rr.connect_tcp()` must be changed to [`rr.connect_grpc()`](https://ref.rerun.io/docs/python/0.22.1/common/initialization_functions/#rerun.connect_grpc?speculative-link).