Skip to content

Commit 654833e

Browse files
authored
Merge branch 'main' into antoine/utf8-numpy
2 parents b0b2290 + ca6ad40 commit 654833e

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

crates/store/re_types/src/components/show_labels_ext.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ impl Default for ShowLabels {
88
Self(true.into())
99
}
1010
}
11+
12+
impl From<ShowLabels> for bool {
13+
#[inline]
14+
fn from(value: ShowLabels) -> Self {
15+
value.0.into()
16+
}
17+
}

rerun_py/rerun_sdk/rerun/sinks.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
# --- Sinks ---
1414

1515

16+
def is_recording_enabled(recording: RecordingStream | None) -> bool:
17+
if recording is not None:
18+
return bindings.is_enabled(recording.inner) # type: ignore[no-any-return]
19+
return bindings.is_enabled() # type: ignore[no-any-return]
20+
21+
1622
def connect(
1723
addr: str | None = None,
1824
*,
@@ -47,7 +53,7 @@ def connect(
4753
4854
"""
4955

50-
if not bindings.is_enabled():
56+
if not is_recording_enabled(recording):
5157
logging.warning("Rerun is disabled - connect() call ignored")
5258
return
5359

@@ -102,7 +108,7 @@ def save(
102108
103109
"""
104110

105-
if not bindings.is_enabled():
111+
if not is_recording_enabled(recording):
106112
logging.warning("Rerun is disabled - save() call ignored. You must call rerun.init before saving a recording.")
107113
return
108114

@@ -149,7 +155,7 @@ def stdout(default_blueprint: BlueprintLike | None = None, recording: RecordingS
149155
150156
"""
151157

152-
if not bindings.is_enabled():
158+
if not is_recording_enabled(recording):
153159
logging.warning("Rerun is disabled - save() call ignored. You must call rerun.init before saving a recording.")
154160
return
155161

@@ -234,7 +240,7 @@ def serve(
234240
235241
"""
236242

237-
if not bindings.is_enabled():
243+
if not is_recording_enabled(recording):
238244
logging.warning("Rerun is disabled - serve() call ignored")
239245
return
240246

@@ -346,7 +352,7 @@ def spawn(
346352
347353
"""
348354

349-
if not bindings.is_enabled():
355+
if not is_recording_enabled(recording):
350356
logging.warning("Rerun is disabled - spawn() call ignored.")
351357
return
352358

0 commit comments

Comments
 (0)