from_condensed_pd_notation#

from_condensed_pd_notation(text, node_type=<class 'str'>, oriented=False, **attr)#

Create a planar diagram from condensed PD code (e.g., "abc bcde ...").

Each token is a node’s incident arcs in CCW order; 4 letters → X (crossing), otherwise V (vertex). Arc labels must be single characters and paired globally.

Parameters:
  • text (str) – Condensed PD code as space-separated tokens.

  • node_type (type | Any) – Use str for a,b,c,... labels (default), else integers.

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

  • **attr (Any) – Diagram attributes to set.

Returns:

PlanarDiagram – Parsed diagram.

Raises:
  • NotImplementedError – If oriented=True (placeholder).

  • ValueError – If token parsing fails.

Return type:

PlanarDiagram