Skip to content

Commit

Permalink
Docs: link to rr.save and suggest rerun instead of `python -m rer…
Browse files Browse the repository at this point in the history
…un` (#2586)

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2586) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/2586)
- [Docs preview](https://rerun.io/preview/pr%3Aemilk%2Fupdate-docs/docs)
- [Examples
preview](https://rerun.io/preview/pr%3Aemilk%2Fupdate-docs/examples)
  • Loading branch information
emilk authored Jul 3, 2023
1 parent edd3980 commit ee477a2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/content/getting-started/logging-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,19 +290,19 @@ Rerun offers several solutions for these use cases.

### Logging data over the network

At any time, you can start a Rerun Viewer by running `python -m rerun`. This viewer is in fact a server that's ready to accept data over TCP (it's listening on `0.0.0.0:9876` by default).
At any time, you can start a Rerun Viewer by running `rerun`. This viewer is in fact a server that's ready to accept data over TCP (it's listening on `0.0.0.0:9876` by default).

On the logger side, simply use [`rr.connect`](https://ref.rerun.io/docs/python/latest/common/initialization/#rerun.connect) instead of [`rr.spawn`](https://ref.rerun.io/docs/python/latest/common/initialization/#rerun.spawn) to start sending the data over to any TCP address.

Checkout `python -m rerun --help` for more options.
Checkout `rerun --help` for more options.

### Saving & loading to/from RRD files

Sometimes, sending the data over the network is not an option. Maybe you'd like to share the data, attach it to a bug report, etc.

Rerun has you covered:
- Use [`rr.save`](https://ref.rerun.io/docs/python/latest/package/rerun/__init__/#rerun.save) to stream all logged data to disk.
- Visualize it via `python -m rerun path/to/recording.rrd`
- View it with `rerun path/to/recording.rrd`

You can also save a recording (or a portion of it) as you're visualizing it, directly from the viewer.

Expand Down
6 changes: 3 additions & 3 deletions docs/content/reference/sdk-operating-modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Call [`rr.spawn`](https://ref.rerun.io/docs/python/latest/package/rerun/__init__

Connects to a remote Rerun Viewer and streams all the data via TCP.

You will need to start a stand-alone viewer first, either by using `python -m rerun` if you've installed via `pip`, or simply `rerun` if you've installed via `cargo`.
You will need to start a stand-alone viewer first by typing `rerun` in your terminal.

#### `Python`

Expand All @@ -54,9 +54,9 @@ Use [`rr.serve`](https://ref.rerun.io/docs/python/latest/package/rerun/__init__/

## Save

Saves all the data buffered so far into an `rrd` file on disk, which can then be loaded into a stand-alone viewer.
Streams all logging data into an `.rrd` file on disk, which can then be loaded into a stand-alone viewer.

To visualize the saved file, use `python -m rerun path/to/file.rrd` if you've installed via `pip`, or simply `rerun path/to/file.rrd` if you've installed via `cargo`.
To view the saved file, use `rerun path/to/file.rrd`.

⚠️ [RRD files don't yet handle versioning!](https://github.com/rerun-io/rerun/issues/873) ⚠️

Expand Down
2 changes: 1 addition & 1 deletion examples/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pip install -r examples/python/requirements.txt
## Running the examples
By default, the examples spawn a Rerun Viewer and stream log data to it.

You can instead save the log data to an `.rrd` file using `examples/python/car/main.py --save data.rrd`. You can then open that `.rrd` file with `rerun data.rrd`.
You can instead save the log data to an `.rrd` file using `examples/python/car/main.py --save data.rrd`. You can then view that `.rrd` file with `rerun data.rrd`.

(`rerun` is an alias for `python -m rerun`).

Expand Down
2 changes: 1 addition & 1 deletion rerun_py/docs/gen_common_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Section:
Section(
title="Initialization",
module_summary=None,
func_list=["init", "connect", "disconnect", "spawn", "serve", "memory_recording"],
func_list=["init", "connect", "disconnect", "spawn", "serve", "save", "memory_recording"],
class_list=[],
),
Section(
Expand Down
4 changes: 2 additions & 2 deletions rerun_py/rerun_sdk/rerun/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def connect(addr: str | None = None, recording: RecordingStream | None = None) -
"""
Connect to a remote Rerun Viewer on the given ip:port.
Requires that you first start a Rerun Viewer, e.g. with 'python -m rerun'
Requires that you first start a Rerun Viewer by typing 'rerun' in a terminal.
This function returns immediately.
Expand Down Expand Up @@ -111,7 +111,7 @@ def serve(
"""
Serve log-data over WebSockets and serve a Rerun web viewer over HTTP.
You can connect to this server using `python -m rerun`.
You can also connect to this server with the native viewer using `rerun localhost:9090`.
WARNING: This is an experimental feature.
Expand Down

1 comment on commit ee477a2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.25.

Benchmark suite Current: ee477a2 Previous: edd3980 Ratio
batch_points_arrow/encode_log_msg 89307 ns/iter (± 120) 49872 ns/iter (± 152) 1.79

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.