from pathlib import Path
import yaml


def load_plot_these_methods_config(path):
    """
    Loads PLOT_THESE_METHODS.yaml present at `path`.

    Args:
        path (str): path where config files can be found.

    Returns:
        (set): a set of method that needs to be plotted. an empty set if the file is not found. 
    """
    include_methods = Path(path).resolve() / "PLOT_THESE_METHODS.yaml"
    if include_methods.exists():
        with open(str(include_methods), "rb") as f:
            plot_these_methods = yaml.safe_load(f)
        return set([x for x, plot in plot_these_methods.items() if plot])

    return {}