mpylab.env.config_view module

Deterministic, read-only views of effective measurement configurations.

class mpylab.env.config_view.ConfigViewNode(key: str, value: str, source: str | None, children: tuple[ConfigViewNode, ...] = ())

Bases: object

One node in a read-only configuration tree.

Parameters:
  • key (str) – Display name of the mapping key or sequence index.

  • value (str) – Stable scalar value or container summary.

  • source (str or None) – Last configuration source attributed to the value.

  • children (tuple of ConfigViewNode) – Nested mapping or sequence values.

children: tuple[ConfigViewNode, ...] = ()
key: str
source: str | None
value: str
mpylab.env.config_view.build_config_view(config, trace=None)

Build a deterministic tree for an effective configuration.

Parameters:
  • config (mapping) – Effective measurement configuration.

  • trace (ConfigTrace or None, optional) – Source provenance used for the final column.

Returns:

Root nodes sorted by their display keys.

Return type:

tuple of ConfigViewNode

Raises:

TypeError – If config is not a mapping or trace has an incompatible type.

mpylab.env.config_view.format_config_value(value)

Return a deterministic text representation for a configuration value.

Parameters:

value (object) – Scalar configuration value.

Returns:

Stable, human-readable text without object memory addresses.

Return type:

str

mpylab.env.config_view.format_effective_config(config, trace=None)

Format an effective configuration and its provenance as plain text.

Parameters:
  • config (mapping) – Effective measurement configuration.

  • trace (ConfigTrace or None, optional) – Source provenance displayed for scalar values.

Returns:

Deterministic multi-line representation suitable for terminals.

Return type:

str