mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
extract lighting fittings from epr
This commit is contained in:
parent
d0cf88af64
commit
f97bb7f127
1 changed files with 11 additions and 1 deletions
|
|
@ -461,7 +461,10 @@ def extract_epr(pdf_path):
|
||||||
'Total Ground Floor Area (m2)': None,
|
'Total Ground Floor Area (m2)': None,
|
||||||
'RIR Floor Area': None,
|
'RIR Floor Area': None,
|
||||||
'Main Building Wall Area (m2)': None,
|
'Main Building Wall Area (m2)': None,
|
||||||
'First Extension Wall Area (m2)': None
|
'First Extension Wall Area (m2)': None,
|
||||||
|
"Number of Light Fittings": None,
|
||||||
|
"Number of LEL Fittings": None,
|
||||||
|
"Number of fittings needing LEL": None
|
||||||
}
|
}
|
||||||
|
|
||||||
with open(pdf_path, "rb") as file:
|
with open(pdf_path, "rb") as file:
|
||||||
|
|
@ -573,6 +576,13 @@ def extract_epr(pdf_path):
|
||||||
building_parts = extract_building_parts_epr(text)
|
building_parts = extract_building_parts_epr(text)
|
||||||
data.update(building_parts)
|
data.update(building_parts)
|
||||||
|
|
||||||
|
# Get number of lighting outlets and number of fittings needing LEL
|
||||||
|
lighting_fittings_match = re.search(r"Total number of light fittings\s*(\d+)", text)
|
||||||
|
data["Number of Light Fittings"] = int(lighting_fittings_match.group(1))
|
||||||
|
lel_fittings_match = re.search(r"Total number of L.E.L. fittings\s*(\d+)", text)
|
||||||
|
data["Number of LEL Fittings"] = int(lel_fittings_match.group(1))
|
||||||
|
data["Number of fittings needing LEL"] = data["Number of Light Fittings"] - data["Number of LEL Fittings"]
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue