Example of the error:
Traceback (most recent call last):
File "\test.py", line 133, in <module>
ifc_file = ifcopenshell.file.from_string(ifc_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\file.py", line 648, in from_string
return file(ifcopenshell_wrapper.read(s))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\ifcopenshell\file.py", line 264, in __init__
raise exc(msg)
ifcopenshell.SchemaError: Unsupported schema: IFC2X3
Exception ignored in: <function file.__del__ at 0x00000250896EB740>
Traceback (most recent call last):
File "\ifcopenshell\file.py", line 282, in __del__
del file_dict[self.file_pointer()]
^^^^^^^^^^^^^^^^^
File "\ifcopenshell\file.py", line 424, in __getattr__
return getattr(self.wrapped_data, attr)
^^^^^^^^^^^^^^^^^
File "\ifcopenshell\file.py", line 424, in __getattr__
return getattr(self.wrapped_data, attr)
^^^^^^^^^^^^^^^^^
File "\ifcopenshell\file.py", line 424, in __getattr__
return getattr(self.wrapped_data, attr)
^^^^^^^^^^^^^^^^^
[Previous line repeated 996 more times]
RecursionError: maximum recursion depth exceeded
Simple way to trigger those recursions was:
import ifcopenshell
ifcopenshell.file(schema="IFC4x3_RC4_43c3555")
ifcopenshell.entity_instance(("IFC4X3", "IfcPresentationStyleAssignment"))
The error is below.
It was failing because Callable was checking if `ifcopenshell.entity_instance` is a callable and at runtime actually it's not, it's a module.
In python 3.11 they've removed that check and therefore it's not throwing an error. Enabling forward annotations fixes it for python 3.10.
Not sure if there is a need to ensure `ifcopenshell.entity_instance` should be recgonized by python as a class at runtime rather than a module since we need it just for type checking and type checking seems to be clever enough to prioritize module classes over submodules.
File "C:\Users\user_name\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\blenderbim\bim\__init__.py", line 25, in <module>
from . import handler, ui, prop, operator, helper
File "C:\Users\user_name\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\blenderbim\bim\handler.py", line 23, in <module>
import ifcopenshell.api.owner.settings
File "C:\Users\user_name\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\__init__.py", line 85, in <module>
from .file import file
File "C:\Users\user_name\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\file.py", line 179, in <module>
class file:
File "C:\Users\user_name\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\blenderbim\libs\site\packages\ifcopenshell\file.py", line 382, in file
def __getattr__(self, attr) -> Union[Any, Callable[..., ifcopenshell.entity_instance]]:
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\python\lib\typing.py", line 1206, in __getitem__
return self.__getitem_inner__(params)
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\python\lib\typing.py", line 312, in inner
return func(*args, **kwds)
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\python\lib\typing.py", line 1212, in __getitem_inner__
result = _type_check(result, msg)
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\python\lib\typing.py", line 176, in _type_check
raise TypeError(f"{msg} Got {arg!r:.100}.")
TypeError: Callable[args, result]: result must be a type. Got <module 'ifcopenshell.entity_instance' from 'C:\\Users\\user_name\\AppData\\Roaming\\Blender F.
Sphinx autoapi also now only shows subpackages 1 level deep. This prevents us having a huge long list. Also don't show private or special members. Also show imported members so ifcopenshell.file and ifcopenshell.entity_instance works in docs too.
Transparently write any .ifc | .ifcXML | .ifcZIP formatted file
with any extension :
- by guessing format from its extension
(eg. .zip | .ifczip | .ifcZIP | .ifcXML | .ifcxml | .IFC | .ifc)
zipped file can file can be of any supported format
- by specifying a format
- by specifying if it should be zipped