orthonym.rules.acid_ester_anion#

Note

Internal API. Names and behaviour may change between releases.

Acid-ester anion producer (IUPAC-2013.

The anion of an acid-ester of a P or S oxoacid, where the ester owner R is a plain organyl: dodecyl phosphate, dodecyl hydrogen phosphate, diethyl phosphate, dodecyl sulfate. The protonation word is derived IN PLACE from the surviving free -OH count; the [O-] carry the charge and are not counted as hydrogens (— never neutralize-then-rename). Fail-closed (None) off the clean single-centre ester-anion shape so a wrong molecule is never emitted; the immediate caller (_validate_anion_name) only checks suffix sanity (an 'oic acid' / 'methylidene' guard) — the actual round-trip / 0-wrong backstop is the top-level /OPSIN validity gate (namer._final_opsin_validity_gate).

orthonym.rules.acid_ester_anion.name_sulfate_ester_anion(mol, sulfur_idx)#

Name the anion of a sulfate acid-ester R-O-S(=O)(=O)-[O-] -> {R}yl sulfate.

Requires: neutral non-ring S; exactly two =O; exactly one -O-C ester owner; exactly one terminal acidic O with at least one [O-]; NO S-C bond (that is a sulfonate — a different, already-handled class); the molecule’s only charges are the terminal [O-]; complete atom coverage. Otherwise None (honest fail).

orthonym.rules.acid_ester_anion.name_oxime_o_sulfate_anion(mol, sulfur_idx)#

Name the anion of an oxime/thiohydroximate O-sulfate ester R2C=N-O-S(=O)(=O)-[O-] -> [({R2C}ylidene)amino] sulfate (the glucosinolate AGLYCONE motif, a phase; sulfate-ester-anion class whose ester owner is anchored at an oxime NITROGEN, not the usual ester-oxygen-to-carbon owner name_sulfate_ester_anion handles).

a trace (a project rule): confirmed name_sulfate_ester_anion declines this shape at its OWN oxygen-classification loop (acid_ester_anion.py lines ~60-73) – the ester oxygen’s non-sulfur neighbour is an N, not a C/S, so it falls straight to that loop’s else: return None catch-all before ever reaching _p_ester_owner_group. This sibling mirrors that same S-atom bond-classification shape (two =O, one terminal [O-]/-OH, one single-bonded ester -O-) but requires the ester oxygen’s owner to be a PLAIN oxime nitrogen (degree 2: the ester O plus one C=N double bond, no third N-substituent – an N-substituted oxime ETHER is a different, unbuilt class and fails closed here).

The owner fragment (everything reachable from the double-bonded C without crossing back into N) is named via the SAME -ylidene primitive the semicarbazone/hydrazone namers use (composer._double_bonded_carbon_prefix – verified via free_valence_morphology to actually spell two free valences, never assumed), then wrapped [(...ylidene)amino] per the identical enclosure logic enclose_if_compound already applies elsewhere (BB verbatim precedent for the [(...ylidene)amino] construction: 4-{[(4-chlorophenyl)methylidene]amino}aniline (PIN) under, polyfunctional.py _name_amidine_chain_side docstring).

Fail-closed (None) off the clean single-centre shape so a wrong molecule is never emitted – notably a FULL glucosinolate (the oxime nitrogen’s owner replaced by the intact molecule, S-glycosylated with a thioglucoside sugar) is a completely different atom set on the S side (-C(=N-O-SO3-)-S-glycosyl) and is untouched by this function (its ester owner is still N here; the SUGAR sits on the unrelated S8-thiol side and is simply carried inside the ylidene fragment like any other substituent – but the substituent namer’s own sugar/ring-fragment gaps make that fail closed on _double_bonded_carbon_prefix returning None for those inputs, verified in the integration test).

orthonym.rules.acid_ester_anion.name_acid_ester_anion(mol)#

Find the single qualifying P/S acid-ester centre and name its anion.

Tries each non-ring P then each non-ring S; each builder’s coverage audit guarantees a returned name accounts for the WHOLE molecule, so a poly-phosphate / multi-centre species fails closed (None -> the caller falls through). For sulfur, name_sulfate_ester_anion (the plain C-anchored ester owner) is tried FIRST so its byte-identical behaviour is unchanged; name_oxime_o_sulfate_anion (a phase, the N-anchored oxime owner – glucosinolate-type thiohydroximate/oxime O-sulfate anions) is only reached when that declines. None when nothing qualifies.