mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
remove_representation - optimizations
1) `do_not_delete` performs best when it's set 2) also_consider when `element` related elements go first, so there will be no need to traverse all other elements to see if they cover `element`'s inverses.
This commit is contained in:
@@ -1434,7 +1434,7 @@ def remove_deep2(
|
||||
ifc_file: ifcopenshell.file,
|
||||
element: ifcopenshell.entity_instance,
|
||||
also_consider: list[ifcopenshell.entity_instance] = [],
|
||||
do_not_delete: list[ifcopenshell.entity_instance] = [],
|
||||
do_not_delete: set[ifcopenshell.entity_instance] = set(),
|
||||
) -> None:
|
||||
"""Recursively purges a subgraph safely, starting at an element
|
||||
|
||||
@@ -1462,6 +1462,8 @@ def remove_deep2(
|
||||
|
||||
:param ifc_file: The IFC file object
|
||||
:param also_consider: elements to also consider as a part of a subgraph
|
||||
Order could matter for perfomance - elements that reference `element`
|
||||
directly should go first for the better performance.
|
||||
:param do_not_delete: elements to protect from deletion
|
||||
:param element: The starting element that defines the subgraph
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user