orthonym.assembly.decline_fallback#

Note

Internal API. Names and behaviour may change between releases.

The names tried for a caller’s input only when the drawing as written gets no name.

Each fallback names another reading or drawing of the same compound and ships only what reads back to the input; its label is systematic_verified. A row the drawing as written names is never replaced, so no name or tier of today changes, and the default tier keeps its decline:

  • sulfoxide_drawing: a charge-separated S(IV) oxide, named through its S=O drawing;

  • aziridine_nitrogen: an aziridine nitrogen whose tag RDKit drops, cited in the name of RDKit’s reading.

assembly.halogen_drawing.halogen_drawing_scope (the decorator of the three public naming methods) calls has_fallback() and:func:fallback_row.

orthonym.assembly.decline_fallback.SOURCES = frozenset({'aziridine_nitrogen', 'sulfoxide_drawing'})#

the source of a fallback row

orthonym.assembly.decline_fallback.as_drawn()#

While this block runs,:func:has_fallback is False.

orthonym.assembly.decline_fallback.has_fallback(smiles)#

True for a caller’s SMILES string that a fallback applies to (cheap on any other input), outside:func:as_drawn.

orthonym.assembly.decline_fallback.capped(row, inner)#

row with the lower of its tier and the tier of inner (the row of the other reading or drawing it was built on), and inner’s spelling failures: a fallback never labels a name better than its producer did.

orthonym.assembly.decline_fallback.fallback_row(namer, smiles, written)#

The first fallback row for smiles given the row of the drawing as written, or None (also when a fallback fails: the decline of the drawing as written stands).

orthonym.assembly.decline_fallback.named_or_fallback(namer, kind, fn, smiles, args, kwargs)#

Name smiles as drawn through fn (kind is its name: name, name_tiered or name_with_confidence) and return (True, result) when it is named, or when no fallback gives a name; for a fallback row, (False, row), which the caller turns into the result fn gives (name_tiered returns it). The drawing as written is named once; the fallback runs only after its decline.