orthonym.tiers#

Note

Internal API. Names and behaviour may change between releases.

The emit tiers and the default tier: one home for the table that maps a tier to the engine switches.

pin is the PIN-only tier: a name only when the strict path for the Preferred IUPAC Name built it and OPSIN read it back (the default tier of releases up to 1.0.x). valid, complete, best-effort and full-coverage name more molecules with producers that are not the strict path.

The default of name_compound, of the orthonym command and of --batch is the best-effort tier, as it runs when it is asked for by name: one pass, the strict PIN path first among its producers and the other producers after it. Without OPSIN to read the names back (the reduced mode of a host without Java, and the raw-output switches) the default stays the PIN-only tier, because a wider tier ships only names that read back. --emit-tier pin and emit_tier="pin" give the PIN-only tier.

orthonym.tiers.EMIT_TIERS = ('pin', 'valid', 'complete', 'best-effort', 'full-coverage')#

the tiers a caller can ask for by name, narrowest first

orthonym.tiers.DEFAULT_TIER = 'best-effort'#

the tier of the default when OPSIN reads the names back

orthonym.tiers.check_emit_tier(emit_tier)#

emit_tier itself, or ValueError when it is not None or one of:data:EMIT_TIERS.

orthonym.tiers.emit_tier_flags(emit_tier)#

Map an --emit-tier value to the engine switches (Orthonym keyword arguments).

Single source of truth for the tier -> switch contract; cli._emit_tier_flags and name_compound read it, and tests/unit/test_emit_tier_flags.py pins it.

Invariant table (0-wrong-critical):

pin -> gf=F, gfu=F, aag=F (PIN-or-abstain: the default tier of releases up to 1.0.x) valid -> gf=T, gfu=F, aag=F (round-trip-verified general-engine names) complete -> gf=T, gfu=F, aag=T (round-trip-verified aggressive aromatic/hetero names) best-effort -> gf=T, gfu=T, aag=T (complete’s production plus the OPSIN-unverified opt-in)

general_fallback_unverified (gfu) is the UNIQUE best-effort discriminator; allow_aromatic_general (aag) is True for BOTH complete and best-effort, so best-effort candidate production is a superset of complete’s. full-coverage is best-effort’s switches plus its own full_coverage marker bit (the opt-in that arms the general coordination-additive namer); the key is present (False) on every other tier, so a consumer can always read it.

orthonym.tiers.verification_active()#

Whether the names of a call are read back by OPSIN: the jar is there and the validity gate is not switched off (the raw-output switches, and the reduced mode of a host without Java).

orthonym.tiers.default_tier(style='pin')#

The tier the default names: best-effort for the PIN style when OPSIN reads the names back, else pin (--style general and cas keep the names they gave).

orthonym.tiers.default_flags(style='pin')#

The engine switches of the default (default_tier()).

orthonym.tiers.resolve_switches(style, emit_tier, general_fallback=None, general_fallback_unverified=None, allow_aromatic_general=None, full_coverage=None, *, own_call=False)#

The four engine switches (general_fallback, general_fallback_unverified, allow_aromatic_general, full_coverage) for a call of name_compound.

emit_tier None leaves the switches as given, except for the caller’s own call (own_call: no name runs above it) with none of them given, which is the default (default_flags()). A tier and a switch given together is a ValueError.

orthonym.tiers.tier_label_of(namer, name, smiles)#

The tier label (pin_verified…) of the name a call of namer returned, or None for no name: the row derived from the provenance of the call as name_tiered derives it right after name.

orthonym.tiers.is_wider(namer)#

Whether namer runs a tier above the PIN-only one.