eradiate._mode#

Functions#

eradiate._mode.mode()[source]#

Get current operational mode.

Returns:

Mode or None – Current operational mode.

eradiate._mode.modes(filter=None)[source]#

Get list of registered operational modes.

Parameters:

filter (callable(), optional) – A callable used to filter the returned modes. Operates on a Mode instance.

Returns:

modes (dict[str, Mode]) – List of registered operational modes.

Examples

Return the full list of registered modes:

>>> eradiate.modes()

Return only CKD modes:

>>> eradiate.modes(lambda x: x.is_ckd)
eradiate._mode.set_mode(mode_id)[source]#

Set Eradiate’s operational mode.

This function sets and configures Eradiate’s operational mode. Eradiate’s modes map to Mitsuba’s variants and are used to make contextual decisions when relevant during the translation of a scene to its kernel format.

Valid mode IDs

  • mono: Alias to mono_double

  • ckd: Alias to ckd_double

  • mono_polarized: Alias to mono_polarized_double

  • ckd_polarized: Alias to ckd_polarized_double

  • mono_single: Monochromatic, single-precision

  • mono_polarized_single: Monochromatic, polarized, single-precision

  • mono_double: Monochromatic, double-precision

  • mono_polarized_double: Monochromatic, polarized, double-precision

  • ckd_single: CKD, single-precision

  • ckd_polarized_single: CKD, polarized, single-precision

  • ckd_double: CKD, double-precision

  • ckd_polarized_double: CKD, polarized, double-precision

  • none (no mode selected)

Parameters:

mode_id (str) – Mode to be selected (see list below).

Raises:

ValueErrormode_id does not match any of the known mode identifiers.

eradiate._mode.supported_mode(**kwargs)[source]#

Check whether the current mode has specific features. If not, raise.

Parameters:

kwargs – Keyword arguments passed to Mode.check().

Raises:

UnsupportedModeError – Current mode does not pass the check.

eradiate._mode.unsupported_mode(**kwargs)[source]#

Check whether the current mode has specific features. If so, raise.

Parameters:

kwargs – Keyword arguments passed to Mode.check().

Raises:

UnsupportedModeError – Current mode has the requested flags.

Classes#

Mode(id, spectral_mode, mi_backend, ...)

Data structure describing Eradiate's operational mode and associated ancillary data.

ModeFlag(value)

Flags defining the various possible features associated to an Eradiate mode.

SubtypeDispatcher(type_name[, registry])

This is a very simple factory intended to map mode-specific flags to mode-dependent subtypes.