coordinate_sorting_key
coordinate_sorting_key(label, type_ordering=None, atom_ordering=None):
LLM Docstring
Construct a sortable tuple that orders coordinates first by type and then by their constituent atom symbols.
Plain strings are interpreted as atom-symbol motifs and sorted first by motif length. Structured labels use label.type and label.atoms; unknown coordinate types receive rank 3, and unknown atoms receive rank -1. Atom ranks are sorted internally, so endpoint orientation does not affect the key.
label:str | coordinate_labelAtom-symbol string or structured coordinate label with
typeandatomsfields.type_ordering:dict[str, int] | NoneMapping from coordinate type names to primary sort ranks.
atom_ordering:collections.abc.Sequence[str] | dict[str, int] | NoneAtom-symbol order, supplied as either a sequence or a rank mapping.
:returns:tuple[int, ...]Tuple suitable for use as a sorting key.