From 6c590bf0082b3c56a9cbca30c60fec376eb89a93 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Sat, 11 Jul 2026 19:44:56 +0100 Subject: [PATCH] Fix schema mismatch in ColumnPSetsOfSets.ifc test fixture The fixture declared FILE_SCHEMA(('IFC2X3')) but used IFCPROPERTYSETDEFINITIONSET(...), a defined type that only exists in IFC4+ (confirmed absent from the generated Ifc2x3-schema.cpp/ Ifc2x3-definitions.h, present in the IFC4 equivalents). The file's own FILE_NAME record ('Column_4x3.ifc') suggests it was originally exported as IFC4X3 and the schema tag was later miscopied to IFC2X3. Traced with an instrumented parser build: on encountering the unrecognized keyword, declaration_by_name() correctly throws "Entity with name 'IFCPROPERTYSETDEFINITIONSET' not found in schema 'IFC2X3'", caught by the existing IfcException handler in in_memory_file_storage::load(). The parser then falls back to parsing the trailing (#136,#138) as a plain nested SET rather than the typed value, so RelatingPropertyDefinition ends up as a bare tuple instead of an IfcPropertySetDefinitionSet-wrapped value with .is_a(). This is correct, expected behavior for content that doesn't match its declared schema - not a parser bug. Fixing the header to IFC4 (which does declare the type) resolves test_stream, test_file, and test_rocks in test_streaming_rocksdb_and_simpletyperefs.py. Generated with the assistance of an AI coding tool. --- src/ifcopenshell-python/test/fixtures/ColumnPSetsOfSets.ifc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/test/fixtures/ColumnPSetsOfSets.ifc b/src/ifcopenshell-python/test/fixtures/ColumnPSetsOfSets.ifc index f124bb79db..0ab5ace614 100644 --- a/src/ifcopenshell-python/test/fixtures/ColumnPSetsOfSets.ifc +++ b/src/ifcopenshell-python/test/fixtures/ColumnPSetsOfSets.ifc @@ -2,7 +2,7 @@ ISO-10303-21; HEADER; FILE_DESCRIPTION(('ViewDefinition [CoordinationView]','RevitIdentifiers [ContentGUID: a0df3484-2dab-42c5-b806-8c10d313bee0, VersionGUID: 658c1394-f3a4-43d1-9b3c-eee44a0cd67a, NumberOfSaves: 2]','CoordinateReference [CoordinateBase: Shared Coordinates]'),'2;1'); FILE_NAME('Column_4x3.ifc','2025-03-12T13:53:30+00:00',(''),(''),'ODA SDAI 24.12','Autodesk Revit 25.4.0.32 (ENG) - IFC 25.4.0.32',''); -FILE_SCHEMA(('IFC2X3')); +FILE_SCHEMA(('IFC4')); ENDSEC; DATA; #1=IFCORGANIZATION($,'Autodesk Revit 2025 (ENG)',$,$,$);