orthonym.assembly.pin_first#

Note

Internal API. Names and behaviour may change between releases.

A wider tier gives the PIN tier’s name for a molecule its own naming names in a lower class.

The default of the PIN style is a cascade (user decision 2026-10-25): the PIN, then a valid, a complete and a best-effort name. The wider tiers name the molecule in one pass of their own, with the breadth producers in it, so a producer of a wider tier can name the molecule in a lower class where the PIN tier builds the PIN. A ring parent of the ring cascade cites a principal characteristic group that sits on no ring as a prefix: ‘4-[(1Z)-2-formamidoethen-1-yl]phenol’ for ‘N-[(Z)-2-(4-hydroxyphenyl)ethenyl]formamide’: the parent has the maximum number of principal characteristic groups; the amide is senior to the alcohol,.

Asking the PIN tier for every molecule is no option: it costs 39 % to 78 % more time on the evaluation sets, most of it on the molecules the PIN tier declines. The producer that names a molecule in such a lower class notes it (note_pin_tier_asked()), and only such a molecule is named by the PIN tier (default_tier_engine, the engine of the strict twin) after the wider naming. The PIN tier’s row is taken when it is pin_verified and its own string read back (opsin verified). A PIN that only a twin spelling verifies (verified_twin: ‘propane-1,2-diyl… diester’ names, ‘methanaminiumyl’) is not taken: the wider tiers ship the name OPSIN reads (user decision 2026-10-22, “Best-effort ships readable”). Every other molecule keeps the wider tier’s name.

pin_tier_checked() is the step at the three entry points (name, name_tiered, name_with_confidence). The outermost one watches the naming; the entry points it calls on the way run as before. The PIN tier’s naming runs in a copy of the context, so nothing it records reaches the wider naming’s state.

orthonym.assembly.pin_first.note_pin_tier_asked()#

A producer of a wider tier named the whole molecule in a lower class than the PIN tier may (see the module docstring): the outermost entry point asks the PIN tier for its name.

orthonym.assembly.pin_first.note_final_floor_name(final_floor, smiles)#

The late recovery of a wider tier names the whole molecule with the last-resort floor of the best-effort engine (t4_coverage._final_floor_candidate, every rung of the engine having declined): final_floor is True. The floor spells an azanium cation on the ring that carries the least (‘1-{[…azaniumyl…]amino}-2,3-dimethyl- cyclohexane’), where the PIN tier names the cation SENIORITY ORDER FOR CLASSES, Table 4.1: cations, class 6, are senior to amides, class 11; Cationic centers on characteristic groups: “the largest neutral parent possible is used”). Asks the PIN tier, as:func:note_pin_tier_asked, in the naming of the whole molecule, when the molecule carries a nitrogen cation (has_nitrogen_cation(), the class this was built for; any other final-floor name keeps the wider tier’s name) and the tier is valid or complete: at best-effort the ask has no target (the main path’s PIN promotion gives the PIN there) and doubled the time of the rows it fired on.

orthonym.assembly.pin_first.has_nitrogen_cation(mol)#

True when mol has a nitrogen atom with a formal positive charge that no atom of opposite charge is bonded to: an azanium, ammonium or pyridinium centre. A nitro group, an N-oxide, an azide or a diazo group draws its nitrogen charge-separated, and the molecule is no cation.

orthonym.assembly.pin_first.pin_tier_checked(namer, smiles, run, pick)#

run, the wider tier’s naming of smiles; when a producer asked for the PIN tier in it (note_pin_tier_asked()) and the PIN tier names the molecule with a PIN read back directly, pick(row) of that row instead (unless pick gives None). Inside an outer entry point, and for every naming the module does not apply to, run alone.

orthonym.assembly.pin_first.pin_tier_confidence(namer, smiles, row)#

The record of name_with_confidence for the PIN tier’s row row: the PIN tier’s own record, with the row’s label (None, the wider tier’s record stands, when the record names the molecule otherwise).