bonsai - fix ifcsqlite import (546a042)

This commit is contained in:
Andrej730
2025-11-04 18:55:04 +05:00
parent 04d1fe4052
commit a50c8869a5
2 changed files with 13 additions and 0 deletions
@@ -18,6 +18,7 @@
from __future__ import annotations from __future__ import annotations
import re import re
import json import json
import types
import numpy as np import numpy as np
import numpy.typing as npt import numpy.typing as npt
import ifcopenshell import ifcopenshell
@@ -316,6 +317,14 @@ class sqlite(file):
# The best option we've got for mimicing `file.schema_identifier`. # The best option we've got for mimicing `file.schema_identifier`.
return self._schema return self._schema
@property
def header(self) -> types.SimpleNamespace:
# Mimicking `file_header` object from `ifcopenshell.file`.
header = types.SimpleNamespace(
file_description=types.SimpleNamespace(description=(self.mvd_str,)),
)
return header
class sqlite_entity(entity_instance): class sqlite_entity(entity_instance):
sqlite_wrapper: sqlite_wrapper sqlite_wrapper: sqlite_wrapper
@@ -294,6 +294,10 @@ try:
f"No `wrapped_data` for {class_name}. `ifcopenshell.{class_name}` is probably confused with `ifcopenshell.file`." f"No `wrapped_data` for {class_name}. `ifcopenshell.{class_name}` is probably confused with `ifcopenshell.file`."
) )
@property
def header(self) -> NoReturn:
raise NotImplementedError("`stream.header` is not implemented yet.")
@property @property
def schema(self) -> ifcopenshell.util.schema.IFC_SCHEMA: def schema(self) -> ifcopenshell.util.schema.IFC_SCHEMA:
return self._schema return self._schema