Make remove_deep_batched the default since I'm the only guy using it so far and I'm feeling lucky! Let's battle test it!

This commit is contained in:
Dion Moult
2021-04-18 19:02:39 +10:00
parent 3201c234fa
commit 1e299a0ddd
@@ -119,17 +119,13 @@ def is_representation_of_context(representation, context, subcontext=None, targe
def remove_deep(ifc_file, element):
# @todo maybe some sort of try-finally mechanism.
ifc_file.batch()
subgraph = list(ifc_file.traverse(element))
subgraph_set = set(subgraph)
for ref in subgraph[::-1]:
if ref.id() and len(set(ifc_file.get_inverse(ref)) - subgraph_set) == 0:
ifc_file.remove(ref)
def remove_deep_batched(ifc_file, element):
# @todo maybe some sort of try-finally mechanism.
ifc_file.batch()
remove_deep(ifc_file, element)
ifc_file.unbatch()