Support 4.x graphviz format 2 - #20
Conversation
This reverts commit 00e9f56.
…ists]" This reverts commit 61d4441.
Port the validation behavior from the reverted master commit into the refactored model implementation. Generated with the assistance of an AI coding tool.
Port GlobalId-based export handling into the refactored extraction path. Generated with the assistance of an AI coding tool.
Port the parent-default safeguard through the refactored immutable rule traversal. Generated with the assistance of an AI coding tool.
ef1f990 to
230f85a
Compare
|
Nice :) I tested it on models in validate and found a couple of small errors (incl fixes) see also 1. 2. **3. 4. The graphviz test fixture cannot construct an instance. ##tests Running ReferenceView_V1-2 end-to-end, concepts that crash:
|
There was a problem hiding this comment.
Nice :) I tested it on models in validate and found a couple of small errors (incl fixes)
see also
https://github.com/opensourceBIM/python-mvdxml/pull/21/changes
Is it OK to merge into support-4.x-graphviz-format-2?
1. _parse_mvdxml_token rejects unquoted parameter values.
Every value goes through ast.literal_eval, accepting python literals but mvdXML writes them unquoted, so ContextType[Value]=Model raises ValueError: malformed node or string on line 1: <ast.Name object> and CRSName[Value]=EPSG:5555 raises SyntaxError. There are 419 of them in ReferenceView_V1-2.mvdxml, and one of them takes down its whole concept. fix would be to to fall back to the stripped string,
2. validate() selects expressions one level too shallow.
[value[0] for value in self.rules()] assumes a flat list, but parse_template_rules isn't.. That gives TypeError: 'node' object is not iterable, IndexError: tuple index out of range on an empty group, and drops every ;-separated expression after the first: 16 checks skipped were skipped with 9 concepts (in ReferenceView_V1-2).
**3. [Type] assumes an ifcopenshell entity.instance **
is_a() doesn't have a type checkt, so str resulted in AttributeError: 'str' object has no attribute 'is_a'.fixed by using isinstance(item, ifcopenshell.entity_instance) first.
4. The graphviz test fixture cannot construct an instance.
It subclasses entity_instance, whose __setattr__/__getattr__ go through wrapped_data and a recursive without the underlying C++ class went on forever: RecursionError: maximum recursion depth exceeded. fix is to use a Mock spec'd on entity_instance
##tests
Running ReferenceView_V1-2 end-to-end, concepts that crash:
| model | concepts run | crashing before | after |
|---|---|---|---|
Molio_with_URIs.ifc) |
144 | 46 | 0 |
DuplexHouse_Heating_RME.ifc |
96 | 28 | 0 |
Duplex_MEP.ifc |
80 | 14 | 0 |
Sorry for the three reverts, I accidentally started off from an old branch point and quickest was to revert and reapply on top due to the large refactoring commit.