From b22003d2066b4de6b9d3c1aba9091cc5bf98b09b Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 22 Jan 2024 11:12:06 +0000 Subject: [PATCH] Read in survey list for HA 6 --- .../ha_15_32/ha_analysis_batch_3.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py index 7c28d481..9a95cd21 100644 --- a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py +++ b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py @@ -33,6 +33,9 @@ class DataLoader: }, "ha_6": { "asset_list": {"red": "FFFF0000", "green": "FF00B050"}, + "survey_list": { + "green": "FF92D050", "purple": "FF7030A0", "red": "FFFF0000", "blue": "FF00B0F0" + } }, } @@ -57,6 +60,7 @@ class DataLoader: rows_colors.append(row_color) asset_list = pd.DataFrame(rows_data, columns=sheet_colnames) + asset_list = asset_list.loc[:, asset_list.columns.notnull()] asset_list['row_color'] = rows_colors asset_list_colours = self.COLOUR_CONFIG[ha_name]["asset_list"] @@ -92,20 +96,24 @@ class DataLoader: survey_colors.append(row_color) survey_list = pd.DataFrame(survey_rows, columns=[cell.value for cell in survey_sheet[1]]) + # Remove columns that are None + survey_list = survey_list.loc[:, survey_list.columns.notnull()] survey_list["row_colour"] = survey_colors - survey_list_colours = self.COLOUR_CONFIG[ha_name]["asset_list"] + survey_list_colours = self.COLOUR_CONFIG[ha_name]["survey_list"] # The survey list has 4 possible colours: # PURPLE - Installer advised install complete and a complimentary post works EPC has been completed. # GREEN - Installer advised install complete. # RED - Cancelled + # BLUE - Loft Only Installed # NO FILL - No official update from installer (could be installed or cancelled) survey_list["row_colour_name"] = np.where( survey_list["row_colour"] == survey_list_colours["red"], "red", np.where(survey_list["row_colour"] == survey_list_colours["green"], "green", - np.where(survey_list["row_colour"] == survey_list_colours["purple"], "purple", "yellow")) + np.where(survey_list["row_colour"] == survey_list_colours["purple"], "purple", + np.where(survey_list["row_colour"] == survey_list_colours["blue"], "blue", "no fill"))) ) survey_list["row_meaning"] = np.where( @@ -116,7 +124,11 @@ class DataLoader: np.where( survey_list["row_colour_name"] == "purple", "Installer advised install complete and a complimentary post works EPC has been completed", - "No official update from installer (could be installed or cancelled)" + np.where( + survey_list["row_colour_name"] == "blue", + "Loft Only Installed", + "No official update from installer (could be installed or cancelled)" + ) ) ) )