orthonym.rules.phane_pin.numbering#

Note

Internal API. Names and behaviour may change between releases.

Numbering of a simplified phane skeleton and of its amplificants.

The key compares two numberings term by term, lower first,:3189). Each part is a rule of the Blue Book (the Blue Book, each line read with sed -n):

  • K1 (:14965) “the numbering that gives the lowest set of locants for the superatoms is selected”;

  • K2 (:14989) “the lower available superatom locant is assigned to an amplificant that appears earlier in the seniority of rings and ring systems (see “;

  • K3 (:15043), (:15091), (:19707) “The senior cyclic phane system has the lower set of attachment locants when compared term by term in their order of citation in the name”;

  • K4 (:14953), (:15003), (:15033): the same locants in the order in which they are cited, the first cited being adjacent to the lower skeleton locant of its neighbours;

  • K5 (:15232): the set of locants of the skeleton heteroatoms, whatever the element;

  • K6 (:15246) “Lowest locants are assigned to heteroatoms considered in the order of their seniority: O > S > Se > Te > N > P > As > Sb > Bi > Si > Ge > Sn > Pb > B > Al > Ga > In > Tl”;

  • K6b (b) (:3246): the locants of the indicated hydrogen of the amplificants, before the principal groups;

  • K7 (c) (:3256): the locants of the principal characteristic groups (heteroatoms of the parent come first,:3225: “heteroatoms in chains are now considered to be a part of the parent hydride; as such, they have seniority over suffixes for numbering”);

  • K8 (e)(i) (:3289): the hydro prefixes of the amplificants and the ‘ene’ and ‘yne’ endings as one set, by their primary locants first, then by the composite locants; (e)(ii) (:3290) and (:16489): “Locants as low as possible are given to multiple bonds as a set, even though this may at times give ‘yne’ endings lower locants than ‘ene’ endings. If a choice remains, preference for low locants is given to the double bonds”;

  • K9 (:15115): the locants of the detachable prefixes as one set, first by their primary locants and, if these are identical, by the complete composite locants (f),:3301);

  • K10 (g) (:3307) “lowest locants for the substituent cited first as a prefix in the name”;

  • K11 (j) (:3346): the CIP descriptors Z, R before E, S at the lower locants (stereo.rank_key), those of the skeleton and those inside the prefixes, each at the locant of the atom its prefix is attached to; (h) and (i), the valence states and the isotopes, take no part in a name built here;

  • K12 the book states no rule for the prefixes cited after the first, so the comparison of K10 goes on in the order of citation (ASSUMED reading: it is what leaves one name for one structure). It stands after K11: a decision that (j) takes is never taken by the citation order of the later prefixes.

Numbering of an amplificant is that of its hydride,:14967): of the valid numberings (AmplificantHydride.numberings) the ones that give its indicated hydrogen the lowest locants stay (the indicated hydrogen belongs to the parent name, indicated_numberings), then the one with the lowest attachment locants is taken; among those, the one that gives the suffix groups and then the prefixes the lowest composite locants.

A locant is (primary, number, letter): (4, 0, "") for a skeletal atom or a superatom, (1, 4, "") for atom 4 of the amplificant at superatom 1 (written 1^4,,:15111).

class orthonym.rules.phane_pin.numbering.Placed(locant, amp, cited, tied)#

Bases: object

An amplificant at skeleton locant locant, its attachment locants as they are cited, and every numbering of its hydride that gives them (they differ only where a later part of the key tells).

locant: int#
amp: Amplificant#
cited: Tuple[Tuple[int, str], ...]#
tied: Tuple[Mapping[int, Tuple[int, str]], ...]#
class orthonym.rules.phane_pin.numbering.Numbered(pos: 'Dict[Node, int]', placed: 'Tuple[Placed, ...]', key: 'tuple', chosen: 'Dict[int, Mapping[int, _Locant]]', enes: 'Tuple[int, ...]' = (), ynes: 'Tuple[int, ...]' = (), wraps: 'bool' = False)#

Bases: object

pos: Dict[Tuple[str, int], int]#
placed: Tuple[Placed, ...]#
key: tuple#
chosen: Dict[int, Mapping[int, Tuple[int, str]]]#
enes: Tuple[int, ...] = ()#
ynes: Tuple[int, ...] = ()#
wraps: bool = False#
orthonym.rules.phane_pin.numbering.render_locant(locant)#
orthonym.rules.phane_pin.numbering.skeleton_numberings(skel)#

Every numbering of the skeleton: for a cycle each node as the first and both directions leaves them all), for a path the two directions.

orthonym.rules.phane_pin.numbering.best_attachment(skel, amp, neighbours)#

,,: the numbering of the amplificant with the lowest attachment set, among the numberings its parent name allows (the lowest indicated hydrogen first, indicated_numberings), cited in the order of the skeleton locants of its neighbours; the tied numberings are kept.

orthonym.rules.phane_pin.numbering.skeleton_heteroatoms(skel, pos)#

Skeleton locant -> element symbol of every acyclic skeletal heteroatom.

orthonym.rules.phane_pin.numbering.multiple_bonds(skel, pos)#

Locants of the double and of the triple bonds between acyclic skeletal atoms (the lower locant of the bond) and whether one of them joins the last node to the first, which cites as 1(n).

exception orthonym.rules.phane_pin.numbering.UndecidableTiesError#

Bases: Exception

Too many ways to give the amplificants their locants for one name to be chosen by comparison.

orthonym.rules.phane_pin.numbering.atom_locant(skel, pos, chosen, atom)#
orthonym.rules.phane_pin.numbering.citation_key(name)#

The order in which prefix names are cited: alphanumerical, descriptors ignored); names that differ only in their descriptors by the CIP rank of the descriptors, Z before E and R before S (j): the prefix cited first takes the lower locant, cip_descriptor_rank_key); then the string.

orthonym.rules.phane_pin.numbering.numbering_key(skel, pos, plan=None)#
orthonym.rules.phane_pin.numbering.best_numberings(skel, plan=None)#

Every numbering whose key is the lowest (a tie is decided by the name string, in naming).