mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Setting up to merge HA6
This commit is contained in:
parent
b22003d206
commit
f1670498d1
1 changed files with 18 additions and 1 deletions
|
|
@ -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 = {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue