Skip to content

Commit

Permalink
Python SDK: Add rr.version() (#2084)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk authored May 11, 2023
1 parent bd8a072 commit 8bc6741
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rerun_py/rerun_sdk/rerun/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@ def init(
_spawn()


def version() -> str:
"""
Returns a verbose version string of the Rerun SDK.
Example: `rerun_py 0.6.0-alpha.0 [rustc 1.69.0 (84c898d65 2023-04-16), LLVM 15.0.7] aarch64-apple-darwin main bd8a072, built 2023-05-11T08:25:17Z`
""" # noqa: E501 line too long
return bindings.version() # type: ignore[no-any-return]


def is_enabled() -> bool:
"""
Is the Rerun SDK enabled.
Expand Down
7 changes: 7 additions & 0 deletions rerun_py/src/python_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ fn rerun_bindings(_py: Python<'_>, m: &PyModule) -> PyResult<()> {

// init
m.add_function(wrap_pyfunction!(init, m)?)?;
m.add_function(wrap_pyfunction!(version, m)?)?;
m.add_function(wrap_pyfunction!(is_enabled, m)?)?;
m.add_function(wrap_pyfunction!(shutdown, m)?)?;

Expand Down Expand Up @@ -257,6 +258,12 @@ authkey = multiprocessing.current_process().authkey
authkey.as_bytes().to_vec()
}

/// Return a verbose version string
#[pyfunction]
fn version() -> String {
re_build_info::build_info!().to_string()
}

/// Is logging enabled in the global recording?
#[pyfunction]
fn is_enabled() -> bool {
Expand Down

1 comment on commit 8bc6741

@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: 8bc6741 Previous: bd8a072 Ratio
datastore/num_rows=1000/num_instances=1000/packed=false/insert/default 3374465 ns/iter (± 65937) 2461907 ns/iter (± 10989) 1.37
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at/default 370 ns/iter (± 4) 289 ns/iter (± 6) 1.28
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/primary/default 266 ns/iter (± 3) 205 ns/iter (± 1) 1.30
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/secondaries/default 424 ns/iter (± 2) 329 ns/iter (± 2) 1.29
datastore/num_rows=1000/num_instances=1000/packed=false/range/default 3510135 ns/iter (± 93751) 2492003 ns/iter (± 13504) 1.41
datastore/num_rows=1000/num_instances=1000/gc/default 2455519 ns/iter (± 21481) 1616811 ns/iter (± 21629) 1.52
mono_points_arrow/generate_message_bundles 29249745 ns/iter (± 995702) 22054958 ns/iter (± 571607) 1.33
mono_points_arrow_batched/generate_message_bundles 21559013 ns/iter (± 1222690) 15509269 ns/iter (± 111181) 1.39
mono_points_arrow_batched/generate_messages 4262466 ns/iter (± 213615) 2958998 ns/iter (± 36349) 1.44
mono_points_arrow_batched/encode_total 27518452 ns/iter (± 1136956) 19861616 ns/iter (± 84571) 1.39
mono_points_arrow_batched/decode_log_msg 733885 ns/iter (± 3752) 433415 ns/iter (± 1368) 1.69
mono_points_arrow_batched/decode_total 8441557 ns/iter (± 211772) 6604419 ns/iter (± 30393) 1.28
arrow_mono_points/insert 2246122513 ns/iter (± 4609689) 1545614489 ns/iter (± 13198358) 1.45
arrow_mono_points/query 1270381 ns/iter (± 10692) 863982 ns/iter (± 13913) 1.47
arrow_batch_points/query 16852 ns/iter (± 40) 12292 ns/iter (± 175) 1.37
arrow_batch_vecs/query 387428 ns/iter (± 3182) 294368 ns/iter (± 2962) 1.32

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

Please sign in to comment.