QuantumGraphDotVisualizer

class lsst.pipe.base.quantum_graph.visualization.QuantumGraphDotVisualizer

Bases: QuantumGraphVisualizer[BaseQuantumGraph, QuantumInfo, DatasetInfo]

A visualizer for quantum graphs in the GraphViz dot language.

Methods Summary

render_dataset(dataset_id, data)

Return the representation of a dataset in a graph visualization.

render_edge(a, b, data)

Return the representation of an edge a graph visualization.

render_footer(qg, is_bipartite)

Return the ending of a graph visualization.

render_header(qg, is_bipartite)

Return the beginning of a graph visualization.

render_quantum(quantum_id, data, is_bipartite)

Return the representation of a quantum in a graph visualization.

write_bipartite(qg, stream)

Write a visualization for graph with both quantum and dataset nodes.

write_quantum_only(qg, stream)

Write a visualization for graph with only quantum nodes.

Methods Documentation

render_dataset(dataset_id: UUID, data: DatasetInfo) str

Return the representation of a dataset in a graph visualization.

Parameters:
dataset_iduuid.UUID

ID of the dataset.

dataDatasetInfo

Mapping with additional information about the dataset.

Returns:
renderedstr

String that represents the dataset. May contain newlines, but an additional newline will automatically be added after the string, before the next node or edge.

render_edge(a: UUID, b: UUID, data: BipartiteEdgeInfo | None) str

Return the representation of an edge a graph visualization.

Parameters:
auuid.UUID

ID of the quantum or dataset for which this is an outgoing edge.

buuid.UUID

ID of the quantum or dataset for which this is an incoming edge.

dataBipartiteEdgeInfo

Mapping with additional information about the dataset.

Returns:
renderedstr

String that represents the edge. May contain newlines, but an additional newline will automatically be added after the string, before the next edge.

Return the ending of a graph visualization.

Parameters:
qgBaseQuantumGraph

Quantum graph to visualize.

is_bipartitebool

Whether a bipartite graph visualization is being requested.

Returns:
renderedstr

String that ends the visualization. May contain newlines, but an additional newline will automatically be added after the string, at the end of the file.

render_header(qg: BaseQuantumGraph, is_bipartite: bool) str

Return the beginning of a graph visualization.

Parameters:
qgBaseQuantumGraph

Quantum graph to visualize.

is_bipartitebool

Whether a bipartite graph visualization is being requested.

Returns:
renderedstr

String that starts the visualization. May contain newlines, but an additional newline will automatically be added after the string, before the first node.

render_quantum(quantum_id: UUID, data: QuantumInfo, is_bipartite: bool) str

Return the representation of a quantum in a graph visualization.

Parameters:
quantum_iduuid.UUID

ID of the quantum.

dataQuantumInfo

Mapping with additional information about the quantum.

is_bipartitebool

Whether a bipartite graph visualization is being requested.

Returns:
renderedstr

String that represents the quantum. May contain newlines, but an additional newline will automatically be added after the string, before the next node or edge.

write_bipartite(qg: _G, stream: IO[str]) None

Write a visualization for graph with both quantum and dataset nodes.

Parameters:
qgBaseQuantumGraph

Quantum graph to visualize.

streamtyping.IO

File-like object to write to.

write_quantum_only(qg: _G, stream: IO[str]) None

Write a visualization for graph with only quantum nodes.

Parameters:
qgBaseQuantumGraph

Quantum graph to visualize.

streamtyping.IO

File-like object to write to.