orthonym.rules.organometallics#
Note
Internal API. Names and behaviour may change between releases.
IUPAC organometallic seniority + naming rules (a phase).
- This module defines ORGM-specific seniority cascade SEPARATE from the
carbon-organic seniority in src/orthonym/rules/seniority.py per
internal notes hard invariant (ZERO edits to seniority.py).
The two cascades NEVER share data structures; the only common file is src/orthonym/data/organometallics.py (NEW; ORGM-exclusive).
Anti-patterns to avoid (PATTERNS lines 256-259): - forbids any import path pointing at rules/seniority (relative
..rules dot-seniority or absolute orthonym dot rules dot seniority); this enforces ZERO cross-contamination with the carbon-organic seniority cascade. The grep gate in Plan-02 task 02-03 asserts neither import line exists in this module.
NEVER add ORGM entries to the existing SENIORITY_ORDER list in seniority.py — define a NEW ORGM_LIGAND_ORDER in this file instead.
NEVER call name_compound(…) recursively from assemble_organometallic_name(…) — recursion path is OUTER CFR → handler → rules → data; no upward call.
a phase (first scope-expansion phase per -07).
- orthonym.rules.organometallics.select_ligand_naming(ligand_group, hapticity, style='pin')#
Generate the IUPAC name for a single ligand with η-notation.
STUB BODY (Plan-02): returns empty string. Plan-03 implements per RESEARCH + AUDIT SMARTS catalog.
Algorithm (Plan-03 implementation): 1. Look up ligand_group.ligand_canonical_smiles in LIGAND_NAMES. 2. If hapticity > 1 OR ligand in LIGAND_ETA_DEFAULTS: prefix η<N>-. 3. Apply multiplicative prefix (bis-, tris-, etc.) per outer caller.
- orthonym.rules.organometallics.assemble_organometallic_name(metal_complex, mol, style='pin')#
Assemble systematic IUPAC name for a metal complex per Salzer 1999
Plan-03 implementation: Tier-1 Cp2 metallocene branch (commit 03-01). Subsequent commits 03-02/03/04 add Tier-3/2/4 branches.
Returns: (full_name, metal_name_part, ligand_tree_nodes) per RESEARCH lines 799-815. The handler wraps this in NameTreeNode.
Returns None to signal cascade-continuation when: - metal_complex.is_multimetal (a phase deferred per Risk R-08) - Stock-notation lookup fails for the (metal, ligand_class) tuple - The compound’s topology doesn’t match any tier branch yet