from_em_notation#

from_em_notation(data, oriented=False)#

Create a planar diagram from EM dict (or stringified dict) notation.

The input should map each node to a CCW-ordered list of (neighbor, neighbor_position) pairs.

Parameters:
  • data (Mapping[Any, Iterable[tuple[Any, int]]] | str) – EM dict, or a string that safely evaluates to such a dict.

  • oriented (bool) – Whether to construct an oriented diagram (not implemented).

Returns:

PlanarDiagram – Parsed diagram.

Raises:
  • NotImplementedError – If oriented=True.

  • ValueError – On malformed inputs.

Return type:

PlanarDiagram