orthonym.data.retained_names#

Note

Internal API. Names and behaviour may change between releases.

Retained (trivial) names that are preferred over systematic names.

These names are recognized by IUPAC as Preferred IUPAC Names (PINs). ALWAYS check this lookup before applying systematic naming rules!

Keys are canonical SMILES, values are retained names.

orthonym.data.retained_names.get_retained_name(canonical_smiles)#

Get retained name for a canonical SMILES if one exists.

a phase + RESEARCH ADDITION 1 root-cause fix: consults the merged ALL_RETAINED_NAMES dict via late binding (avoids circular import at module load time). Resolves 2 function-import consumers in one edit: ring_assemblies.py:296, heterocycles.py:36.

Parameters:

canonical_smiles (str) – Canonical SMILES string (must be canonicalized!)

Returns:

Retained name string, or None if not found

Return type:

str | None

orthonym.data.retained_names.is_retained_name_compound(canonical_smiles)#

Check if compound has a retained name.

a phase + RESEARCH ADDITION 1 root-cause fix: consults merged ALL_RETAINED_NAMES via late binding.

Parameters:

canonical_smiles (str) – Canonical SMILES string

Returns:

True if compound has a retained name

Return type:

bool

orthonym.data.retained_names.add_retained_name(canonical_smiles, name)#

DEPRECATED: prefer orthonym.data.register_retained_name.

a phase + REVIEW root-cause fix: ALL_RETAINED_NAMES is built once at import time (data/__init__.py); runtime mutators must keep the HC dict and the merged dict synchronised so the public get_retained_name lookup sees new entries.

This wrapper updates BOTH the hand-curated RETAINED_NAMES dict (for legacy callers that read it directly) and delegates to register_retained_name (which mutates ALL_RETAINED_NAMES).

Parameters:
  • canonical_smiles (str) – Canonical SMILES string

  • name (str) – Retained IUPAC name