mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
51 lines
1.8 KiB
Python
51 lines
1.8 KiB
Python
import pytest
|
|
import pandas as pd
|
|
from utils.s3 import read_csv_from_s3
|
|
from backend.Funding import Funding
|
|
|
|
|
|
def get_funding_data():
|
|
"""
|
|
This function retrieves the eco project scores matrix and the warm homes local grant funding data
|
|
:return:
|
|
"""
|
|
project_scores_matrix = read_csv_from_s3(
|
|
bucket_name="retrofit-data-dev",
|
|
filepath="funding/ECO4 Full Project Scores Matrix.csv",
|
|
)
|
|
project_scores_matrix = pd.DataFrame(project_scores_matrix)
|
|
project_scores_matrix.columns = ['Floor Area Segment', 'Starting Band', 'Finishing Band', 'Cost Savings']
|
|
project_scores_matrix["Cost Savings"] = project_scores_matrix["Cost Savings"].astype(float)
|
|
|
|
whlg_eligible_postcodes = read_csv_from_s3(
|
|
bucket_name="retrofit-data-dev",
|
|
filepath="funding/whlg eligible postcodes.csv",
|
|
)
|
|
whlg_eligible_postcodes = pd.DataFrame(whlg_eligible_postcodes)
|
|
|
|
return project_scores_matrix, whlg_eligible_postcodes
|
|
|
|
# class TestFunding:
|
|
#
|
|
# def test_prs(self):
|
|
# eco_project_scores_matrix, whlg_eligible_postcodes = get_funding_data()
|
|
# funding = Funding(
|
|
# project_scores_matrix=eco_project_scores_matrix,
|
|
# whlg_eligible_postcodes=whlg_eligible_postcodes,
|
|
# social_cavity_abs_rate=13.5,
|
|
# social_solid_abs_rate=17,
|
|
# private_cavity_abs_rate=13.5,
|
|
# private_solid_abs_rate=17,
|
|
# tenure="Private",
|
|
# )
|
|
#
|
|
# measures_1 = ["internal_wall_insulation", "solar_pv"]
|
|
# funding.check_funding(
|
|
# measures=measures_1,
|
|
# starting_sap=54,
|
|
# ending_sap=69,
|
|
# floor_area=73,
|
|
# mainheat_description="Boiler and radiators, mains gas",
|
|
# heating_control_description="Programmer, room thermostat and TRVs",
|
|
# is_cavity=True
|
|
# )
|