to_condensed_em_notation#

to_condensed_em_notation(g, separator=',')#

Return condensed EM notation for diagrams with single-letter node labels.

Constraints:
  • Nodes must be sortable and of the same type (e.g., all strings or all ints).

  • At most 52 nodes (a–zA–Z).

Parameters:
  • g (PlanarDiagram) – Diagram to serialize.

  • separator (str) – Token separator (default: comma).

Returns:

str – Condensed EM string (alphabetical node order).

Raises:
  • ValueError – If node count exceeds 52.

  • TypeError – If nodes are not mutually comparable for sorting.

Return type:

str