aggregate.assign_object - support batching #4474

This commit is contained in:
Andrej730
2024-04-08 16:23:48 +05:00
parent d764c0af23
commit cd11d2de27
34 changed files with 187 additions and 143 deletions
+7 -7
View File
@@ -86,8 +86,8 @@ class TestGetStoreyHeight(test.bim.bootstrap.NewFile):
storey.Elevation = 3000
storey2 = ifc.createIfcBuildingStorey()
storey2.Elevation = 5000
ifcopenshell.api.run("aggregate.assign_object", ifc, product=storey, relating_object=building)
ifcopenshell.api.run("aggregate.assign_object", ifc, product=storey2, relating_object=building)
ifcopenshell.api.run("aggregate.assign_object", ifc, products=[storey], relating_object=building)
ifcopenshell.api.run("aggregate.assign_object", ifc, products=[storey2], relating_object=building)
assert subject.get_storey_height_in_si(storey, 1) == 2.0
def test_getting_a_double_storey_height(self):
@@ -103,9 +103,9 @@ class TestGetStoreyHeight(test.bim.bootstrap.NewFile):
storey2.Elevation = 5000
storey3 = ifc.createIfcBuildingStorey()
storey3.Elevation = 9000
ifcopenshell.api.run("aggregate.assign_object", ifc, product=storey, relating_object=building)
ifcopenshell.api.run("aggregate.assign_object", ifc, product=storey2, relating_object=building)
ifcopenshell.api.run("aggregate.assign_object", ifc, product=storey3, relating_object=building)
ifcopenshell.api.run("aggregate.assign_object", ifc, products=[storey], relating_object=building)
ifcopenshell.api.run("aggregate.assign_object", ifc, products=[storey2], relating_object=building)
ifcopenshell.api.run("aggregate.assign_object", ifc, products=[storey3], relating_object=building)
assert subject.get_storey_height_in_si(storey, 2) == 6.0
def test_only_considering_storeys_in_the_same_building(self):
@@ -116,7 +116,7 @@ class TestGetStoreyHeight(test.bim.bootstrap.NewFile):
storey.Elevation = 3000
storey2 = ifc.createIfcBuildingStorey()
storey2.Elevation = 5000
ifcopenshell.api.run("aggregate.assign_object", ifc, product=storey, relating_object=building)
ifcopenshell.api.run("aggregate.assign_object", ifc, products=[storey], relating_object=building)
assert subject.get_storey_height_in_si(storey, 1) is None
def test_returning_none_if_the_storey_height_is_undefined(self):
@@ -124,7 +124,7 @@ class TestGetStoreyHeight(test.bim.bootstrap.NewFile):
tool.Ifc.set(ifc)
building = ifc.createIfcBuilding()
storey = ifc.createIfcBuildingStorey()
ifcopenshell.api.run("aggregate.assign_object", ifc, product=storey, relating_object=building)
ifcopenshell.api.run("aggregate.assign_object", ifc, products=[storey], relating_object=building)
assert subject.get_storey_height_in_si(storey, 1) is None