Skip to main content

resolve_batch

Function
This function is defined in the param_resolver module.
Resolve multiple parameters in a single batch call for performance. This reduces function call overhead by processing all parameters together instead of making 11+ separate resolve() calls.

Signature

def resolve_batch(params: dict, presets_map: dict, config_classes: dict, defaults: dict) -> dict

Parameters

params
dict
required
Dict of {param_name: value} to resolve
presets_map
dict
required
Dict of {param_name: presets_dict}
config_classes
dict
required
Dict of {param_name: config_class}
defaults
dict
Dict of {param_name: default_value}

Returns

Returns
dict
resolved_value}

Usage

results = resolve_batch(
        params={
            'output': 'silent',
            'execution': None,
            'memory': True,
        },
        presets_map={
            'output': OUTPUT_PRESETS,
            'execution': EXECUTION_PRESETS,
            'memory': MEMORY_PRESETS,
        },
        config_classes={
            'output': OutputConfig,
            'execution': ExecutionConfig,
            'memory': MemoryConfig,
        },
        defaults={
            'output': OutputConfig(),
            'execution': ExecutionConfig(),
            'memory': None,
        }
    )