orthonym.rules.nitramide#
Note
Internal API. Names and behaviour may change between releases.
Substitutive N-nitro / nitramide naming (Milestone B3, Task 4).
THE DEFECT THIS CLOSES#
Any SUBSTITUTED nitramide has a different canonical SMILES than the bare
retained-table key and misses that table entirely – nothing downstream ever
built the substitutive parent, so every N-substituted nitramide fell through
to GENERAL/decomposition (which named a fragment, e.g. methanol for
O=[N+]([O-])NCO, dropping the nitro-amide unit) and was suppressed by
to the
unknown organic compoundsentinel.
V36-a trace-B3 section 2 (“N-nitro” rows) verified every target form below OPSIN-round-trip-exact (full InChIKey match, constitution + charge).
TWO SHAPES BUILT HERE (fails closed on everything else – never a per-molecule special case) —————————————————————— 1. ``nitramide`` PARENT + N-substituent prefix(es). Exactly one
nitro-bearing amide nitrogen in the whole molecule, with 0-2 carbon-rooted substituents (mirrors
sulfonamides._collect_n_substituents’s guard: an N-heteroatom substituent is a different construction and is refused):O=[N+]([O-])NCO -> N-(hydroxymethyl)nitramide O=[N+]([O-])N(CO)CO -> N,N-bis(hydroxymethyl)nitramide
``N,N’-dinitro<diamine>``. EXACTLY two nitro-bearing amide nitrogens, each with NO other substituent, both attached to the SAME bridging heavy atom which itself carries no other substituent (structurally forced to be a plain methylene bridge – the only real-witness shape verified):
O=[N+]([O-])NCN[N+](=O)[O-] -> N,N'-dinitromethanediamineThe structural guards (degree-2 carbon, both neighbours being the two qualifying amide N’s, non-aromatic, ring-free) leave exactly ONE possible parent hydride – methanediamine – so it is returned directly rather than re-entering the general naming pipeline (which does not yet build ANY gem-diamine parent, a separate pre-existing gap out of scope here; see
_name_dinitro_diamine). Scoped NARROWLY to this one shape: a numeric-locant diamine (propane-1,3-diamine) would need superscriptedN^1/N^3dinitro locants that are not built here – fails closed rather than guess.
- orthonym.rules.nitramide.name_substituted_nitramide(mol, style='pin')#
Return the substitutive nitramide/N-nitro PIN, else None.
N-(hydroxymethyl)nitramide,N,N-bis(hydroxymethyl)nitramide,N,N'-dinitromethanediamine. Fails closed on every shape outside the two documented in this module’s docstring.