def merge_params(params):
    """
    Build a complete parameter set by merging all parameters in the provided
    list from left to right.
    """

    assert isinstance(params, list), f"params needs to be a list of dicts, got {type(params)}={params}"
    for p in params:
        assert isinstance(p, dict), f"params needs to be a list of dicts, got an element {type(p)}={p}"
    assert len(params) >= 1, f"params must contain at least one dict"

    # merge copies of all the dicts from left to right
    merged = {}
    for p in params:
        merged.update(p)
    return merged