parse_arc#

parse_arc(arc)#

Parse a concatenated arc like 'a1b5'(('a', 1), ('b', 5)).

The function finds exactly two endpoint tokens (letter+digits). Tokens may have surrounding whitespace.

Parameters:

arc (str) – Arc string, e.g. 'a1b5' or ' a12  b003 '.

Returns:

A pair of parsed endpoints.

Raises:

ValueError – If exactly two endpoints are not found or any endpoint is invalid.

Return type:

Tuple[Tuple[str, int], Tuple[str, int]]