From c267cccaf6a15cfabcb3df2c87c6816bb1e27209 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 12 Dec 2024 09:44:10 +0100 Subject: [PATCH] format --- crates/store/re_chunk/src/chunk.rs | 2 +- examples/python/graphs/graphs.py | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/store/re_chunk/src/chunk.rs b/crates/store/re_chunk/src/chunk.rs index b7ddcda62982..8184bb5178d7 100644 --- a/crates/store/re_chunk/src/chunk.rs +++ b/crates/store/re_chunk/src/chunk.rs @@ -74,7 +74,7 @@ impl ChunkComponents { } /// Returns all list arrays for the given component name. - /// + /// /// I.e semantically equivalent to `get("MyComponent:*.*")` #[inline] pub fn get_by_component_name<'a>( diff --git a/examples/python/graphs/graphs.py b/examples/python/graphs/graphs.py index 671a31a62fe8..7743b26d0d47 100644 --- a/examples/python/graphs/graphs.py +++ b/examples/python/graphs/graphs.py @@ -4,13 +4,12 @@ from __future__ import annotations import argparse -import random import itertools -import numpy as np +import random +import numpy as np import rerun as rr import rerun.blueprint as rrb - from rerun.blueprint.archetypes.force_collision_radius import ForceCollisionRadius from rerun.blueprint.archetypes.force_link import ForceLink from rerun.blueprint.archetypes.force_many_body import ForceManyBody @@ -18,7 +17,6 @@ from rerun.components.radius import Radius from rerun.components.show_labels import ShowLabels - color_scheme = [ Color([228, 26, 28]), # Red Color([55, 126, 184]), # Blue @@ -125,16 +123,19 @@ def log_markov_chain() -> None: Color([152, 78, 163]), # Purple ] - edges = [(state_names[i], state_names[j]) for i in range(len(state_names)) for j in range(len(state_names)) if transition_matrix[i][j] > 0] + edges = [ + (state_names[i], state_names[j]) + for i in range(len(state_names)) + for j in range(len(state_names)) + if transition_matrix[i][j] > 0 + ] # We start in state "sunny" state = "sunny" for i in range(50): current_state_index = state_names.index(state) - next_state_index = np.random.choice( - range(len(state_names)), p=transition_matrix[current_state_index] - ) + next_state_index = np.random.choice(range(len(state_names)), p=transition_matrix[current_state_index]) state = state_names[next_state_index] colors = [inactive_color] * len(state_names) colors[next_state_index] = active_colors[next_state_index] @@ -145,11 +146,10 @@ def log_markov_chain() -> None: rr.log( "markov_chain", rr.GraphNodes(state_names, labels=state_names, colors=colors, positions=positions), - rr.GraphEdges(edges, graph_type="directed") + rr.GraphEdges(edges, graph_type="directed"), ) - def log_blueprint() -> None: rr.send_blueprint( rrb.Blueprint( @@ -182,7 +182,7 @@ def log_blueprint() -> None: # We don't need any forces for this graph, because the nodes have fixed positions. ), rrb.TextDocumentView(origin="description", name="Description"), - ) + ), ) ) )