mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Read in survey list for HA 6
This commit is contained in:
parent
01a4628d20
commit
b22003d206
1 changed files with 15 additions and 3 deletions
|
|
@ -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)"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue