From 6ebb69f62e8ec3323dd27f3d312bd92765373d32 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Thu, 26 Nov 2020 15:35:53 +0100 Subject: [PATCH] bimtester: steps, improve imports --- src/ifcbimtester/bimtester/features/steps/geocoding.py | 5 ++++- src/ifcbimtester/bimtester/features/steps/geolocation.py | 8 ++++++-- .../bimtester/features/steps/geometric_detail.py | 7 +++++-- .../bimtester/features/steps/model_federation.py | 6 ++++-- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/ifcbimtester/bimtester/features/steps/geocoding.py b/src/ifcbimtester/bimtester/features/steps/geocoding.py index 1b003743ea..3cc4a8ad4a 100644 --- a/src/ifcbimtester/bimtester/features/steps/geocoding.py +++ b/src/ifcbimtester/bimtester/features/steps/geocoding.py @@ -1,5 +1,8 @@ from behave import step -from utils import IfcFile, assert_attribute, assert_type + +from utils import assert_attribute +from utils import assert_type +from utils import IfcFile def get_ifc_class_from_spatial_type(spatial_type): diff --git a/src/ifcbimtester/bimtester/features/steps/geolocation.py b/src/ifcbimtester/bimtester/features/steps/geolocation.py index 917e9814c5..8981b0f4de 100644 --- a/src/ifcbimtester/bimtester/features/steps/geolocation.py +++ b/src/ifcbimtester/bimtester/features/steps/geolocation.py @@ -1,9 +1,13 @@ -from behave import step -from utils import IfcFile, assert_number, assert_pset, assert_attribute import math import ifcopenshell.util import ifcopenshell.util.element import ifcopenshell.util.geolocation +from behave import step + +from utils import assert_attribute +from utils import assert_number +from utils import assert_pset +from utils import IfcFile @step(u"There must be at least one {ifc_class} element") diff --git a/src/ifcbimtester/bimtester/features/steps/geometric_detail.py b/src/ifcbimtester/bimtester/features/steps/geometric_detail.py index ffb930d08a..930e511d0e 100644 --- a/src/ifcbimtester/bimtester/features/steps/geometric_detail.py +++ b/src/ifcbimtester/bimtester/features/steps/geometric_detail.py @@ -1,6 +1,6 @@ from behave import step + from utils import IfcFile -from utils import IfcFile, assert_attribute @step("All elements must be under {number} polygons") @@ -22,7 +22,10 @@ def step_impl(context, number): if total_polygons > number: errors.append((total_polygons, element)) if errors: - message = "The following {} elements are over 500 polygons:\n".format(len(errors)) + message = ( + "The following {} elements are over 500 polygons:\n" + .format(len(errors)) + ) for error in errors: message += "Polygons: {} - {}\n".format(error[0], error[1]) assert False, message diff --git a/src/ifcbimtester/bimtester/features/steps/model_federation.py b/src/ifcbimtester/bimtester/features/steps/model_federation.py index 18c49c4696..cab9451df0 100644 --- a/src/ifcbimtester/bimtester/features/steps/model_federation.py +++ b/src/ifcbimtester/bimtester/features/steps/model_federation.py @@ -1,8 +1,10 @@ -import numpy as np import ifcopenshell.util.geolocation +import numpy as np from behave import step + +from utils import assert_number +from utils import assert_type from utils import IfcFile -from utils import IfcFile, assert_number, assert_type def a2p(o, z, x):