From 8f67b905eba649e6915cf472fb181262a613bad0 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 3 Aug 2026 15:16:27 +0500 Subject: [PATCH] Fix `ifcopenshell.file` calls in rules fixtures, use simpler schema postfix --- ...2-ifc4x3_add2.ifc => fail-poly-curve-1-2-1-2-ifc4x3.ifc} | 0 ...gid-op-IfcPlaneAngleMeasure-IfcLengthMeasure-ifc4x3.ifc} | 4 ++-- src/ifcopenshell-python/test/fixtures/rules/generate_11.py | 3 ++- src/ifcopenshell-python/test/fixtures/rules/generate_18.py | 4 ++-- src/ifcopenshell-python/test/fixtures/rules/generate_25.py | 4 ++-- ...3-ifc4x3_add2.ifc => pass-poly-curve-1-2-2-3-ifc4x3.ifc} | 0 ...c4x3_add2.ifc => pass-poly-curve-no-segments-ifc4x3.ifc} | 0 ...op-IfcPlaneAngleMeasure-IfcPlaneAngleMeasure-ifc4x3.ifc} | 0 .../test/fixtures/validate/generate_00.py | 6 +++--- 9 files changed, 11 insertions(+), 10 deletions(-) rename src/ifcopenshell-python/test/fixtures/rules/{fail-poly-curve-1-2-1-2-ifc4x3_add2.ifc => fail-poly-curve-1-2-1-2-ifc4x3.ifc} (100%) rename src/ifcopenshell-python/test/fixtures/rules/{fail-rigid-op-IfcPlaneAngleMeasure-IfcLengthMeasure-ifc4x3_add2.ifc => fail-rigid-op-IfcPlaneAngleMeasure-IfcLengthMeasure-ifc4x3.ifc} (79%) rename src/ifcopenshell-python/test/fixtures/rules/{pass-poly-curve-1-2-2-3-ifc4x3_add2.ifc => pass-poly-curve-1-2-2-3-ifc4x3.ifc} (100%) rename src/ifcopenshell-python/test/fixtures/rules/{pass-poly-curve-no-segments-ifc4x3_add2.ifc => pass-poly-curve-no-segments-ifc4x3.ifc} (100%) rename src/ifcopenshell-python/test/fixtures/rules/{pass-rigid-op-IfcPlaneAngleMeasure-IfcPlaneAngleMeasure-ifc4x3_add2.ifc => pass-rigid-op-IfcPlaneAngleMeasure-IfcPlaneAngleMeasure-ifc4x3.ifc} (100%) diff --git a/src/ifcopenshell-python/test/fixtures/rules/fail-poly-curve-1-2-1-2-ifc4x3_add2.ifc b/src/ifcopenshell-python/test/fixtures/rules/fail-poly-curve-1-2-1-2-ifc4x3.ifc similarity index 100% rename from src/ifcopenshell-python/test/fixtures/rules/fail-poly-curve-1-2-1-2-ifc4x3_add2.ifc rename to src/ifcopenshell-python/test/fixtures/rules/fail-poly-curve-1-2-1-2-ifc4x3.ifc diff --git a/src/ifcopenshell-python/test/fixtures/rules/fail-rigid-op-IfcPlaneAngleMeasure-IfcLengthMeasure-ifc4x3_add2.ifc b/src/ifcopenshell-python/test/fixtures/rules/fail-rigid-op-IfcPlaneAngleMeasure-IfcLengthMeasure-ifc4x3.ifc similarity index 79% rename from src/ifcopenshell-python/test/fixtures/rules/fail-rigid-op-IfcPlaneAngleMeasure-IfcLengthMeasure-ifc4x3_add2.ifc rename to src/ifcopenshell-python/test/fixtures/rules/fail-rigid-op-IfcPlaneAngleMeasure-IfcLengthMeasure-ifc4x3.ifc index 7e32acbb8a..1808e7b1e5 100644 --- a/src/ifcopenshell-python/test/fixtures/rules/fail-rigid-op-IfcPlaneAngleMeasure-IfcLengthMeasure-ifc4x3_add2.ifc +++ b/src/ifcopenshell-python/test/fixtures/rules/fail-rigid-op-IfcPlaneAngleMeasure-IfcLengthMeasure-ifc4x3.ifc @@ -5,8 +5,8 @@ FILE_NAME('','2023-01-11T09:47:45',(),(),'IfcOpenShell v0.7.0-8a108f37','IfcOpen FILE_SCHEMA(('IFC4X3_ADD2')); ENDSEC; DATA; -#1=IFCGEOGRAPHICCRS('EPSG:4326',$,$,$,$); -#2=IFCGEOGRAPHICCRS('EPSG:3857',$,$,$,$); +#1=IFCGEOGRAPHICCRS('EPSG:4326',$,$,$,$,$); +#2=IFCGEOGRAPHICCRS('EPSG:3857',$,$,$,$,$); #3=IFCRIGIDOPERATION(#1,#2,IFCLENGTHMEASURE(0.),IFCPLANEANGLEMEASURE(0.),0.); ENDSEC; END-ISO-10303-21; diff --git a/src/ifcopenshell-python/test/fixtures/rules/generate_11.py b/src/ifcopenshell-python/test/fixtures/rules/generate_11.py index b70f71d6e4..cf49430e3f 100644 --- a/src/ifcopenshell-python/test/fixtures/rules/generate_11.py +++ b/src/ifcopenshell-python/test/fixtures/rules/generate_11.py @@ -1,9 +1,10 @@ import ifcopenshell +import ifcopenshell.util.schema depth = 1.0 for dir_x, dir_z in ((0.0, -1.0), (0.0, 0.0), (1.0, 0.0), (1.0, 0.001), (0.0, 1.0)): - schemas = ["IFC2X3"] + schemas: list[ifcopenshell.util.schema.IFC_SCHEMA] = ["IFC2X3"] if (dir_x, dir_z) == (0.0, 0.0): schemas.append("IFC4") diff --git a/src/ifcopenshell-python/test/fixtures/rules/generate_18.py b/src/ifcopenshell-python/test/fixtures/rules/generate_18.py index e551356b43..5c4bbdb0c1 100644 --- a/src/ifcopenshell-python/test/fixtures/rules/generate_18.py +++ b/src/ifcopenshell-python/test/fixtures/rules/generate_18.py @@ -1,7 +1,7 @@ import ifcopenshell for i, type_decl in enumerate(("IfcLengthMeasure", "IfcPlaneAngleMeasure")): - f = ifcopenshell.file(schema="IFC4X3_ADD1") + f = ifcopenshell.file(schema="IFC4X3") f.createIfcRigidOperation( SourceCRS=f.createIfcGeographicCRS("EPSG:4326"), TargetCRS=f.createIfcGeographicCRS("EPSG:3857"), @@ -9,4 +9,4 @@ for i, type_decl in enumerate(("IfcLengthMeasure", "IfcPlaneAngleMeasure")): SecondCoordinate=f.create_entity("IfcPlaneAngleMeasure", 0.0), Height=0.0, ) - f.write(f"{'pass' if i else 'fail'}-rigid-op-IfcPlaneAngleMeasure-{type_decl}-ifc4x3_add1.ifc") + f.write(f"{'pass' if i else 'fail'}-rigid-op-IfcPlaneAngleMeasure-{type_decl}-ifc4x3.ifc") diff --git a/src/ifcopenshell-python/test/fixtures/rules/generate_25.py b/src/ifcopenshell-python/test/fixtures/rules/generate_25.py index 78b540aea2..908f6763d6 100644 --- a/src/ifcopenshell-python/test/fixtures/rules/generate_25.py +++ b/src/ifcopenshell-python/test/fixtures/rules/generate_25.py @@ -6,11 +6,11 @@ segs = [ lambda f: [f.createIfcLineIndex((1, 2)), f.createIfcLineIndex((1, 2))], ] -for schema in ("ifc4", "ifc4x3_add1"): +for schema in ("IFC4", "IFC4X3"): for i, seg in enumerate(segs): f = ifcopenshell.file(schema=schema) s = seg(f) f.createIfcIndexedPolyCurve(f.createIfcCartesianPointList2D([(0.0, 0.0), (0.0, 1.0), (1.0, 1.0)]), s) f.write( - f'{"fail" if i == 2 else "pass"}-poly-curve-{"no-segments" if s is None else "-".join(["-".join(map(str, x[0])) for x in s])}-{schema}.ifc' + f'{"fail" if i == 2 else "pass"}-poly-curve-{"no-segments" if s is None else "-".join(["-".join(map(str, x[0])) for x in s])}-{schema.lower()}.ifc' ) diff --git a/src/ifcopenshell-python/test/fixtures/rules/pass-poly-curve-1-2-2-3-ifc4x3_add2.ifc b/src/ifcopenshell-python/test/fixtures/rules/pass-poly-curve-1-2-2-3-ifc4x3.ifc similarity index 100% rename from src/ifcopenshell-python/test/fixtures/rules/pass-poly-curve-1-2-2-3-ifc4x3_add2.ifc rename to src/ifcopenshell-python/test/fixtures/rules/pass-poly-curve-1-2-2-3-ifc4x3.ifc diff --git a/src/ifcopenshell-python/test/fixtures/rules/pass-poly-curve-no-segments-ifc4x3_add2.ifc b/src/ifcopenshell-python/test/fixtures/rules/pass-poly-curve-no-segments-ifc4x3.ifc similarity index 100% rename from src/ifcopenshell-python/test/fixtures/rules/pass-poly-curve-no-segments-ifc4x3_add2.ifc rename to src/ifcopenshell-python/test/fixtures/rules/pass-poly-curve-no-segments-ifc4x3.ifc diff --git a/src/ifcopenshell-python/test/fixtures/rules/pass-rigid-op-IfcPlaneAngleMeasure-IfcPlaneAngleMeasure-ifc4x3_add2.ifc b/src/ifcopenshell-python/test/fixtures/rules/pass-rigid-op-IfcPlaneAngleMeasure-IfcPlaneAngleMeasure-ifc4x3.ifc similarity index 100% rename from src/ifcopenshell-python/test/fixtures/rules/pass-rigid-op-IfcPlaneAngleMeasure-IfcPlaneAngleMeasure-ifc4x3_add2.ifc rename to src/ifcopenshell-python/test/fixtures/rules/pass-rigid-op-IfcPlaneAngleMeasure-IfcPlaneAngleMeasure-ifc4x3.ifc diff --git a/src/ifcopenshell-python/test/fixtures/validate/generate_00.py b/src/ifcopenshell-python/test/fixtures/validate/generate_00.py index 3d6db0620e..372c25a65b 100644 --- a/src/ifcopenshell-python/test/fixtures/validate/generate_00.py +++ b/src/ifcopenshell-python/test/fixtures/validate/generate_00.py @@ -7,12 +7,12 @@ import ifcopenshell.api.root guid1 = "3pdqyORIn8KBHZAhhtJ72T" guid2 = "1sEzC8v31DshmvW5t5P631" -for schema in ("ifc2x3", "ifc4", "ifc4x3"): +for schema in ("IFC2X3", "IFC4", "IFC4X3"): for status in ("fail", "pass"): f = ifcopenshell.file(schema=schema) # setup IfcOwnerHistory - if schema == "ifc2x3": + if schema == "IFC2X3": ifcopenshell.api.owner.add_application(f) person = ifcopenshell.api.owner.add_person(f) organization = ifcopenshell.api.owner.add_organisation(f) @@ -23,5 +23,5 @@ for schema in ("ifc2x3", "ifc4", "ifc4x3"): wall1.GlobalId = guid1 wall2.GlobalId = guid1 if status == "fail" else guid2 - filename = f"{status}-{'not-' if status == 'pass' else ''}duplicated-guids-{schema}.ifc" + filename = f"{status}-{'not-' if status == 'pass' else ''}duplicated-guids-{schema.lower()}.ifc" f.write(Path(__file__).parent / filename)