spinedb_api.filters.value_transformer

Provides a database query manipulator that applies mathematical transformations to parameter values.

Module Contents

Functions

apply_value_transform_to_parameter_value_sq(db_map, ...)

Applies renaming to parameter definition subquery.

value_transformer_config(instructions)

Creates a config dict for transformer.

value_transformer_from_dict(db_map, config)

Applies value transformer manipulator to given database map.

value_transformer_config_to_shorthand(config)

Makes a shorthand string from transformer configuration.

value_transformer_shorthand_to_config(shorthand)

Makes configuration dictionary out of a shorthand string.

spinedb_api.filters.value_transformer.apply_value_transform_to_parameter_value_sq(db_map, instructions)[source]

Applies renaming to parameter definition subquery.

Parameters:
  • db_map (DatabaseMapping) – a database map

  • instructions (dict) – mapping from entity class name to mapping from parameter name to list of instructions

spinedb_api.filters.value_transformer.value_transformer_config(instructions)[source]

Creates a config dict for transformer.

Parameters:

instructions (dict) – mapping from entity class name to mapping from parameter name to list of instructions

Returns:

transformer configuration

Return type:

dict

spinedb_api.filters.value_transformer.value_transformer_from_dict(db_map, config)[source]

Applies value transformer manipulator to given database map.

Parameters:
spinedb_api.filters.value_transformer.value_transformer_config_to_shorthand(config)[source]

Makes a shorthand string from transformer configuration.

Parameters:

config (dict) – transformer configuration

Returns:

a shorthand string

Return type:

str

spinedb_api.filters.value_transformer.value_transformer_shorthand_to_config(shorthand)[source]

Makes configuration dictionary out of a shorthand string.

Parameters:

shorthand (str) – a shorthand string

Returns:

value transformer configuration

Return type:

dict