orthonym.rules.lambda_convention#
Note
Internal API. Names and behaviour may change between releases.
Shared λ-convention (lambda) infrastructure — IUPAC / Table 2.8.
The λ-convention cites the non-standard bonding number of a skeletal atom
immediately after its locant, e.g. a tetravalent ring sulfur at locant 4 ->
4lambda4-thia (4lambda4-thiaspiro[3.5]nonane), or a hexavalent sulfur
mononuclear hydride -> hexafluoro-lambda6-sulfane (SF6).
This module is the single source of truth for the standard-bonding-number table
and the “is this valence non-standard?” decision. It was promoted verbatim from
rules/spiro.py so that the spiro numberer, the acyclic
skeletal-replacement namer, and the mononuclear-hydride / chalcogen /
halogen namers all share one fail-closed implementation rather than each
re-deriving Table 2.8.
References
IUPAC 2013 Blue Book, /3 (standard / nonstandard bonding number) IUPAC 2013 Blue Book, (λ placement: after the locant, no hyphen) IUPAC 2013 Blue Book, Table 1.5 (standard bonding numbers) [BBv2:6436] IUPAC 2013 Blue Book, (λ in chains / replacement nomenclature) IUPAC 2013 Blue Book, / (mononuclear hydrides bearing λ)
Fail-closed contract: a λ is emitted ONLY for a neutral atom present in
STANDARD_BONDING_NUMBER whose actual valence differs from its standard
value. Charged atoms and elements absent from the table are treated as standard
(no spurious λ — never invent a descriptor the namer cannot justify).
- orthonym.rules.lambda_convention.nonstandard_bonding_number(mol, atom_idx)#
Return the lambda bonding number for a skeletal atom whose valence is non-standard, or None when the valence is standard.
The bonding number is the total count of skeletal/H bonds (RDKit
GetTotalValence). It is emitted aslambda<n>immediately after the atom’s locant in the ‘a’-replacement prefix, e.g. a tetravalent ring sulfur at locant 4 ->4lambda4-thiaspiro example4lambda4-thiaspiro[3.5]nonane), or on a mononuclear hydride parent (no locant) ->hexafluoro-lambda6-sulfane(SF6, /.Fail-closed: only neutral atoms present in
STANDARD_BONDING_NUMBERcan carry a lambda; charged/exotic atoms return None (no spurious lambda).
- orthonym.rules.lambda_convention.format_lambda_token(locant, lam)#
Format a locant (+ optional lambda) into the citation token.
format_lambda_token(4, 4)->"4λ4": the lambda follows the locant with no separator);format_lambda_token(4, None)->"4". Shared by the spiro numberer and the acyclic skeletal-replacement namer so the on-the-wire spelling is identical everywhere.