orthonym.rules.group_prefixes#

Note

Internal API. Names and behaviour may change between releases.

The prefix names that the substitutive path offers for one group of a molecule, best first.

No namer of a substituent group is right for every group: name_substituent_fragment names a group on a carbon well and a group on a nitrogen by a carbon-count (‘amino-N-methylmethyl’ for dimethylamino) or drops a C=S (‘(4-methoxyanilino)(sulfanyl)methyl’ for the group of a thioamide); the ring-substituent chokepoint of the ligands of a centre (centre_ligands) names a ring group and a ring ‘-ylidene’ that the first one declines and spells the marks of a compound prefix (‘bis[…]’) that the universal substituent namer of the best-effort tier (‘di[…]’) does not; that namer names the rest in a systematic form. A producer that had its own order before (the azanide of two groups: the first namer, the universal one, then the ligand one) keeps it (ligand_first). The producers of an ion that is named by its groups offer each candidate to the read-back of the name they build (the full InChIKey of the input) and ship the first that reads back; a name that reads back is the name of the input, so no candidate can ship a wrong structure.

orthonym.rules.group_prefixes.group_prefix_candidates(mol, atoms, attach, free_valence_suffix=None, parent_atoms=(), ligand_first=True)#

The distinct, non-empty prefix names of the group atoms attached to its parent through attach, in the order of the namers above. free_valence_suffix (‘yl’, ‘ylidene’) keeps the names that end with it, ‘yl’ not the ‘-ylidene’ and ‘-ylidyne’ ones.

orthonym.rules.group_prefixes.combinations(candidates, limit=12)#

The choices of one candidate for each group, the first candidates first, at most limit of them.

orthonym.rules.group_prefixes.first_name_that_reads_back(mol, names, record=True)#

The first of names that reads back to the full InChIKey of mol (charges and protonation site included), the stereo of the input composed onto it when a group cites no descriptor of its own, and recorded as no PIN (record: a memoised producer records the name each time it hands it out, not when it makes it); ‘’ when none does. names may be a generator: a candidate is built when it is asked for.

orthonym.rules.group_prefixes.tier_key()#

The tiers a call runs in (centre_ligands._breadth_contexts): the candidates of a group depend on them, so the memo of a producer that is asked twice for one molecule is keyed by them.