genome_spy.data_transformers.DataTransformerSettings

class genome_spy.data_transformers.DataTransformerSettingsView on GitHub

Bases: object

Control whether exported charts share repeated inline tables.

Description:

Consolidation is enabled by default. This settings object supports dataset consolidation only, not a registry of transformer plugins.

Example

>>> with data_transformers.enable(consolidate_datasets=False):
...     spec = chart.to_dict()

Methods

enable(*[, consolidate_datasets])

Apply a setting, optionally restoring it after a with block.

Attributes

consolidate_datasets

Whether eligible inline tables become shared named datasets.

property consolidate_datasetsView on GitHub

Whether eligible inline tables become shared named datasets.

enable(*, consolidate_datasets=Undefined)View on GitHub

Apply a setting, optionally restoring it after a with block.

Description:

The change takes effect immediately. When used as a context manager, the previous value is restored even if the block raises an error.

Parameters:

consolidate_datasets – Whether to share eligible inline tables. Omit to keep the current setting.

Returns:

A context manager that restores the previous setting.

Raises:

TypeError – If the setting is not a boolean.

Example

>>> with data_transformers.enable(consolidate_datasets=False):
...     spec = chart.to_dict()