diff --git a/src/ifcopenshell-python/ifcopenshell/entity_instance.py b/src/ifcopenshell-python/ifcopenshell/entity_instance.py index 62f1a03dab..f624effa1e 100644 --- a/src/ifcopenshell-python/ifcopenshell/entity_instance.py +++ b/src/ifcopenshell-python/ifcopenshell/entity_instance.py @@ -27,6 +27,9 @@ import numbers import itertools import operator import functools +import subprocess +import sys +import time from . import ifcopenshell_wrapper from . import settings diff --git a/src/ifcopenshell-python/ifcopenshell/express/rule_executor.py b/src/ifcopenshell-python/ifcopenshell/express/rule_executor.py index d7d20f2122..b91597e042 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rule_executor.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rule_executor.py @@ -81,7 +81,7 @@ def run(f, logger): orig = ifcopenshell.settings.unpack_non_aggregate_inverses ifcopenshell.settings.unpack_non_aggregate_inverses = True - fn = os.path.join(os.path.dirname(__file__), "rules", f"{f.schema}.py") + fn = os.path.join(os.path.dirname(__file__), "rules", f"{f.schema_identifier}.py") try: source = open(fn, "r").read() except FileNotFoundError as e: @@ -90,7 +90,7 @@ def run(f, logger): import subprocess current_dir_files = {fn.lower(): fn for fn in os.listdir('.')} - schema_name = str(f.schema).split(' ')[-1].lower() + schema_name = str(f.schema_identifier).split(' ')[-1].lower() schema_path = current_dir_files.get(schema_name + '.exp') fn = schema_path[:-4] + '.py' if not os.path.exists(fn): @@ -100,7 +100,7 @@ def run(f, logger): a = ast.parse(source) assertion.rewrite.rewrite_asserts(mod=a, source=source) - cd = compile(a, f"{f.schema}.py", "exec") + cd = compile(a, f"{f.schema_identifier}.py", "exec") scope = {} exec(cd, scope) S = ifcopenshell.ifcopenshell_wrapper.schema_by_name(f.schema_identifier) diff --git a/src/ifcopenshell-python/ifcopenshell/validate.py b/src/ifcopenshell-python/ifcopenshell/validate.py index bd1b8cfd66..debe8e9d09 100644 --- a/src/ifcopenshell-python/ifcopenshell/validate.py +++ b/src/ifcopenshell-python/ifcopenshell/validate.py @@ -328,7 +328,7 @@ def validate(f, logger, express_rules=False): log_internal_cpp_errors(filename, logger) - schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(f.schema) + schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(f.schema_identifier) for inst in f: if hasattr(logger, "set_state"): logger.set_state('instance', inst)