import json


def load_ee_params(filepath):
    """
    Loads parameters for a posteriori error estimation for the PINN from the json file provided via param filepath.

    returns 
    - K: as used for trapezoidal rule
    - mu: smoothing parameter for delta function
    - L_f: Lipschitz constant or spectral abscissa
    - delta_mean: average deviation of approximated ODE/PDE from target ODE/PDE
    """
    with open(filepath, "r") as jsonfile:
        data = json.load(jsonfile)
        jsonfile.close()

    return float(data['K']), float(data['mu']), float(data['L_f']), float(data['delta_mean'])