mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +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,
|
||||
aspect_type=AspectType.RISK,
|
||||
),
|
||||
"HHSRSBIOCIDES": ElementMapping(
|
||||
"HHSRSBIOC": ElementMapping(
|
||||
element=Element.HHSRS_BIOCIDES,
|
||||
aspect_type=AspectType.RISK,
|
||||
),
|
||||
|
|
@ -431,6 +431,14 @@ LBWF_ELEMENT_MAP: dict[str, ElementMapping] = {
|
|||
element=Element.HHSRS_CARBON_MONOXIDE,
|
||||
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(
|
||||
element=Element.HHSRS_LEAD,
|
||||
aspect_type=AspectType.RISK,
|
||||
|
|
@ -528,7 +536,3 @@ LBWF_ELEMENT_MAP: dict[str, ElementMapping] = {
|
|||
aspect_type=AspectType.RISK,
|
||||
),
|
||||
}
|
||||
|
||||
# Unhandled:
|
||||
# DECNTHMINC
|
||||
# EICINSFREQ
|
||||
|
|
|
|||
|
|
@ -27,32 +27,34 @@ class LbwfMapper(Mapper):
|
|||
|
||||
uprn: int = client_data.uprn
|
||||
for raw_asset in client_data.assets:
|
||||
try:
|
||||
element_mapping: ElementMapping = LbwfMapper._map_element(
|
||||
raw_asset.element_code
|
||||
)
|
||||
except:
|
||||
logger.warning(
|
||||
f"Unrecognised LBWF Asset Element Code: {raw_asset.element_code}. Skipping record"
|
||||
)
|
||||
continue
|
||||
# Ignore metadata rows
|
||||
if raw_asset.element_code not in ["EICINSFREQ", "DECNTHMINC"]:
|
||||
try:
|
||||
element_mapping: ElementMapping = LbwfMapper._map_element(
|
||||
raw_asset.element_code
|
||||
)
|
||||
except:
|
||||
logger.warning(
|
||||
f"Unrecognised LBWF Asset Element Code: {raw_asset.element_code}. Skipping record"
|
||||
)
|
||||
continue
|
||||
|
||||
mapped_assets.append(
|
||||
AssetCondition(
|
||||
uprn=uprn,
|
||||
element=element_mapping.element,
|
||||
aspect_type=element_mapping.aspect_type,
|
||||
value=raw_asset.attribute_code_description,
|
||||
quantity=raw_asset.quantity,
|
||||
install_date=raw_asset.install_date,
|
||||
renewal_year=LbwfMapper._calculate_renewal_year(
|
||||
raw_asset, survey_year
|
||||
),
|
||||
element_instance=element_mapping.element_instance,
|
||||
source_system=None, # Once we know the system name we'll set it here
|
||||
comments=raw_asset.element_comments,
|
||||
mapped_assets.append(
|
||||
AssetCondition(
|
||||
uprn=uprn,
|
||||
element=element_mapping.element,
|
||||
aspect_type=element_mapping.aspect_type,
|
||||
value=raw_asset.attribute_code_description,
|
||||
quantity=raw_asset.quantity,
|
||||
install_date=raw_asset.install_date,
|
||||
renewal_year=LbwfMapper._calculate_renewal_year(
|
||||
raw_asset, survey_year
|
||||
),
|
||||
element_instance=element_mapping.element_instance,
|
||||
source_system=None, # Once we know the system name we'll set it here
|
||||
comments=raw_asset.element_comments,
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
return mapped_assets
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ PEABODY_ELEMENT_MAP = {
|
|||
(53, 4): ElementMapping(
|
||||
element=Element.EXTERNAL_DECORATION, aspect_type=AspectType.PRESENCE
|
||||
),
|
||||
(53, 4): ElementMapping(
|
||||
(53, 5): ElementMapping(
|
||||
element=Element.EXTERNAL_NOISE_INSULATION, aspect_type=AspectType.ADEQUACY
|
||||
),
|
||||
(53, 14): ElementMapping(
|
||||
|
|
@ -109,7 +109,7 @@ PEABODY_ELEMENT_MAP = {
|
|||
element=Element.GUTTERS,
|
||||
aspect_type=AspectType.MATERIAL,
|
||||
),
|
||||
(53, 18): ElementMapping(
|
||||
(53, 21): ElementMapping(
|
||||
element=Element.PITCHED_ROOF_COVERING,
|
||||
aspect_type=AspectType.MATERIAL,
|
||||
),
|
||||
|
|
@ -334,8 +334,12 @@ PEABODY_ELEMENT_MAP = {
|
|||
element=Element.KITCHEN_SPACE_LAYOUT,
|
||||
aspect_type=AspectType.ADEQUACY,
|
||||
),
|
||||
(50, 14): ElementMapping(
|
||||
element=Element.KITCHEN,
|
||||
aspect_type=AspectType.TYPE,
|
||||
),
|
||||
(50, 17): ElementMapping(
|
||||
element=Element.BATHRROM,
|
||||
element=Element.BATHROOM,
|
||||
aspect_type=AspectType.LOCATION,
|
||||
),
|
||||
(50, 18): ElementMapping(
|
||||
|
|
@ -480,7 +484,7 @@ PEABODY_ELEMENT_MAP = {
|
|||
aspect_type=AspectType.FINISH,
|
||||
element_instance=2,
|
||||
),
|
||||
(51, 14): ElementMapping(
|
||||
(51, 31): ElementMapping(
|
||||
element=Element.COMMUNAL_SPRINKLER,
|
||||
aspect_type=AspectType.PRESENCE,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -26,4 +26,4 @@ def process_file(file_stream: BinaryIO, source_key: str) -> None:
|
|||
for p in raw_properties:
|
||||
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