Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Dec 12, 2024
1 parent 6559173 commit c267ccc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion crates/store/re_chunk/src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
Expand Down
22 changes: 11 additions & 11 deletions examples/python/graphs/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@
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
from rerun.components.color import Color
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
Expand Down Expand Up @@ -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]
Expand All @@ -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(
Expand Down Expand Up @@ -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"),
)
),
)
)
)
Expand Down

0 comments on commit c267ccc

Please sign in to comment.