|
191 | 191 | "source": [
|
192 | 192 | "## Starting a new recording\n",
|
193 | 193 | "\n",
|
194 |
| - "You can always start another recording by calling `rr.init(...)` again to reset the global stream, or alternatively creating a separate recording stream using `rr.new_recording` (discussed more below)" |
| 194 | + "You can always start another recording by calling `rr.init(...)` again to reset the global stream, or alternatively creating a separate recording stream using the `rr.RecordingStream` constructor (discussed more below)" |
195 | 195 | ]
|
196 | 196 | },
|
197 | 197 | {
|
|
316 | 316 | "STEPS = 100\n",
|
317 | 317 | "twists = math.pi * np.sin(np.linspace(0, math.tau, STEPS)) / 4\n",
|
318 | 318 | "for t in range(STEPS):\n",
|
319 |
| - " rr.set_time_sequence(\"step\", t)\n", |
| 319 | + " rr.set_time(\"step\", sequence=t)\n", |
320 | 320 | " h_grid = build_color_grid(10, 3, 3, twist=twists[t])\n",
|
321 | 321 | " rr.log(\"h_grid\", rr.Points3D(h_grid.positions, colors=h_grid.colors, radii=0.5))\n",
|
322 | 322 | " v_grid = build_color_grid(3, 3, 10, twist=twists[t])\n",
|
|
347 | 347 | "STEPS = 100\n",
|
348 | 348 | "twists = math.pi * np.sin(np.linspace(0, math.tau, STEPS)) / 4\n",
|
349 | 349 | "for t in range(STEPS):\n",
|
350 |
| - " rr.set_time_sequence(\"step\", t)\n", |
| 350 | + " rr.set_time(\"step\", sequence=t)\n", |
351 | 351 | " h_grid = build_color_grid(10, 3, 3, twist=twists[t])\n",
|
352 | 352 | " rr.log(\"h_grid\", rr.Points3D(h_grid.positions, colors=h_grid.colors, radii=0.5))\n",
|
353 | 353 | " v_grid = build_color_grid(3, 3, 10, twist=twists[t])\n",
|
|
363 | 363 | "source": [
|
364 | 364 | "## Working with non-global streams\n",
|
365 | 365 | "\n",
|
366 |
| - "Sometimes it can be more explicit to work with specific (non-global recording) streams via the `new_recording` method.\n", |
| 366 | + "Sometimes it can be more explicit to work with specific (non-global recording) streams via `rr.RecordingStream` constructor.\n", |
367 | 367 | "\n",
|
368 | 368 | "In this case, remember to call `notebook_show` directly on the recording stream. As noted above, there is no way to use a bare Blueprint object in conjunction with a non-global recording."
|
369 | 369 | ]
|
|
375 | 375 | "metadata": {},
|
376 | 376 | "outputs": [],
|
377 | 377 | "source": [
|
378 |
| - "rec = rr.new_recording(\"rerun_example_cube_flat\")\n", |
| 378 | + "rec = rr.RecordingStream(\"rerun_example_cube_flat\")\n", |
379 | 379 | "\n",
|
380 | 380 | "bp = rrb.Blueprint(collapse_panels=True)\n",
|
381 | 381 | "\n",
|
|
404 | 404 | "metadata": {},
|
405 | 405 | "outputs": [],
|
406 | 406 | "source": [
|
407 |
| - "rec = rr.new_recording(\"rerun_example_multi_recording\", recording_id=uuid.uuid4())\n", |
| 407 | + "rec = rr.RecordingStream(\"rerun_example_multi_recording\", recording_id=uuid.uuid4())\n", |
408 | 408 | "\n",
|
409 | 409 | "flat_grid = build_color_grid(20, 20, 1, twist=0)\n",
|
410 | 410 | "rec.log(\"flat_grid\", rr.Points3D(flat_grid.positions, colors=flat_grid.colors, radii=0.5))\n",
|
|
416 | 416 | },
|
417 | 417 | {
|
418 | 418 | "cell_type": "code",
|
419 |
| - "execution_count": null, |
| 419 | + "execution_count": 15, |
420 | 420 | "id": "40354733-7feb-45fe-8ba6-dbbdbc070983",
|
421 | 421 | "metadata": {},
|
422 | 422 | "outputs": [],
|
423 | 423 | "source": [
|
424 |
| - "rec = rr.new_recording(\"rerun_example_multi_recording\", recording_id=uuid.uuid4())\n", |
| 424 | + "rec = rr.RecordingStream(\"rerun_example_multi_recording\", recording_id=uuid.uuid4())\n", |
425 | 425 | "\n",
|
426 | 426 | "viewer.add_recording(rec)\n",
|
427 | 427 | "\n",
|
428 | 428 | "STEPS = 100\n",
|
429 | 429 | "twists = math.pi * np.sin(np.linspace(0, math.tau, STEPS)) / 4\n",
|
430 | 430 | "for t in range(STEPS):\n",
|
431 |
| - " rr.set_time(\"step\", sequence=t)\n", |
| 431 | + " rec.set_time(\"step\", sequence=t)\n", |
432 | 432 | " cube = build_color_grid(10, 10, 10, twist=twists[t])\n",
|
433 | 433 | " rec.log(\"cube\", rr.Points3D(cube.positions, colors=cube.colors, radii=0.5))"
|
434 | 434 | ]
|
|
450 | 450 | "metadata": {},
|
451 | 451 | "outputs": [],
|
452 | 452 | "source": [
|
453 |
| - "viewer = rr.notebook.Viewer(use_global_recording=False)\n", |
| 453 | + "viewer = rr.notebook.Viewer()\n", |
454 | 454 | "viewer.display()\n",
|
455 | 455 | "\n",
|
456 | 456 | "recordings = [\n",
|
457 |
| - " rr.new_recording(\"rerun_example_time_ctrl\", recording_id=\"example_a\"),\n", |
458 |
| - " rr.new_recording(\"rerun_example_time_ctrl\", recording_id=\"example_b\"),\n", |
| 457 | + " rr.RecordingStream(\"rerun_example_time_ctrl\", recording_id=\"example_a\"),\n", |
| 458 | + " rr.RecordingStream(\"rerun_example_time_ctrl\", recording_id=\"example_b\"),\n", |
459 | 459 | "]\n",
|
460 | 460 | "\n",
|
461 | 461 | "rec_colors = {\"example_a\": [0, 255, 0], \"example_b\": [255, 0, 0]}\n",
|
|
465 | 465 | "\n",
|
466 | 466 | "STEPS = 100\n",
|
467 | 467 | "twists = math.pi * np.sin(np.linspace(0, math.tau, STEPS)) / 4\n",
|
468 |
| - "for t in range(STEPS):\n", |
469 |
| - " cube = build_color_grid(10, 10, 10, twist=twists[t])\n", |
470 |
| - " for rec in recordings:\n", |
471 |
| - " rr.set_time(\"step\", sequence=t)\n", |
| 468 | + "for rec in recordings:\n", |
| 469 | + " for t in range(STEPS):\n", |
| 470 | + " cube = build_color_grid(10, 10, 10, twist=twists[t])\n", |
| 471 | + " rec.set_time(\"step\", sequence=t)\n", |
472 | 472 | " rec.log(\"cube\", rr.Points3D(cube.positions, colors=rec_colors[rec.get_recording_id()], radii=0.5))"
|
473 | 473 | ]
|
474 | 474 | },
|
|
482 | 482 | },
|
483 | 483 | {
|
484 | 484 | "cell_type": "code",
|
485 |
| - "execution_count": 27, |
| 485 | + "execution_count": 22, |
486 | 486 | "id": "3d6804d6",
|
487 | 487 | "metadata": {},
|
488 | 488 | "outputs": [],
|
|
500 | 500 | },
|
501 | 501 | {
|
502 | 502 | "cell_type": "code",
|
503 |
| - "execution_count": 28, |
| 503 | + "execution_count": 23, |
504 | 504 | "id": "30d0107b",
|
505 | 505 | "metadata": {},
|
506 | 506 | "outputs": [],
|
|
0 commit comments