orthonym.rules.monocycle_forms#
Note
Internal API. Names and behaviour may change between releases.
The book’s names for a single ring of ten or fewer members, with their numbering.
The best-effort writers (terminal_ring, terminal_fragment, the floor in
assembly/universal_substituent) used to spell every ring of ten or fewer members by
skeletal replacement (‘1-azacyclobutan-1-yl’, ‘1,3-diazacyclopenta-2,4-dien-1-yl’) and a
benzene ring as ‘cyclohexa-1,3,5-trien-1-yl’. Neither is a book spelling:
(the Blue Book): “Benzene is the retained name for C6H6”; (:16290): ‘phenyl’ is a preferred prefix, fully substitutable.
(:8482): heteromonocycles with up to and including ten ring members are named by the extended Hantzsch-Widman system; (:23682) makes those names (and the retained names of Tables 2.2 and 2.3) the PINs. ‘azetidine (PIN)’ (:8402).
(:15813) and (c) (:2913): ‘cyclopropyl’, never ‘cyclopropan-1-yl’.
monocycle_form returns the book’s parent name of one ring and the numbering it is
spelled in, so a writer can place its substituent locants on it. The numbering follows
(:3219) and (:8284): the most senior heteroatom (O > S > Se > Te > N >
P > As > Sb > Bi > Si > Ge > Sn > Pb > B) gets locant 1, then lowest locants to the heteroatoms as a set and in seniority order, then to indicated hydrogen (b),
:8318), then to the free valence (c)), then to the prefixes
(f)); a canonical-rank tie-break makes the result independent of input atom order.
The parent name of a heteromonocycle is built from the ring skeleton and this form’s own
numbering: the retained name Tables 2.2, 2.3), when one applies and its fixed
numbering matches this ring’s, else the Hantzsch-Widman name (heterocycles.build_hw_name)
on this form’s own heteroatom locants. No namer’s output is parsed. Out of scope (None): charged
(an ‘ium’ nitrogen only for a caller that passes allow_cation and expresses the charge)
or isotopically labelled ring atoms, rings with partial unsaturation other than one
indicated-hydrogen atom of a mancude ring (hydro prefixes are the ring-hydrogen lane’s
build; a mancude ring whose atoms carry an exocyclic double bond takes them for the ring
atoms without a ring double bond), ring heteroatoms with a nonstandard bonding number, and elements outside the
Hantzsch-Widman table.
- class orthonym.rules.monocycle_forms.MonocycleForm(parent, numbering, kind, parent_cites_locant=False, fv_hydro_locant=None, fv_has_hydrogen=True)#
Bases:
objectOne ring spelled by its book name.
parentthe parent hydride name (‘benzene’, ‘1H-imidazole’, ‘piperidine’).numberingring atom index -> locant, the numberingparentis spelled in.kind‘benzene’, ‘cycloalkane’ or ‘heteromonocycle’.- parent: str#
- numbering: Dict[int, int]#
- kind: str#
- parent_cites_locant: bool = False#
- fv_hydro_locant: int | None = None#
the free valence sits on a hydro-prefix atom that is not the indicated-hydrogen atom (‘2,4-dioxo-1,2,3,4-tetrahydropyrimidin-1-yl’);
fv_locantis its locant,fv_has_hydrogensays the atom is a ring carbon (it keeps a hydrogen to substitute)
- fv_has_hydrogen: bool = True#
- cites_locant(free_valence_locant=None)#
The parent or its prefix at
free_valence_locantcites a locant, the Blue Book): a heteromonocycle whose parent cites one (indicated hydrogen, a hydro prefix, or heteroatom locants that are not omitted,, or any prefix with a free valence off locant 1.
- prefix(free_valence_atom, bond_order=1)#
The substituent prefix with the free valence at
free_valence_atom.‘phenyl’:16290), ‘cyclopropyl’ / ‘cyclohexylidene’ (1) :15813), ‘pyridin-2-yl’ / ‘piperidin-4-ylidene’ / ‘1H-imidazol-1-yl’ (2) :15814: the final ‘e’ of the parent is elided before ‘y’, the locant is cited).
- prefix_at_locant(loc, bond_order=1)#
prefixfor the free valence at ring locantloc.
- orthonym.rules.monocycle_forms.aromatic_view(mol)#
A copy of
mol(same atom indices) with aromaticity perceived, for a caller that works on a kekulized copy without aromatic flags;Nonewhen RDKit cannot perceive it.
- orthonym.rules.monocycle_forms.branch_carriers(mol, ring_atoms, free_valence_atom=None, within=None)#
One entry per substituent prefix on each ring atom (f)): every heavy neighbour outside the ring (inside
withinwhen given), less the parent bond of the free-valence atom whenwithinis not given.
- orthonym.rules.monocycle_forms.monocycle_form(mol, ring_atoms, free_valence_atom=None, branch_atoms=(), allow_cation=False)#
The book’s name and numbering of one ring (
_monocycle_form), recorded withassembly.book_prefixes.note_book_formwhen one is given.