Skip to content

Commit

Permalink
fixup python after api break
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Jun 3, 2024
1 parent 73d5e1c commit d16a39b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/snippets/all/views/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
rrb.TimeSeriesView(
origin="/trig",
# Set a custom Y axis.
axis_y=rrb.ScalarAxis(range=(-1.0, 1.0), lock_range_during_zoom=True),
axis_y=rrb.ScalarAxis(range=(-1.0, 1.0), zoom_lock=True),
# Configure the legend.
plot_legend=rrb.PlotLegend(visible=False),
# Set time different time ranges for different timelines.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions rerun_py/tests/unit/test_scalar_axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,31 @@ def test_scalar_axis() -> None:
rr.components.Range1D([42.1337, 1337.42]),
None,
]
lock_range_during_zooms = [
zoom_locks = [
True,
False,
]

all_arrays = itertools.zip_longest(
ranges,
lock_range_during_zooms,
zoom_locks,
)

for range, lock_range_during_zoom in all_arrays:
for range, zoom_lock in all_arrays:
range = cast(Optional[rr.datatypes.Range1DLike], range)
lock_range_during_zoom = cast(Optional[rr.datatypes.Bool], lock_range_during_zoom)
zoom_lock = cast(Optional[rr.datatypes.Bool], zoom_lock)

print(
f"rr.ScalarAxis(\n"
f" range={range!r}\n" #
f" lock_range_during_zoom={lock_range_during_zoom!r}\n"
f" zoom_lock={zoom_lock!r}\n"
f")"
)
arch = rrb.ScalarAxis(
range=range,
lock_range_during_zoom=lock_range_during_zoom,
zoom_lock=zoom_lock,
)
print(f"{arch}\n")

assert arch.range == rr.components.Range1DBatch._optional(none_empty_or_value(range, [42.1337, 1337.42]))
assert arch.lock_range_during_zoom == rrb.components.LockRangeDuringZoomBatch._optional(lock_range_during_zoom)
assert arch.zoom_lock == rrb.components.LockRangeDuringZoomBatch._optional(zoom_lock)

0 comments on commit d16a39b

Please sign in to comment.