hari_plotter.lazy_graph module

class hari_plotter.lazy_graph.LazyGraph(classmethod: Callable[[...], Graph], *args: Any, **kwargs: Any)[source]

Bases: object

The LazyHariGraph class is a wrapper that lazily initializes and provides access to a HariGraph instance, allowing for delayed initialization and dynamic mapping updates.

get_graph() Graph[source]

Get the initialized HariGraph instance.

Returns:

The initialized HariGraph.

Return type:

HariGraph

property is_correctly_mapped: bool

Checks whether the graph’s mapping matches the real cluster mapping of the internal HariGraph.

Mappings are expected to have sorted elements of sorted elements!

Returns:

True if the mappings match, otherwise False.

Return type:

bool

property is_initialized: bool

Checks whether the internal HariGraph instance has been initialized.

Returns:

True if the internal HariGraph is initialized, otherwise False.

Return type:

bool

property mapping: list[list[tuple[int]]]

Get the current mapping of the LazyHariGraph.

Returns:

The current mapping.

Return type:

list[list[tuple[int]]]

reinitialize() None[source]

Reinitializes the internal HariGraph instance, preserving the current mapping.

uninitialize() None[source]

Resets the internal HariGraph instance to its uninitialized state.