Skip to content

bloqade.lanes.visualize.arch.ArchVisualizer

← Module overview

classArchVisualizersource

bloqade.lanes.visualize.arch.ArchVisualizer

Visualization facade for an :class:`ArchSpec`.

class ArchVisualizer(arch_spec: ArchSpec)

Construct once from an architecture spec; bounds are cached so repeated calls to plot or show don’t recompute site positions.

Example::

viz = ArchVisualizer(arch_spec) viz.plot(ax, show_words=[0, 1], show_word_bus=[0]) print(viz.x_bounds, viz.y_bounds)

Parameters

NameTypeDescription
arch_specArchSpec

Attributes

NameTypeDefaultDescription
arch_spec—arch_spec

propertyx_boundssource

bloqade.lanes.visualize.arch.ArchVisualizer.x_bounds

x_bounds: tuple[float, float]

(x_min, x_max) across every site. Falls back to (-1.0, 1.0) when no sites are discoverable.

source

propertyy_boundssource

bloqade.lanes.visualize.arch.ArchVisualizer.y_bounds

y_bounds: tuple[float, float]

(y_min, y_max) across every site. Falls back to (-1.0, 1.0) when no sites are discoverable.

source

methodpath_boundssource

bloqade.lanes.visualize.arch.ArchVisualizer.path_bounds

def path_bounds() -> tuple[float, float, float, float]

(x_min, x_max, y_min, y_max) covering every site and every transport-path waypoint registered on the arch.

Returns

tuple[float, float, float, float]

source

methoditer_word_bus_pathssource

bloqade.lanes.visualize.arch.ArchVisualizer.iter_word_bus_paths

Signature
def iter_word_bus_paths(show_word_bus: Sequence[int]) -> Iterator[tuple[tuple[float, float], ...]]

Parameters

NameTypeDescription
show_word_busSequence[int]

Returns

Iterator[tuple[tuple[float, float], ...]]

source

methoditer_site_bus_pathssource

bloqade.lanes.visualize.arch.ArchVisualizer.iter_site_bus_paths

Signature
def iter_site_bus_paths(show_words: Sequence[int], show_site_bus: Sequence[int]) -> Iterator[tuple[tuple[float, float], ...]]

Parameters

NameTypeDescription
show_wordsSequence[int]
show_site_busSequence[int]

Returns

Iterator[tuple[tuple[float, float], ...]]

source

methodplotsource

bloqade.lanes.visualize.arch.ArchVisualizer.plot

Signature
def plot(ax: Axes | None = None, show_words: Sequence[int] = (), show_site_bus: Sequence[int] = (), show_word_bus: Sequence[int] = (), **scatter_kwargs={}) -> Axes

Render the architecture onto a matplotlib axes.

Returns the ax argument (or the auto-resolved current axes) so callers can chain or further customise the plot.

Parameters

NameTypeDefaultDescription
axAxes | NoneNone
show_wordsSequence[int]()
show_site_busSequence[int]()
show_word_busSequence[int]()
**scatter_kwargs—{}

Returns

Axes

source

methodshowsource

bloqade.lanes.visualize.arch.ArchVisualizer.show

Signature
def show(ax: Axes | None = None, show_words: Sequence[int] = (), show_intra: Sequence[int] = (), show_inter: Sequence[int] = (), **scatter_kwargs={}) -> None

Render and immediately call plt.show().

Convenience for interactive sessions; programmatic callers should prefer plot.

Parameters

NameTypeDefaultDescription
axAxes | NoneNone
show_wordsSequence[int]()
show_intraSequence[int]()
show_interSequence[int]()
**scatter_kwargs—{}
source