from typing import OrderedDict


def create_param_dict(param_file_name, outputPrefix):
    """
    Create a dictionary with the parameters and file with posterior density
    :param param_file_name: original parameter file
    :param outputPrefix: prefix given in ABCtoolbox config file for estimation
    :return: param_dict: ordered dict with the parameters and file with posterior density
    """

    param_file = open(param_file_name, "r")
    param_dict = OrderedDict()
    for line in param_file:
        if "=" in line:
            param_dict[line.split("=")[0].strip()] = '{}model0_MarginalPosteriorDensities_Obs0.txt'.format(outputPrefix)
    param_file.close()
    return param_dict