dispatcher#
Functions
|
Return the “from-notation” parser function for a given keyword. |
|
Return the “to-notation” converter function for a given keyword. |
- to_notation_dispatcher(notation)#
Return the “to-notation” converter function for a given keyword.
- Parameters:
notation (str) – Notation keyword (e.g., “pd”, “plantri”, “em”, “cem”, “native”).
- Returns:
Callable[…, Any] – Function that converts a diagram to the requested notation.
- Raises:
ValueError – If the notation keyword is unsupported.
TypeError – If notation is not a string.
- Return type:
Callable[[…], Any]
Examples
>>> fn = to_notation_dispatcher("PD") >>> callable(fn) True
- from_notation_dispatcher(notation)#
Return the “from-notation” parser function for a given keyword.
- Parameters:
notation (str) – Notation keyword (e.g., “pd”, “plantri”, “em”, “cem”, “native”).
- Returns:
Callable[…, Any] – Function that parses the notation into a diagram.
- Raises:
ValueError – If the notation keyword is unsupported.
TypeError – If notation is not a string.
- Return type:
Callable[[…], Any]
Examples
>>> fn = from_notation_dispatcher("cem") >>> callable(fn) True