Skip to content

Commit 2d90d3f

Browse files
add streamline changes do my bimtester 2
1 parent 4e48936 commit 2d90d3f

File tree

12 files changed

+122
-39
lines changed

12 files changed

+122
-39
lines changed

src/ifcbimtester/bimtester/features/steps/application/en.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
def step_impl(context, fullname):
2727

2828
real_fullname = IfcStore.file.by_type("IfcApplication")[0].ApplicationFullName
29-
assert real_fullname == fullname , (
29+
assert real_fullname == fullname, (
3030
"The IFC file was not exported by application full name {} "
3131
"instead it was exported by application full name {}"
3232
.format(fullname, real_fullname)

src/ifcbimtester/bimtester/features/steps/geolocation/en.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from bimtester.lang import _
3131

3232

33-
@step(u'There must be at least one "{ifc_class}" element')
33+
@step('There must be at least one "{ifc_class}" element')
3434
def step_impl(context, ifc_class):
3535
assert len(IfcStore.file.by_type(ifc_class)) >= 1, _("An element of {} could not be found").format(ifc_class)
3636

@@ -68,7 +68,7 @@ def check_ifc4_geolocation(entity_name, prop_name=None, value=None, should_asser
6868
return actual_value
6969

7070

71-
@step(u"The project must have coordinate reference system data")
71+
@step("The project must have coordinate reference system data")
7272
def step_impl(context):
7373
if IfcStore.file.schema == "IFC2X3":
7474
for site in IfcStore.file.by_type("IfcSite"):
@@ -77,7 +77,7 @@ def step_impl(context):
7777
check_ifc4_geolocation("IfcProjectedCRS")
7878

7979

80-
@step(u'The name of the CRS must be "{coordinate_reference_name}"')
80+
@step('The name of the CRS must be "{coordinate_reference_name}"')
8181
def step_impl(context, coordinate_reference_name):
8282
if IfcStore.file.schema == "IFC2X3":
8383
for site in IfcStore.file.by_type("IfcSite"):
@@ -86,7 +86,7 @@ def step_impl(context, coordinate_reference_name):
8686
check_ifc4_geolocation("IfcProjectedCRS", "Name", coordinate_reference_name)
8787

8888

89-
@step(u'The description of the CRS must be "{value}"')
89+
@step('The description of the CRS must be "{value}"')
9090
def step_impl(context, value):
9191
if IfcStore.file.schema == "IFC2X3":
9292
for site in IfcStore.file.by_type("IfcSite"):
@@ -95,7 +95,7 @@ def step_impl(context, value):
9595
check_ifc4_geolocation("IfcProjectedCRS", "Description", value)
9696

9797

98-
@step(u'The geodetic datum must be "{coordinate_reference_name}"')
98+
@step('The geodetic datum must be "{coordinate_reference_name}"')
9999
def step_impl(context, coordinate_reference_name):
100100
if IfcStore.file.schema == "IFC2X3":
101101
for site in IfcStore.file.by_type("IfcSite"):
@@ -104,7 +104,7 @@ def step_impl(context, coordinate_reference_name):
104104
check_ifc4_geolocation("IfcProjectedCRS", "GeodeticDatum", coordinate_reference_name)
105105

106106

107-
@step(u'The vertical datum must be "{coordinate_reference_name}"')
107+
@step('The vertical datum must be "{coordinate_reference_name}"')
108108
def step_impl(context, coordinate_reference_name):
109109
if IfcStore.file.schema == "IFC2X3":
110110
for site in IfcStore.file.by_type("IfcSite"):
@@ -113,7 +113,7 @@ def step_impl(context, coordinate_reference_name):
113113
check_ifc4_geolocation("IfcProjectedCRS", "VerticalDatum", coordinate_reference_name)
114114

115115

116-
@step(u'The map projection must be "{coordinate_reference_name}"')
116+
@step('The map projection must be "{coordinate_reference_name}"')
117117
def step_impl(context, coordinate_reference_name):
118118
if IfcStore.file.schema == "IFC2X3":
119119
for site in IfcStore.file.by_type("IfcSite"):
@@ -122,7 +122,7 @@ def step_impl(context, coordinate_reference_name):
122122
check_ifc4_geolocation("IfcProjectedCRS", "MapProjection", coordinate_reference_name)
123123

124124

125-
@step(u'The map zone must be "{coordinate_reference_name}"')
125+
@step('The map zone must be "{coordinate_reference_name}"')
126126
def step_impl(context, coordinate_reference_name):
127127
if IfcStore.file.schema == "IFC2X3":
128128
for site in IfcStore.file.by_type("IfcSite"):
@@ -131,7 +131,7 @@ def step_impl(context, coordinate_reference_name):
131131
check_ifc4_geolocation("IfcProjectedCRS", "MapZone", coordinate_reference_name)
132132

133133

134-
@step(u'The map unit must be "{unit}"')
134+
@step('The map unit must be "{unit}"')
135135
def step_impl(context, unit):
136136
if IfcStore.file.schema == "IFC2X3":
137137
for site in IfcStore.file.by_type("IfcSite"):
@@ -148,15 +148,15 @@ def step_impl(context, unit):
148148
assert actual_value == unit, _('We expected a value of "{}" but instead got "{}"').format(unit, actual_value)
149149

150150

151-
@step(u"The project must have coordinate transformations to convert from local to global coordinates")
151+
@step("The project must have coordinate transformations to convert from local to global coordinates")
152152
def step_impl(context):
153153
if IfcStore.file.schema == "IFC2X3":
154154
for site in IfcStore.file.by_type("IfcSite"):
155155
util.assert_pset(site, "EPset_MapConversion")
156156
check_ifc4_geolocation("IfcMapConversion")
157157

158158

159-
@step(u'The eastings of the model must be offset by "{number}" to derive its global coordinates')
159+
@step('The eastings of the model must be offset by "{number}" to derive its global coordinates')
160160
def step_impl(context, number):
161161
number = util.assert_number(number)
162162
if IfcStore.file.schema == "IFC2X3":
@@ -166,7 +166,7 @@ def step_impl(context, number):
166166
check_ifc4_geolocation("IfcMapConversion", "Eastings", number)
167167

168168

169-
@step(u'The northings of the model must be offset by "{number}" to derive its global coordinates')
169+
@step('The northings of the model must be offset by "{number}" to derive its global coordinates')
170170
def step_impl(context, number):
171171
number = util.assert_number(number)
172172
if IfcStore.file.schema == "IFC2X3":
@@ -176,7 +176,7 @@ def step_impl(context, number):
176176
check_ifc4_geolocation("IfcMapConversion", "Northings", number)
177177

178178

179-
@step(u'The height of the model must be offset by "{number}" to derive its global coordinates')
179+
@step('The height of the model must be offset by "{number}" to derive its global coordinates')
180180
def step_impl(context, number):
181181
number = util.assert_number(number)
182182
if IfcStore.file.schema == "IFC2X3":
@@ -186,7 +186,7 @@ def step_impl(context, number):
186186
check_ifc4_geolocation("IfcMapConversion", "OrthogonalHeight", number)
187187

188188

189-
@step(u'The model must be rotated clockwise by "{number}" to derive its global coordinates')
189+
@step('The model must be rotated clockwise by "{number}" to derive its global coordinates')
190190
def step_impl(context, number):
191191
number = util.assert_number(number)
192192
if IfcStore.file.schema == "IFC2X3":
@@ -198,7 +198,7 @@ def step_impl(context, number):
198198
assert actual_value == value, _('We expected a value of "{}" but instead got "{}"').format(value, actual_value)
199199

200200

201-
@step(u'The model must be scaled along the horizontal axis by "{number}" to derive its global coordinates')
201+
@step('The model must be scaled along the horizontal axis by "{number}" to derive its global coordinates')
202202
def step_impl(context, number):
203203
number = util.assert_number(number)
204204
if IfcStore.file.schema == "IFC2X3":
@@ -208,7 +208,7 @@ def step_impl(context, number):
208208
check_ifc4_geolocation("IfcMapConversion", "Scale", number)
209209

210210

211-
@step(u'The model must be rotated clockwise by "{number}" for true north to point up')
211+
@step('The model must be rotated clockwise by "{number}" for true north to point up')
212212
def step_impl(context, number):
213213
number = util.assert_number(number)
214214
project = IfcStore.file.by_type("IfcProject")[0]
@@ -228,7 +228,7 @@ def step_impl(context, number):
228228
assert False, _("True north is not defined in the file")
229229

230230

231-
@step(u'The site "{guid}" has a longitude of "{number}"')
231+
@step('The site "{guid}" has a longitude of "{number}"')
232232
def step_impl(context, guid, number):
233233
number = util.assert_number(number)
234234
site = util.assert_guid(IfcStore.file, guid)
@@ -238,7 +238,7 @@ def step_impl(context, guid, number):
238238
util.assert_attribute(site, "RefLongitude", number)
239239

240240

241-
@step(u'The site "{guid}" has a latitude of "{number}"')
241+
@step('The site "{guid}" has a latitude of "{number}"')
242242
def step_impl(context, guid, number):
243243
number = util.assert_number(number)
244244
site = util.assert_guid(IfcStore.file, guid)
@@ -248,20 +248,20 @@ def step_impl(context, guid, number):
248248
util.assert_attribute(site, "RefLatitude", number)
249249

250250

251-
@step(u'The site "{guid}" has an elevation of "{number}"')
251+
@step('The site "{guid}" has an elevation of "{number}"')
252252
def step_impl(context, guid, number):
253253
number = util.assert_number(number)
254254
site = util.assert_guid(IfcStore.file, guid)
255255
util.assert_type(site, "IfcSite")
256256
util.assert_attribute(site, "RefElevation", number)
257257

258258

259-
@step(u'The site "{guid}" must be coincident with the project origin')
259+
@step('The site "{guid}" must be coincident with the project origin')
260260
def step_impl(context, guid):
261261
site = util.assert_guid(IfcStore.file, guid)
262262
util.assert_type(site, "IfcSite")
263263
if not site.ObjectPlacement:
264264
assert False, _("The site has no object placement")
265-
site_placement = ifcopenshell.util.placement.get_local_placement(site.ObjectPlacement)[:,3][0:3]
265+
site_placement = ifcopenshell.util.placement.get_local_placement(site.ObjectPlacement)[:, 3][0:3]
266266
origin = np.array([0, 0, 0])
267267
assert np.allclose(origin, site_placement), _('The site location is at "{}" instead of "{}"')

src/ifcbimtester/bimtester/features/steps/spatial_structure/en.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from bimtester.lang import _
2323

2424

25-
@step('All buildings have an address')
25+
@step("All buildings have an address")
2626
def step_impl(context):
2727
for building in IfcStore.file.by_type("IfcBuilding"):
2828
if not building.BuildingAddress:

src/ifcbimtester/bimtester/lang.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
translation = None
2222

23+
2324
def _(message):
2425
if translation:
2526
return translation(message)

src/ifcbimtester/bimtester/resources/reports/template.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
<!--
2+
BIMTester - OpenBIM Auditing Tool
3+
Copyright (C) 2021 Dion Moult <[email protected]>
4+
This file is part of BIMTester.
5+
BIMTester is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU Lesser General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
BIMTester is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Lesser General Public License for more details.
13+
You should have received a copy of the GNU Lesser General Public License
14+
along with BIMTester. If not, see <http://www.gnu.org/licenses/>.
15+
-->
116
<!DOCTYPE html>
217
<html lang={{_lang}}>
318
<head>
@@ -72,7 +87,7 @@ <h2>{{name}}</h2>
7287
<hr>
7388
<footer>
7489
<p>
75-
<a href="https://wiki.osarch.org/index.php?title=BIMTester">BIMTester</a> {{_auditing}} <a href="https://blenderbim.org/">BlenderBIM</a> {{_and}} <a href="http://ifcopenshell.org/">IfcOpenShell</a>.
90+
{{_auditing}} <a href="https://bonsaibim.org/">Bonsai</a> {{_and}} <a href="http://ifcopenshell.org/">IfcOpenShell</a>.
7691
</p>
7792
</footer>
7893
</body>

src/ifcbimtester/bimtester/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ def get_count(self):
3434
return len(self.rows)
3535

3636
def get_count_distinct_values(self):
37-
return len(set(item for sublist in self.rows.values() for item in sublist))
37+
return len(set(item for sublist in self.rows.values() for item in sublist))

src/ifcbimtester/gui.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
#!/usr/bin/env python3
22

3+
# BIMTester - OpenBIM Auditing Tool
4+
# Copyright (C) 2021 Dion Moult <[email protected]>
5+
#
6+
# This file is part of BIMTester.
7+
#
8+
# BIMTester is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU Lesser General Public License as published by
10+
# the Free Software Foundation, either version 3 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# BIMTester is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU Lesser General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU Lesser General Public License
19+
# along with BIMTester. If not, see <http://www.gnu.org/licenses/>.
20+
21+
322
from bimtester.guiwidget import run
423

524

src/ifcbimtester/patch/junit.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.
-2.91 KB
Binary file not shown.

src/ifcbimtester/webapp/index.html

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
<!--
2+
BIMTester - OpenBIM Auditing Tool
3+
Copyright (C) 2021 Dion Moult <[email protected]>
4+
5+
This file is part of BIMTester.
6+
7+
BIMTester is free software: you can redistribute it and/or modify
8+
it under the terms of the GNU Lesser General Public License as published by
9+
the Free Software Foundation, either version 3 of the License, or
10+
(at your option) any later version.
11+
12+
BIMTester is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
GNU Lesser General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General Public License
18+
along with BIMTester. If not, see <http://www.gnu.org/licenses/>.
19+
-->
120
<!doctype html>
221
<html class="no-js" lang="">
322

@@ -53,7 +72,7 @@ <h2 style="border-bottom: 0px; display: inline; padding-right: 20px;">
5372
Import
5473
</h2>
5574
<img class="vendor-icon vendor-full" src="images/archicad.png" width="24px">
56-
<img class="vendor-icon vendor-full" src="images/blenderbim.png" width="24px">
75+
<img class="vendor-icon vendor-full" src="images/bonsai.png" width="24px">
5776
<img class="vendor-icon vendor-partial" src="images/freecad.png" width="24px">
5877
<img class="vendor-icon vendor-bad" src="images/revit.png" width="24px">
5978
<img class="vendor-icon vendor-unknown" src="images/tekla.png" width="24px">
@@ -62,7 +81,7 @@ <h2 style="border-bottom: 0px; display: inline; padding-right: 20px; padding-lef
6281
Export
6382
</h2>
6483
<img class="vendor-icon vendor-partial" src="images/archicad.png" width="24px">
65-
<img class="vendor-icon vendor-full" src="images/blenderbim.png" width="24px">
84+
<img class="vendor-icon vendor-full" src="images/bonsai.png" width="24px">
6685
<img class="vendor-icon vendor-partial" src="images/freecad.png" width="24px">
6786
<img class="vendor-icon vendor-full" src="images/revit.png" width="24px">
6887
<img class="vendor-icon vendor-unknown" src="images/tekla.png" width="24px">
@@ -214,7 +233,7 @@ <h4>
214233
</div>
215234
<footer>
216235
<p>
217-
BIMTester is built with &hearts; on the awesome <a href="http://www.ifcopenshell.org/">IfcOpenShell</a> project by <a href="https://blenderbim.org/community.html">amazing volunteers</a>. You can be one too!
236+
BIMTester is built with &hearts; on the awesome <a href="http://www.ifcopenshell.org/">IfcOpenShell</a> project by <a href="https://bonsaibim.org/community.html">amazing volunteers</a>. You can be one too!
218237
</p>
219238
</footer>
220239
<!--

0 commit comments

Comments
 (0)