orthonym.assembly.hetero_group_prefixes#

Note

Internal API. Names and behaviour may change between releases.

Substituent prefixes of nitrogen and oxygen groups the book composes from their parts (roadmap item 12a).

The writers of the best-effort tier (the universal floor, universal_substituent, and the terminal-fragment writer, rules.terminal_fragment) spell a branch that no leaf names as a skeletal replacement (‘a’) chain: =N-OH as ‘2-oxa-1-azaethan-1-ylidene’, -N=N-Ph as ‘2-phenyl-1,2-diazaeth-1-en-1-yl’, -OOH as ‘1,2-dioxaethan-1-yl’. An ‘a’ chain “must be terminated by a C atom or one of the following heteroatoms: P, As, Sb, Bi, Si, Ge, Sn, Pb, B, Al, Ga, In, or Tl”, the Blue Book, section

General rules), so none of these is a book name. The book names each one by a

substituent prefix:

  • =N-OH, =N-OR, =N-R ‘hydroxyimino’, ‘(methoxyimino)’, ‘(methylimino)’ , oximes: ‘:38485’ “4-[(ethoxyimino)methyl]benzene-1-sulfonic acid (PIN)”,:38460 “3-(hydroxyimino)butanal (PIN)”; imino is “used only to designate =NH as a substituent”, Changes from the 1979 edition 7(b),:1695, so a substituted imine nitrogen is cited as the prefix of its substituent plus ‘imino’);

  • =N-NR2 ‘(R2)hydrazinylidene’: “‘hydrazinylidene’ for H2N-N=” (Changes from the 1979 edition 7(j),:1703), “(dimethylcarbamoyl)hydrazinylidene (preferred prefix)” ,:24611);

  • -N=N-R ‘(R)diazenyl’: “The prefix ‘diazenyl’ is a preselected prefix” Substitution of diazene,:38732), “(methyldiazenyl)acetic acid (PIN)” (:38740);

  • -NR-NR2 ‘(locants)hydrazin-1-yl’: ‘hydrazinyl (preselected prefix)’,:16037, :2911); a substituent on a hydrazine unit cites its locant and the free valence’s ,:2869; ‘4-(1-acetyl-2-ethylhydrazin-1-yl)benzoic acid (PIN)’, “Substituent groups derived from hydrazides”,:34042; ‘2-nitrohydrazin-1-yl (preselected prefix)’, “Substituent groups derived from the hydrazides of nitric acid and nitrous acid”,:36437), and the locants are left out only where no isomer can be generated ,:2953: ‘ethylidenehydrazinyl (preferred prefix) (not 2-ethylidenehydrazin-1-yl)’, :2959;,:3007, a unit in which every position holds the same substituent);

  • -OO-R ‘(R)peroxy’ and -OOH ‘hydroperoxy’: “The prefix ‘peroxy’, not ‘dioxy’, is retained for the group -OO-” and “The prefix ‘hydroperoxy’ is formed by concatenation to describe the group -OOH as a substituent” Hydroperoxides, :27944); “the prefixes ‘R’-peroxy’ (not R’-dioxy)” Peroxides, disulfides, diselenides, and ditellurides,:27858), “(methylperoxy)ethane (PIN)” (:27870);

  • -N=CR2 with a defined C=N geometry ‘[(E)-R2-methylidene]amino’ ? the amino prefix with its ylidene substituent, as universal_substituent._hetero_root_leaf builds it for the geometry-free case; the descriptor is cited at the front of the ylidene prefix,,:44643);

  • -NR2(+)-O(-) ‘(R2)(oxido)azaniumyl’ Amine oxides, imine oxides, and chalcogen analogues,:26648 “[dimethyl(oxido)azaniumyl]methyl”);

  • =N(+)(R)-O(-) ‘(R)(oxido)azaniumylidene’,:43386);

  • -N=O ‘nitroso’ Nitro and nitroso compounds: “the prefixes ‘nitro’ and ‘nitroso’”,:25935);

  • -O-N< ‘(R-amino)oxy’, an oxime ether ‘[(R-ylidene)amino]oxy’, :27633 ‘R-oxy’; the nitrogen prefix of an oxime is the amino prefix with its ylidene substituent as above);

  • =[OR]+ ‘(R)oxidaniumylidene’,:42350 “(methyloxidaniumylidene)”);

  • =[NR2]+ ‘(R2)azaniumylidene’: “(1) all prefix names are formed by adding the suffixes ‘yl’, ‘ylidene’, etc. to the cation name” Cationic prefix names, :42298), ‘azaniumyl (preselected prefix)’ (:42303). The preferred prefix of =N(CH3)2+ is ‘N-methylmethanaminiumylidene’ (:42322); the composed form built here is valid, never a PIN, and is recorded as a non-PIN fragment.

group_shape reads the structure and returns the parts the host must name (each by its own recursion, so stereo, charges and nested groups are the host’s business); compose_group joins the parts’ names. Both are pure: the same input always gives the same output. A shape the module does not build, any charge it does not spell and any isotope give None, and the host keeps its previous spelling.

orthonym.assembly.hetero_group_prefixes.LATE_KINDS = frozenset({'aminooxy'})#

kinds a writer builds only after its own heteroatom-rooted composer declined (the composer spells ‘-O-NH-R’ itself where it can)

class orthonym.assembly.hetero_group_prefixes.GroupPart(attach, atoms, host, locant=None, order=1)#

Bases: object

One substituent hanging on the group: attach is its atom bonded to the group’s host atom, atoms the part’s atoms, locant the hydrazine-unit locant of the host atom (1 or 2) or None.

attach: int#
atoms: FrozenSet[int]#
host: int#
locant: int | None = None#
order: int = 1#
class orthonym.assembly.hetero_group_prefixes.GroupShape(kind: 'str', parts: 'Tuple[GroupPart, ...]', unit: 'FrozenSet[int]', charged: 'FrozenSet[int]' = frozenset(), internal: 'FrozenSet[int]' = frozenset(), stereo_bond: 'Optional[Tuple[int, int]]' = None, acylhydrazide: 'bool' = False)#

Bases: object

kind: str#
parts: Tuple[GroupPart, ...]#
unit: FrozenSet[int]#
charged: FrozenSet[int] = frozenset({})#
internal: FrozenSet[int] = frozenset({})#
stereo_bond: Tuple[int, int] | None = None#
acylhydrazide: bool = False#
orthonym.assembly.hetero_group_prefixes.group_shape(mol, root, group, parent, unstereo_iminyl=False)#

The shape of the group group attached to parent through root, or None (not a group this module composes). parent is the one atom outside group that root is bonded to. unstereo_iminyl: also build ‘[(R-ylidene)amino]’ for an N=C bond with no defined geometry (the floor’s _hetero_root_leaf builds that one).

orthonym.assembly.hetero_group_prefixes.compose_group(shape, names)#

The prefix of shape given the host’s name of each of its parts (in the order of shape.parts: a -yl prefix for each part), or None. A prefix with parts is recorded as substituted and enclosed (prefix_derivation.built), so it is cited with enclosing marks wherever it stands, whatever its first letters are (‘tert-butyl(oxido) azaniumylidene’ is compound although a name beginning ‘tert-butyl’ reads as simple).

orthonym.assembly.hetero_group_prefixes.hydrazine_substituents(cited)#

The substituent prefixes of a hydrazine unit, each with its locant, the Blue Book: deny by default), in alphanumerical order and with identical ones multiplied: ‘2,2-dimethyl’, ‘1,2-dimethyl’, ‘2-phenyl’. cited holds one (locant, '-yl' prefix name) per substituent; the head (‘hydrazinyl’, ‘hydrazine-1-sulfonyl’) is the caller’s.