Modifiers

class code_generation.modifiers.EraModifier(modifier_dict, default=None)[source]

A Era Modifier is a Modifier, that modifies the configuration based on the given era

Parameters:
  • modifier_dict (ModifierDict) – A dict containing the information, how a parameter should be modified based on the sample.

  • default (Union[str, int, float, bool, Dict, None]) – If set, the default is used for all sample not specified in the modifier dict. Defaults to None.

apply(era)[source]

Applies the modifier to the given era.

Parameters:

era (str) – The era to apply the modifier to

Returns:

A modified configuration

Return type:

List[str | int | float | bool] | Dict[str, str | int | float | bool] | List[Dict[str, str | int | float | bool]] | str | int | float | bool | None

class code_generation.modifiers.Modifier(modifier_dict)[source]

Genric Modifier class.

Parameters:

modifier_dict (ModifierDict) – Dict of parameters to be modified.

class code_generation.modifiers.SampleModifier(modifier_dict, default=None)[source]

A Sample Modifier is a Modifier, that modifies the configuration based on the given sample

Parameters:
  • modifier_dict (ModifierDict) – A dict containing the information, how a parameter should be modified based on the sample.

  • default (Union[str, int, float, bool, Dict, None]) – If set, the default is used for all sample not specified in the modifier dict. Defaults to None.

apply(sample)[source]

Applies the modifier to the given sample.

Parameters:

sample (str) – The sample to apply the modifier to

Returns:

A modified configuration

Return type:

List[str | int | float | bool] | Dict[str, str | int | float | bool] | List[Dict[str, str | int | float | bool]] | str | int | float | bool | None