from typing import Dict
from typing import Union
import json
import logging


def load_json_params(param_fname: str, **kwargs) -> Dict[str, Union[int, float, str]]:
    """Load in the param_fname, overriding with given kwargs"""
    with open(param_fname) as source:
        params = json.load(source)
    for k, v in kwargs.items():
        if k not in params:
            logging.warning(f"Key {k} not in original parameters")
        params[k] = v
    return params