from pathlib import Path
import json


def read_parameters(parameters_file: Path):
    """This function reads the config file containing the parameters needed for filtering datasets."""
    if parameters_file.exists():
        with open(parameters_file) as fout:
            parameters = json.load(fout)
    else:
        raise FileNotFoundError(f"Config file {parameters_file.as_posix()} does not exist.")
    return parameters