import inspect
from pathlib import Path
from backend.app.plan.utils import get_cleaned
from etl.air_source_heat_pump.AirSourceHeatPumpEfficiency import AirSourceHeatPumpEfficiency

file_src = inspect.getfile(lambda: None)
DATA_DIRECTORY = Path(file_src).parent / "local_data" / "all-domestic-certificates"


def app():
    """
    This code reads in the EPC dataset and looks at the efficiency values for heating systems that inclue air source
    heat pumps. This dataset is then used to inform the recommendations for the air source heat pump, so we know
    how to set the simulation
    :return:
    """

    directories = [entry for entry in DATA_DIRECTORY.iterdir() if entry.is_dir()]
    cleaned_lookup = get_cleaned()

    ashp_data_client = AirSourceHeatPumpEfficiency(
        file_directories=directories,
        cleaned_lookup=cleaned_lookup
    )

    ashp_data_client.create_dataset()
