Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IVS-99 IFC105 resource entities ... #329

Open
wants to merge 7 commits into
base: development
Choose a base branch
from

Conversation

aothms
Copy link
Collaborator

@aothms aothms commented Dec 19, 2024

Still needs some clean-up, readme, comments, etc. But the parts that I wanted to socialize is mostly the given step to do pre-computation that is referenced in the then-step: Given a traversal over the full model originating from subtypes of IfcRoot. Because it's much more efficient to do a 'flood fill' first starting the IfcRoot elements traversing over everything reachable, then trying to reconnect this on an individual instance basis without pre-computation.

@aothms aothms requested a review from Ghesselink December 19, 2024 13:25
@aothms aothms requested a review from civilx64 December 19, 2024 13:30
Copy link
Contributor

@Ghesselink Ghesselink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, especially the traversal over the full model step :-)


I'm rephrasing out loud, let me know if I miss something.

In Given a traversal over the full model originating from subtypes of IfcRoot, we start by identifying all the subtypes of IfcRoot (7 entities in the test file). The names function determines the names of all attributes for each of these entities. The list of traversed or visited entities, derived from these attributes and the initial 7 entities, is stored in context.visited_instances.

We then compare the visited instances with the full list of entity instances in the model. For example, in the failing test file, #64=IFCPRODUCTDEFINITIONSHAPE($,$,(#63)); is no longer visited. This is because the removal of IfcSpace results in a missing link between IfcSpace and all the attributes traversed from #64 (and also #46).


Because it's much more efficient to do a 'flood fill' first starting the IfcRoot elements traversing over everything reachable, then trying to reconnect this on an individual instance basis without pre-computation.

  • Should we consider using these functionalities and caching further in the validation service? I feel that (let's see if I can verify this with the metrics we collected) we could save a lot of processing time by saving the entity instances linked to a model in the cache.

  • I've updated the ifcopenshell version, Scott and Rick Brice did some work that were I think not reflected yet and causes some of the tests to fail.

  • GEM105 in the testfiles should probably be IFC105.

return set()

visited = set()
def visit(inst, path=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what is path used? I see it's passed as an argument in he visit function in
visit(ref, (path or ()) + (inst, attr,))
But not where it's functional, or am I missing something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I used it for debugging.

When deleting the Space from the test model to create the fail file at first it didn't cause any issues, basically due to the path of Project -fwd-> RepresentationContext -inv-> Representation. This caused me to revisit the approach to not allow all inverse attributes, but only 1 for now.

@aothms
Copy link
Collaborator Author

aothms commented Dec 20, 2024

Should we consider using these functionalities and caching further in the validation service? I feel that (let's see if I can verify this with the metrics we collected) we could save a lot of processing time by saving the entity instances linked to a model in the cache.

From the top of my head I cannot think of cases where it would make a big difference. I thought most rules are fairly 'unary' i.e they only concern the element in question, but not much relational context that could be preprocesed. But you obviously have a better understanding of the full body of rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants