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_label

    Atom-symbol string or structured coordinate label with type and atoms fields.

  • type_ordering: dict[str, int] | None

    Mapping from coordinate type names to primary sort ranks.

  • atom_ordering: collections.abc.Sequence[str] | dict[str, int] | None

    Atom-symbol order, supplied as either a sequence or a rank mapping.

  • :returns: tuple[int, ...]

    Tuple suitable for use as a sorting key.


Feedback

Examples

Templates

Documentation