Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rabotnik-rules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Global Dynamic Exposure
rabotnik
rabotnik-rules
Commits
1def4e32
Commit
1def4e32
authored
11 months ago
by
Laurens Oostwegel
Browse files
Options
Downloads
Patches
Plain Diff
Raise an error if the number stories exceeds 175
parent
73e4031d
No related branches found
No related tags found
1 merge request
!11
Resolve "[Hotfix]: Number of stories cannot exceed the highest building in the world"
Pipeline
#75187
passed
8 months ago
Stage: linters
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
building/02_process/stories_and_floorspace/stories_and_floorspace.py
+22
-0
22 additions, 0 deletions
..._process/stories_and_floorspace/stories_and_floorspace.py
with
22 additions
and
0 deletions
building/02_process/stories_and_floorspace/stories_and_floorspace.py
+
22
−
0
View file @
1def4e32
#!/usr/bin/env python3
# Copyright (c) 2023-2024:
# Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
class
StoriesAndFloorspaceRule
:
def
__call__
(
self
,
tags
,
relations
,
area
,
*
args
,
**
kwargs
):
"""
...
...
@@ -29,6 +48,9 @@ class StoriesAndFloorspaceRule:
stories
=
ceil
(
float
(
story_string
))
if
stories
<
1
:
raise
ValueError
(
"
Number of stories cannot be below 1
"
)
elif
stories
>
175
:
raise
ValueError
(
"
Number of stories cannot be above 175
"
)
floorspace
=
stories
*
area
return
{
"
stories
"
:
stories
,
"
floorspace
"
:
floorspace
}
except
ValueError
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment