orthonym.assembly.retained_c2_chain#

Note

Internal API. Names and behaviour may change between releases.

The retained name of a substituted two-carbon chain parent, for the general engine’s chain parent.

“Retained names as preferred IUPAC names” (the Blue Book): “Only the following five

carboxylic acids retained names and are also preferred IUPAC names. All can be functionalized, but only acetic acid, benzoic acid, and oxamic acid can be substituted”; its row ‘:29725’ reads ‘CH3-COOH acetic acid (PIN) ethanoic acid’. (:34750-:34754) ‘CH3-CN acetonitrile (PIN) ethanenitrile’, “with unlimited substitution”; (:32691-:32693) ‘acetamide (PIN)’; (:34964) acetaldehyde “with substitution allowed”. A substituted two-carbon acid, nitrile or aldehyde has ONE substitutable position, so every substituent locant is omitted,:3031: “All locants are omitted for parent compounds when all substitutable hydrogen atoms have the same locant”) and every substituent after the first is enclosed,:7304, ‘bromo(chloro)acetic acid (PIN)’:7312); the amide has two substitutable positions (N and C-2), keeps its locants, and only its parent word changes (‘N-carbamoyl-2- phenylacetamide (PIN)’,:33364). “In some cases, such as acetic acid, alkyl substituents are not allowed as the resulting compound requires a different parent structure” (:7304): a substituent of a two-carbon chain that is the longest chain through its characteristic carbon is never an alkyl group.

The general engine’s chain parent (general_engine._assemble) wrote 2-X-ethanoic acid for every such parent. This module holds the one decision, on the structure side the engine already has; the assembly is composition_primitives.retained_acetic_from_prefixes, the writer the other producers use.

orthonym.assembly.retained_c2_chain.RETAINED_C2_WORD = {'al': 'acetaldehyde', 'amide': 'acetamide', 'hydrazide': 'acetohydrazide', 'nitrile': 'acetonitrile', 'oic acid': 'acetic acid'}#

the retained word of the two-carbon parent, by the suffix the systematic name would carry

orthonym.assembly.retained_c2_chain.is_alkyl_attachment(atom)#

True when atom, the first atom of a substituent, is an acyclic carbon of a hydrocarbon group: no double or triple bond to a heteroatom, so not the carbon of a cyano, carboxy, formyl or acyl group, and not an atom of a ring. An alkyl, alkenyl or alkynyl substituent of a two-carbon chain extends the chain: (the Blue Book) “In some cases, such as acetic acid, alkyl substituents are not allowed as the resulting compound requires a different parent structure”.

orthonym.assembly.retained_c2_chain.retained_c2_name(*, hydride, chain_length, suffix_core, pg_locants, prefix_parts, charged, parent_stereo, alkyl_prefix=False)#

(name, retained word) of a saturated two-carbon chain parent with one suffix group and the substituent prefixes prefix_parts (each ‘locants-prefix’, in alphanumerical order), or None when the systematic name stays: no substituent, a charge, a descriptor of the parent (a bare ‘(R)-’ is written by the other producers; here the systematic spelling cites it with its locant), a second suffix group, or an aldehyde with more than one prefix (their enclosing follows another rule,,:29852).