torchcell.datamodels.compound_identity.resolve_compound_identity

resolve_compound_identity(name: str | None = None, pubchem_cid: int | None = None, known_proprietary: bool = False) → CompoundIdentityResolution[source]

Resolve a compound identity from the pinned table – pure, offline.

Looks up by normalized name (matching a row’s canonical name OR any of its synonyms) first, then by pubchem_cid. A matched row’s own resolution_status is authoritative, so a mixture comes back as RESOLVED_MIXTURE carrying ChEBI/CID and no InChIKey, and a vendor code comes back PROPRIETARY with the reason it is terminal. With no row at all the answer is PROPRIETARY when the caller knows the label is a vendor code, else UNRESOLVED_PUBLIC. NEVER guesses a structure from a near-miss name.