Setting up to merge HA6

This commit is contained in:
Khalim Conn-Kowlessar 2024-01-22 11:15:56 +00:00
parent b22003d206
commit f1670498d1

View file

@ -77,9 +77,12 @@ class DataLoader:
)
)
# Add in asset_list_row_id
asset_list["asset_list_row_id"] = [ha_name + str(i) for i in range(0, len(asset_list))]
return asset_list
def load_survey_list(self, file_path, ha_name, sheet_name=None):
def load_survey_list(self, file_path, ha_name, asset_list, sheet_name=None):
survey_workbook = openpyxl.load_workbook(file_path)
if sheet_name is not None:
survey_sheet = survey_workbook[sheet_name]
@ -133,8 +136,22 @@ class DataLoader:
)
)
# Add in asset_list_row_id
survey_list["survey_list_row_id"] = [ha_name + str(i) for i in range(0, len(survey_list))]
# We now do the matching between the asset list and the survey list.
# What we'll get from this is a lookup table from the asset list to the survey list
if ha_name == "ha_6":
self.merge_ha_6(asset_list, survey_list)
else:
raise NotImplementedError("Only HA 6 has surveys")
return survey_list
def merge_ha_6(self, asset_list, survey_list):
pass
def load(self):
data = {}