orthonym.rules.isotope_memos#
Note
Internal API. Names and behaviour may change between releases.
The memos of the isotope decorator (rules/isotopes.py): one read-back per candidate and one skeleton naming per
engine and state, within one top-level naming (assembly.memo, assembly.nested_memo; ORTHONYM_MEMO=verify
computes again and compares).
- orthonym.rules.isotope_memos.round_trips_memoised(candidate_name, original_mol, stereo_blind=False)#
isotopes._isotope_round_trips_once(), once per top-level naming for the same candidate, structure and reading state. The placement search of the decorator reads one candidate again and again (a labelled mixture of 2026-11-11: 27,512 read-backs, 5,354 distinct, 132 s). The key holds everything the check reads besides its arguments: the radical reading, the tier’s spelling (the twin parse) and the tautomer pass; a hit replays the two records the check makes (a bond-shift isomer refused, a tautomer refused).ORTHONYM_MEMO=verifychecks again and compares.
- orthonym.rules.isotope_memos.skeleton_naming_key(naming, smiles)#
The key of one skeleton naming: the SMILES, the engine’s style and switches, the ambient naming state of
nested_memo.renaming_state/ambient_naming_stateand ofadducts._naming_context, and the value of every other context variable that is not an output (_SKELETON_KEY_OUTPUT_VARS; a molecule as its isomeric SMILES with isotopes), so a hit is served only for a naming in the same state. The engine enters by its scalar attributes only: its one set-valued switch,_excluded_dispatch_classes, is set again by every.name(namer.py), so it carries nothing from one naming to the next. A value without a hash enters by itsrepr(the tautomer pass names molecules by address), which costs hits, never a wrong one.
- orthonym.rules.isotope_memos.skeleton_naming_memoised(naming, smiles)#
naming.name(smiles), once per top-level naming for the same skeleton, engine and state (skeleton_naming_key()): the passes of the decorator (as drawn, the induced centres unspecified, each with a tautomer reading, a scope composer, then the phane and hydro retries) name one skeleton up to a dozen times in one state (a labelled mixture of 2026-11-11: 12 namings, 4 states, 150 s of 238 s in the repeats). A hit returns the stored name and replays the provenance the naming recorded (nested_memo.cached_nested_call); a trip is never stored;ORTHONYM_MEMO=verifynames again and compares.
- orthonym.rules.isotope_memos.skeleton_names_noted()#
Note, in the list it yields, every skeleton name:func:skeleton_naming_memoised returns inside the block.
- orthonym.rules.isotope_memos.carry_skeleton_labels(name, skeletons)#
Record
namebelow the PIN when the skeleton name it is built on holds a non-PIN record (a label-only record, a non-PIN fragment or an uncertified PIN-form name,metrics.provenance), and returnname. (the Blue Book, “The name of an isotopically substituted compound is formed by adding or inserting the nuclide symbol(s)… before the part of the compound that is isotopically substituted”): the name of the labelled compound is the name of the unlabelled one with the descriptor, so it is the PIN only when that name is; the recorded substring does not survive the descriptor (‘2-[(4-oxo-4H-1-benzopyran-2-yl)methyl]-2,3-dihydro(3,3-2H2)- 4H-1-benzopyran-4-one’). Only a skeleton thatnamereads as once its descriptors are taken out counts (a skeleton the pass named and did not build on carries nothing over); none matching, nothing is recorded.