orthonym.assembly.handlers.hydroxylamine#

Note

Internal API. Names and behaviour may change between releases.

functional-group perception fix (a phase) hydroxylamine handler.

Names substituted hydroxylamines on the retained parent hydride hydroxylamine (H2N-OH,. Substituents on the nitrogen take the N- locant; those on the oxygen take O-:

CCCNO -> N-propylhydroxylamine CCCN(O)C -> N-methyl-N-propylhydroxylamine CON -> O-methylhydroxylamine CN(C)O -> N,N-dimethylhydroxylamine

Without this handler the perceived hydroxylamine FG (added to functional_groups.py in 169.7) is dropped and the molecule names as the bare carbon chain (CCCNO -> propane), silently losing both heteroatoms.

The substituent names come from the shared name_substituent_fragment namer; multiplying affixes + alphanumeric ordering reuse the standard prefix helpers.

IUPAC cite:.

orthonym.assembly.handlers.hydroxylamine.name_hydroxylamine(features, mol=None, style='pin')#

Name a substituted hydroxylamine on the hydroxylamine parent, or an N,O-disubstituted hydroxylamine as an O-substituted amine, or an N-carbon-substituted hydroxylamine as an N-hydroxy amine derivative .

orthonym.assembly.handlers.hydroxylamine.no_disub_hydroxylamine_core(mol)#

Return (n_idx, o_idx) for an N,O-DISUBSTITUTED hydroxylamine core (R-NH-O-R’ or R2N-O-R’), else None. The PIN of such a compound is an O-substituted AMINE, and skeletal (‘a’) replacement is explicitly forbidden (BB note).

Fail-closed to None off this exact class: a single acyclic neutral N-O single bond where the N bears >=1 carbon (besides O) AND the O bears exactly one carbon (no O-H), with N/O the ONLY heteroatoms and every other heavy atom a carbon (pure hydrocarbyl substituents), no multiple bond on N/O. This keeps the simpler O-substituted (H2N-O-R) and N-substituted (R-NH-OH) forms — whose PIN is the hydroxylamine parent — out (there the O bears H, or the N bears only H).