orthonym.rules.polycyclic_von_baeyer#

Note

Internal API. Names and behaviour may change between releases.

a phase: Von Baeyer naming for tetracyclic and pentacyclic systems.

Replaces the routing helpers at tricyclo.py:556 (_generate_higher_polycyclo_ descriptor) and tricyclo.py:636 (_name_higher_polycyclo_system) with a dedicated module that exposes the cascade-step-6 supplier a phase reserved as a stub. bicyclo.py and tricyclo.py REMAIN authoritative for their proven 2-ring and 3-ring cases per internal notes.

Audit verdict (internal notes-A.md): THIN_WRAPPER. The existing src/orthonym/rules/polycyclic.py::VonBaeyerAnalyzer (2,537 LOC, runs ..) produces structurally and chemically correct / descriptors for every Blue Book example audited. Round-trip via OPSIN yields InChI L1 == input on every named in-scope row. Coverage invariant (cascade-step-6 gate) holds without modification.

This module therefore wraps VonBaeyerAnalyzer rather than re-implementing.

IUPAC Reference: Blue Book 2013 (tricyclic and higher), (numbering cascade), (heteroatom ‘a’-prefix replacement).

Source:
  • internal notes (,,,,,,).

  • internal notes §”Existing Code Audit”, §”Risk Landmines”.

  • internal notes verdict THIN_WRAPPER.

  • internal notes (symmetric-ring locant generation), (hybrid dictionary + algorithmic).

Naming-collision note (internal notes deviation; RESEARCH Q-01):

The cascade-step-6 supplier here is named get_higher_polycyclo_iupac_locants — distinct from polycyclics.py:386::get_polycyclic_iupac_locants(mol, pah_name) which serves cataloged PAHs by name lookup. The two functions have different signatures and different responsibilities. The literal internal notes identifier (get_polycyclic_iupac_locants) was renamed here to prevent an obscure import-shadowing bug.

orthonym.rules.polycyclic_von_baeyer.get_higher_polycyclo_iupac_locants(mol)#

Cascade-step-6 IUPAC locant supplier for VB ≥4-ring systems.

Returns Optional[Dict[atom_idx -> int | (int, str)]] covering ALL ring atoms, or None if the predicate fails / coverage is partial. Partial maps are NEVER returned — a phase / Pitfall 7 gate.

Naming note (internal notes deviation; RESEARCH Q-01):

Distinct from polycyclics.py::get_polycyclic_iupac_locants which serves cataloged PAHs by pah_name lookup. This function is the a phase cascade-step-6 supplier for non-cataloged ≥4-ring bridged systems where retained-name passthrough did not match.

orthonym.rules.polycyclic_von_baeyer.is_higher_polycyclo(mol)#

Return True iff mol is a Von Baeyer ≥4-ring system handled here.

Predicate (per internal notes + RESEARCH “Risk Landmines”):
  • mol is not None

  • ≥4 SSSR rings

  • single connected ring system (perception.rings.get_ring_systems)

  • ≥2 bridgeheads (atoms in ≥2 rings)

  • no spiro atoms (spiro routes via spiro.py — Plan 151-02)

  • no aromatic ring atoms (PAHs route via polycyclics.py)

  • detect_natural_product(mol) is None (steroids/alkaloids stay retained — natural-product backbone short-circuit)

  • classify_bridged_system(mol) NOT in (‘bicyclo’, ‘tricyclo’) (anti-canary — bicyclo.py / tricyclo.py retain authority)

Returns False on any failed gate. Defensive: returns False on None input rather than raising.

orthonym.rules.polycyclic_von_baeyer.name_higher_polycyclo(mol)#

Generate the IUPAC name for a Von Baeyer ≥4-ring system.

Algorithm (internal notes, AUTONOM):
  1. Retained-name dictionary lookup FIRST. tricyclo.get_retained_ tricyclo_name is consulted on the canonical SMILES regardless of ring count — adamantane / twistane stay retained.

  2. If no retained name AND is_higher_polycyclo(mol), delegate to VonBaeyerAnalyzer.analyze for descriptor + numbering. Append the parent alkane name. If heteroatoms are present, build the ‘a’-prefix via tricyclo._generate_heteroatom_prefix using the analyzer’s numbering map.

  3. Otherwise return None (defer to bicyclo.py / tricyclo.py / polycyclics.py).