mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
final missing mappings
This commit is contained in:
parent
eaf793011b
commit
d2ce135f07
4 changed files with 44 additions and 34 deletions
|
|
@ -423,7 +423,7 @@ LBWF_ELEMENT_MAP: dict[str, ElementMapping] = {
|
||||||
element=Element.HHSRS_ASBESTOS_AND_MMF,
|
element=Element.HHSRS_ASBESTOS_AND_MMF,
|
||||||
aspect_type=AspectType.RISK,
|
aspect_type=AspectType.RISK,
|
||||||
),
|
),
|
||||||
"HHSRSBIOCIDES": ElementMapping(
|
"HHSRSBIOC": ElementMapping(
|
||||||
element=Element.HHSRS_BIOCIDES,
|
element=Element.HHSRS_BIOCIDES,
|
||||||
aspect_type=AspectType.RISK,
|
aspect_type=AspectType.RISK,
|
||||||
),
|
),
|
||||||
|
|
@ -431,6 +431,14 @@ LBWF_ELEMENT_MAP: dict[str, ElementMapping] = {
|
||||||
element=Element.HHSRS_CARBON_MONOXIDE,
|
element=Element.HHSRS_CARBON_MONOXIDE,
|
||||||
aspect_type=AspectType.RISK,
|
aspect_type=AspectType.RISK,
|
||||||
),
|
),
|
||||||
|
"HHSRSNO2": ElementMapping(
|
||||||
|
element=Element.HHSRS_CARBON_MONOXIDE,
|
||||||
|
aspect_type=AspectType.RISK,
|
||||||
|
), # Duplicate of HHSRSCO; I think they relate to the same HHSRS hazard
|
||||||
|
"HHSRSSO2": ElementMapping(
|
||||||
|
element=Element.HHSRS_CARBON_MONOXIDE,
|
||||||
|
aspect_type=AspectType.RISK,
|
||||||
|
), # Duplicate of HHSRSCO; I think they relate to the same HHSRS hazard
|
||||||
"HHSRSLEAD": ElementMapping(
|
"HHSRSLEAD": ElementMapping(
|
||||||
element=Element.HHSRS_LEAD,
|
element=Element.HHSRS_LEAD,
|
||||||
aspect_type=AspectType.RISK,
|
aspect_type=AspectType.RISK,
|
||||||
|
|
@ -528,7 +536,3 @@ LBWF_ELEMENT_MAP: dict[str, ElementMapping] = {
|
||||||
aspect_type=AspectType.RISK,
|
aspect_type=AspectType.RISK,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
# Unhandled:
|
|
||||||
# DECNTHMINC
|
|
||||||
# EICINSFREQ
|
|
||||||
|
|
|
||||||
|
|
@ -27,32 +27,34 @@ class LbwfMapper(Mapper):
|
||||||
|
|
||||||
uprn: int = client_data.uprn
|
uprn: int = client_data.uprn
|
||||||
for raw_asset in client_data.assets:
|
for raw_asset in client_data.assets:
|
||||||
try:
|
# Ignore metadata rows
|
||||||
element_mapping: ElementMapping = LbwfMapper._map_element(
|
if raw_asset.element_code not in ["EICINSFREQ", "DECNTHMINC"]:
|
||||||
raw_asset.element_code
|
try:
|
||||||
)
|
element_mapping: ElementMapping = LbwfMapper._map_element(
|
||||||
except:
|
raw_asset.element_code
|
||||||
logger.warning(
|
)
|
||||||
f"Unrecognised LBWF Asset Element Code: {raw_asset.element_code}. Skipping record"
|
except:
|
||||||
)
|
logger.warning(
|
||||||
continue
|
f"Unrecognised LBWF Asset Element Code: {raw_asset.element_code}. Skipping record"
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
|
||||||
mapped_assets.append(
|
mapped_assets.append(
|
||||||
AssetCondition(
|
AssetCondition(
|
||||||
uprn=uprn,
|
uprn=uprn,
|
||||||
element=element_mapping.element,
|
element=element_mapping.element,
|
||||||
aspect_type=element_mapping.aspect_type,
|
aspect_type=element_mapping.aspect_type,
|
||||||
value=raw_asset.attribute_code_description,
|
value=raw_asset.attribute_code_description,
|
||||||
quantity=raw_asset.quantity,
|
quantity=raw_asset.quantity,
|
||||||
install_date=raw_asset.install_date,
|
install_date=raw_asset.install_date,
|
||||||
renewal_year=LbwfMapper._calculate_renewal_year(
|
renewal_year=LbwfMapper._calculate_renewal_year(
|
||||||
raw_asset, survey_year
|
raw_asset, survey_year
|
||||||
),
|
),
|
||||||
element_instance=element_mapping.element_instance,
|
element_instance=element_mapping.element_instance,
|
||||||
source_system=None, # Once we know the system name we'll set it here
|
source_system=None, # Once we know the system name we'll set it here
|
||||||
comments=raw_asset.element_comments,
|
comments=raw_asset.element_comments,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
|
||||||
return mapped_assets
|
return mapped_assets
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ PEABODY_ELEMENT_MAP = {
|
||||||
(53, 4): ElementMapping(
|
(53, 4): ElementMapping(
|
||||||
element=Element.EXTERNAL_DECORATION, aspect_type=AspectType.PRESENCE
|
element=Element.EXTERNAL_DECORATION, aspect_type=AspectType.PRESENCE
|
||||||
),
|
),
|
||||||
(53, 4): ElementMapping(
|
(53, 5): ElementMapping(
|
||||||
element=Element.EXTERNAL_NOISE_INSULATION, aspect_type=AspectType.ADEQUACY
|
element=Element.EXTERNAL_NOISE_INSULATION, aspect_type=AspectType.ADEQUACY
|
||||||
),
|
),
|
||||||
(53, 14): ElementMapping(
|
(53, 14): ElementMapping(
|
||||||
|
|
@ -109,7 +109,7 @@ PEABODY_ELEMENT_MAP = {
|
||||||
element=Element.GUTTERS,
|
element=Element.GUTTERS,
|
||||||
aspect_type=AspectType.MATERIAL,
|
aspect_type=AspectType.MATERIAL,
|
||||||
),
|
),
|
||||||
(53, 18): ElementMapping(
|
(53, 21): ElementMapping(
|
||||||
element=Element.PITCHED_ROOF_COVERING,
|
element=Element.PITCHED_ROOF_COVERING,
|
||||||
aspect_type=AspectType.MATERIAL,
|
aspect_type=AspectType.MATERIAL,
|
||||||
),
|
),
|
||||||
|
|
@ -334,8 +334,12 @@ PEABODY_ELEMENT_MAP = {
|
||||||
element=Element.KITCHEN_SPACE_LAYOUT,
|
element=Element.KITCHEN_SPACE_LAYOUT,
|
||||||
aspect_type=AspectType.ADEQUACY,
|
aspect_type=AspectType.ADEQUACY,
|
||||||
),
|
),
|
||||||
|
(50, 14): ElementMapping(
|
||||||
|
element=Element.KITCHEN,
|
||||||
|
aspect_type=AspectType.TYPE,
|
||||||
|
),
|
||||||
(50, 17): ElementMapping(
|
(50, 17): ElementMapping(
|
||||||
element=Element.BATHRROM,
|
element=Element.BATHROOM,
|
||||||
aspect_type=AspectType.LOCATION,
|
aspect_type=AspectType.LOCATION,
|
||||||
),
|
),
|
||||||
(50, 18): ElementMapping(
|
(50, 18): ElementMapping(
|
||||||
|
|
@ -480,7 +484,7 @@ PEABODY_ELEMENT_MAP = {
|
||||||
aspect_type=AspectType.FINISH,
|
aspect_type=AspectType.FINISH,
|
||||||
element_instance=2,
|
element_instance=2,
|
||||||
),
|
),
|
||||||
(51, 14): ElementMapping(
|
(51, 31): ElementMapping(
|
||||||
element=Element.COMMUNAL_SPRINKLER,
|
element=Element.COMMUNAL_SPRINKLER,
|
||||||
aspect_type=AspectType.PRESENCE,
|
aspect_type=AspectType.PRESENCE,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -26,4 +26,4 @@ def process_file(file_stream: BinaryIO, source_key: str) -> None:
|
||||||
for p in raw_properties:
|
for p in raw_properties:
|
||||||
assets.extend(mapper.map_asset_conditions_for_property(p, survey_year))
|
assets.extend(mapper.map_asset_conditions_for_property(p, survey_year))
|
||||||
|
|
||||||
print(assets) # temp
|
print("done") # temp
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue