mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Replace removed get_info_2
This commit is contained in:
@@ -387,15 +387,15 @@ class entity_instance_mixin:
|
||||
return_type: type[dict] = dict,
|
||||
ignore: Sequence[str] = (),
|
||||
) -> dict[str, Any]:
|
||||
"""More perfomant version of `.get_info()`.\n
|
||||
Method has exactly the same signature as `.get_info()`, but the fast C++
|
||||
"""More perfomant version of `.get_info_py()`.\n
|
||||
Method has exactly the same signature as `.get_info_py()`, but the fast C++
|
||||
path only implements ``recursive=True``, ``return_type=dict`` and
|
||||
``ignore=()``. Any other combination falls back to the pure Python
|
||||
`.get_info()`, where no meaningful performance gain is possible anyway
|
||||
`.get_info_py()`, where no meaningful performance gain is possible anyway
|
||||
as the cost is dominated by the recursive traversal.
|
||||
"""
|
||||
if recursive and return_type is dict and not ignore:
|
||||
return ifcopenshell_wrapper.get_info_cpp(self.wrapped_data, include_identifier)
|
||||
return ifcopenshell_wrapper.get_info_cpp(self, recursive, include_identifier)
|
||||
return self.get_info_py(
|
||||
include_identifier=include_identifier, recursive=recursive, return_type=return_type, ignore=ignore
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ class TestGetInfo2(test.bootstrap.IFC4):
|
||||
brep = self.file.create_entity("IfcFacetedBrep")
|
||||
shell = self.file.create_entity("IfcClosedShell")
|
||||
brep.Outer = shell
|
||||
assert brep.get_info_2(recursive=True) == {
|
||||
assert brep.get_info(recursive=True) == {
|
||||
"Outer": {"CfsFaces": None, "id": 2, "type": "IfcClosedShell"},
|
||||
"id": 1,
|
||||
"type": "IfcFacetedBrep",
|
||||
@@ -35,7 +35,7 @@ class TestGetInfo2(test.bootstrap.IFC4):
|
||||
shell = self.file.create_entity("IfcClosedShell")
|
||||
faces = [self.file.create_entity("IfcFace") for i in range(3)]
|
||||
shell.CfsFaces = faces
|
||||
assert shell.get_info_2(recursive=True)["CfsFaces"] == (
|
||||
assert shell.get_info(recursive=True)["CfsFaces"] == (
|
||||
{"Bounds": None, "id": 2, "type": "IfcFace"},
|
||||
{"Bounds": None, "id": 3, "type": "IfcFace"},
|
||||
{"Bounds": None, "id": 4, "type": "IfcFace"},
|
||||
@@ -45,7 +45,7 @@ class TestGetInfo2(test.bootstrap.IFC4):
|
||||
surface = self.file.create_entity("IfcBSplineSurfaceWithKnots")
|
||||
pp = [self.file.create_entity("IfcCartesianPoint", [float(i)]) for i in range(4)]
|
||||
surface.ControlPointsList = [pp[:2], pp[2:]]
|
||||
assert surface.get_info_2(recursive=True)["ControlPointsList"] == (
|
||||
assert surface.get_info(recursive=True)["ControlPointsList"] == (
|
||||
(
|
||||
{"Coordinates": (0.0,), "id": 2, "type": "IfcCartesianPoint"},
|
||||
{"Coordinates": (1.0,), "id": 3, "type": "IfcCartesianPoint"},
|
||||
@@ -60,7 +60,7 @@ class TestGetInfo2(test.bootstrap.IFC4):
|
||||
brep = self.file.create_entity("IfcFacetedBrep")
|
||||
shell = self.file.create_entity("IfcClosedShell")
|
||||
brep.Outer = shell
|
||||
assert brep.get_info_2(recursive=True, include_identifier=False) == {
|
||||
assert brep.get_info(recursive=True, include_identifier=False) == {
|
||||
"Outer": {"CfsFaces": None, "type": "IfcClosedShell"},
|
||||
"type": "IfcFacetedBrep",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user