3030from 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' )
3434def 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" )
7272def 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}"' )
8181def 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}"' )
9090def 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}"' )
9999def 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}"' )
108108def 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}"' )
117117def 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}"' )
126126def 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}"' )
135135def 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" )
152152def 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' )
160160def 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' )
170170def 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' )
180180def 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' )
190190def 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' )
202202def 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' )
212212def 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}"' )
232232def 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}"' )
242242def 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}"' )
252252def 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' )
260260def 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 "{}"' )
0 commit comments