Skip to content

Commit

Permalink
rebase again
Browse files Browse the repository at this point in the history
  • Loading branch information
zehiko committed Oct 14, 2024
2 parents e98cba7 + abfb887 commit e4d04e1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
28 changes: 15 additions & 13 deletions crates/store/re_remote_store_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ pub mod v0 {
#[path = "../v0/rerun.remote_store.v0.rs"]
mod _v0;

use column_selector::SelectorType;

pub use self::_v0::*;

// ==== below are all necessary transforms from internal rerun types to protobuf types =====
Expand Down Expand Up @@ -290,19 +288,23 @@ pub mod v0 {
fn from(value: re_dataframe::ColumnSelector) -> Self {
match value {
re_dataframe::ColumnSelector::Component(ccs) => Self {
selector_type: Some(SelectorType::ComponentColumn(ComponentColumnSelector {
entity_path: Some(ccs.entity_path.into()),
component: Some(Component {
name: ccs.component_name,
}),
})),
selector_type: Some(column_selector::SelectorType::ComponentColumn(
ComponentColumnSelector {
entity_path: Some(ccs.entity_path.into()),
component: Some(Component {
name: ccs.component_name,
}),
},
)),
},
re_dataframe::ColumnSelector::Time(tcs) => Self {
selector_type: Some(SelectorType::TimeColumn(TimeColumnSelector {
timeline: Some(Timeline {
name: tcs.timeline.to_string(),
}),
})),
selector_type: Some(column_selector::SelectorType::TimeColumn(
TimeColumnSelector {
timeline: Some(Timeline {
name: tcs.timeline.to_string(),
}),
},
)),
},
}
}
Expand Down
7 changes: 7 additions & 0 deletions crates/store/re_types/src/components/show_labels_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ impl Default for ShowLabels {
Self(true.into())
}
}

impl From<ShowLabels> for bool {
#[inline]
fn from(value: ShowLabels) -> Self {
value.0.into()
}
}
16 changes: 11 additions & 5 deletions rerun_py/rerun_sdk/rerun/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
# --- Sinks ---


def is_recording_enabled(recording: RecordingStream | None) -> bool:
if recording is not None:
return bindings.is_enabled(recording.inner) # type: ignore[no-any-return]
return bindings.is_enabled() # type: ignore[no-any-return]


def connect(
addr: str | None = None,
*,
Expand Down Expand Up @@ -47,7 +53,7 @@ def connect(
"""

if not bindings.is_enabled():
if not is_recording_enabled(recording):
logging.warning("Rerun is disabled - connect() call ignored")
return

Expand Down Expand Up @@ -102,7 +108,7 @@ def save(
"""

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

Expand Down Expand Up @@ -149,7 +155,7 @@ def stdout(default_blueprint: BlueprintLike | None = None, recording: RecordingS
"""

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

Expand Down Expand Up @@ -234,7 +240,7 @@ def serve(
"""

if not bindings.is_enabled():
if not is_recording_enabled(recording):
logging.warning("Rerun is disabled - serve() call ignored")
return

Expand Down Expand Up @@ -346,7 +352,7 @@ def spawn(
"""

if not bindings.is_enabled():
if not is_recording_enabled(recording):
logging.warning("Rerun is disabled - spawn() call ignored.")
return

Expand Down

0 comments on commit e4d04e1

Please sign in to comment.