orthonym.rules.acid_halides#
Note
Internal API. Names and behaviour may change between releases.
Acid halide naming using IUPAC functional class nomenclature.
- Acid halides use two-word “functional class” naming:
{acyl name} {halide word}
Examples
CC(=O)Cl -> acetyl chloride (retained acyl name for C2) CCC(=O)Cl -> propanoyl chloride O=C(Cl)c1ccccc1 -> benzoyl chloride (retained acyl name for benzene) ClC(=O)CCCC(=O)Cl -> pentanedioyl dichloride (diacid halide)
- The acyl name derives from the corresponding acid:
ethanoic acid -> ethanoyl (systematic) acetic acid -> acetyl (retained, preferred for C2) formic acid -> formyl (retained, preferred for C1) benzoic acid -> benzoyl (retained, preferred for benzene-attached)
Reference: IUPAC 2013 Blue Book, (Acyl halides)
- orthonym.rules.acid_halides.name_carbonic_monoester_acyl_halide(mol, match, halide_word)#
/: X-C(=O)-O-R -> ‘<R> carbono<halide>idate’.
matchis the acyl-halide SMARTS tuple (carbonyl C, carbonyl O, halide). Returns None (fail-closed) unless the carbonyl C is a genuine carbonic-acid mono-ester acyl halide: exactly one =O, one halide, one single-bonded ester O leading to a fully nameable R group, and NO carbon neighbour on the carbonyl. R is named with the universal substituent namer (benzyl, ethyl).
- orthonym.rules.acid_halides.name_imidoyl_thioyl_halide(features)#
: R-C(=NH)-X / R-C(=S)-X / R-C(=Se)-X -> the two-word functional class ‘{parent}carbo{imidoyl|thioyl|selenoyl} {halide}’ (ring parent) or ‘{chain-stem}{imidoyl|thioyl|selenoyl} {halide}’ (chain parent).
BB 31438 ‘cyclohexanecarboximidoyl chloride (PIN)’, 31442 ‘cyclohexane- carbothioyl chloride (PIN)’. Handles a bare cycloalkane ring parent or a bare unbranched alkyl chain parent; fails closed (None -> abstain) on an aromatic ring, a branch, any extra heteroatom/substituent, or an unknown parent, so a less-certain case degrades to abstention rather than a guessed name. Determinism: single SMARTS match, deterministic parent walk. Pure.
- orthonym.rules.acid_halides.name_acid_halide(features, scope_out=None)#
Name an acid halide compound using functional class nomenclature.
Produces two-word names: “{acyl name} {halide word}”
- Parameters:
features – MolecularFeatures with principal_group set to an acid halide type.
scope_out (dict | None) – Optional dict the caller owns. This function records
scope_out['parent_scope'] = 'chain' | 'ring'for the branch it actually took, or leaves it absent when the parent is neither (or is not provablyfeatures.principal_chain). Only the branch that picks the parent can know this – measured that it cannot be recovered downstream fromfeatures.principal_chainorfeatures.chain_is_parent, both of which report “chain” on ring-parented names. Consumed byhandlers.acid_halideto tell_inject_stereo_if_missingwhich numbering a front-of-name stereodescriptor block is read in, the Blue Book “NAMING OF STEREOISOMERS”, deciding sentence:44643).
- Returns:
IUPAC name string, or None if not an acid halide.
- Return type:
str | None
- orthonym.rules.acid_halides.get_acid_halide_consumed_atoms(functional_groups)#
Get the set of atom indices consumed by acid halide groups.
These atoms should be filtered from halogen FG detection to prevent double-counting (e.g., Cl appearing as both “oyl chloride” and “chloro”).
- Parameters:
functional_groups (Dict) – Dict from detect_functional_groups.
- Returns:
Set of atom indices consumed by acid halide groups.
- Return type:
set