Skip to content
Snippets Groups Projects
Commit c0b5092f authored by Danijel Schorlemmer's avatar Danijel Schorlemmer Committed by Laurens Oostwegel
Browse files

Apply 7 suggestion(s) to 1 file(s)

parent 681075fe
No related branches found
No related tags found
No related merge requests found
Pipeline #65074 passed
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
......@@ -19,17 +19,17 @@ class StoriesAndFloorspaceRule:
from math import ceil
storey_options = [self.get_info(building["tags"]) for building in [tags] + relations]
story_options = [self.get_info(building["tags"]) for building in [tags] + relations]
for storey_string in storey_options:
if storey_string is None or storey_string == "":
for story_string in story_options:
if story_string is None or story_string == "":
continue
try:
storeys = ceil(float(storey_string))
if storeys < 1:
stories = ceil(float(story_string))
if stories < 1:
raise ValueError("Number of stories cannot be below 1")
floorspace = storeys * area
return {"storeys": storeys, "floorspace": floorspace}
floorspace = stories * area
return {"stories": stories, "floorspace": floorspace}
except ValueError:
continue
return {"storeys": None, "floorspace": None}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment