Skip to content

Commit

Permalink
init shall not return a recording
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed May 15, 2023
1 parent d3afddb commit eeb91eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions rerun_py/rerun_sdk/rerun/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def init(
spawn: bool = False,
default_enabled: bool = True,
strict: bool = False,
) -> RecordingStream:
) -> None:
"""
Initialize the Rerun SDK with a user-chosen application id (name).
Expand Down Expand Up @@ -180,7 +180,7 @@ def init(

_strict_mode = strict

return new_recording(
new_recording(
application_id,
recording_id,
True, # make_default
Expand Down
15 changes: 6 additions & 9 deletions rerun_py/rerun_sdk/rerun/script_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from argparse import ArgumentParser, Namespace

import rerun as rr
from rerun.recording_stream import RecordingStream


def script_add_args(parser: ArgumentParser) -> None:
Expand Down Expand Up @@ -54,7 +53,7 @@ def script_add_args(parser: ArgumentParser) -> None:
def script_setup(
args: Namespace,
application_id: str,
) -> RecordingStream:
) -> None:
"""
Run common Rerun script setup actions. Connect to the viewer if necessary.
Expand All @@ -66,26 +65,24 @@ def script_setup(
The application ID to use for the viewer.
"""
rec = rr.init(
rr.init(
application_id=application_id,
default_enabled=True,
strict=True,
)

# NOTE: mypy thinks these methods don't exist because they're monkey-patched.
if args.serve:
rec.serve() # type: ignore[attr-defined]
rr.serve() # type: ignore[attr-defined]
elif args.connect:
# Send logging data to separate `rerun` process.
# You can omit the argument to connect to the default address,
# which is `127.0.0.1:9876`.
rec.connect(args.addr) # type: ignore[attr-defined]
rr.connect(args.addr) # type: ignore[attr-defined]
elif args.save is not None:
rec.save(args.save) # type: ignore[attr-defined]
rr.save(args.save) # type: ignore[attr-defined]
elif not args.headless:
rec.spawn() # type: ignore[attr-defined]

return rec
rr.spawn() # type: ignore[attr-defined]


def script_teardown(args: Namespace) -> None:
Expand Down

0 comments on commit eeb91eb

Please sign in to comment.