@@ -131,17 +131,17 @@ class SchemaError(Error):
131131
132132@overload
133133def open (
134- path : Union [os .PathLike , str ], format : Optional [ str ] = None , * , should_stream : Literal [False ] = False
134+ path : Union [os .PathLike , str ], format : SupportedFormat = None , * , should_stream : Literal [False ] = False
135135) -> Union [_file , sqlite ]: ...
136136@overload
137- def open (path : Union [os .PathLike , str ], format : Optional [ str ] = None , * , should_stream : Literal [True ]) -> _stream : ...
137+ def open (path : Union [os .PathLike , str ], format : SupportedFormat = None , * , should_stream : Literal [True ]) -> _stream : ...
138138@overload
139139def open (
140- path : Union [os .PathLike , str ], format : Optional [ str ] = None , * , should_stream : bool = False , readonly : bool = False
140+ path : Union [os .PathLike , str ], format : SupportedFormat = None , * , should_stream : bool = False , readonly : bool = False
141141) -> Union [_file , sqlite , _stream ]: ...
142142def open (
143143 path : Union [os .PathLike , str ],
144- format : Optional [ str ] = None ,
144+ format : SupportedFormat = None ,
145145 should_stream : bool = False ,
146146 readonly : bool = False ,
147147 mmap : bool = False ,
@@ -153,8 +153,7 @@ def open(
153153 for reading large files.
154154
155155 You can specify a file format. If no format is given, it is guessed from
156- its extension. Currently supported specified format: .ifc | .ifcZIP |
157- .ifcXML.
156+ its extension.
158157
159158 You can then filter by element ID, class, etc, and subscript by id or guid.
160159
@@ -200,12 +199,12 @@ def open(
200199 f .bypass_type (ty )
201200 if mmap :
202201 # mmap parameter is only available for builds with USE_MMAP, not used in our main builds
203- f .initialize (str (path .absolute ()), mmap = mmap ) # type : ignore[unknown-argument]
202+ f .initialize (str (path .absolute ()), mmap = mmap ) # ty : ignore[unknown-argument]
204203 else :
205204 f .initialize (str (path .absolute ()))
206205 elif mmap :
207206 # mmap parameter is only available for builds with USE_MMAP, not used in our main builds
208- f = ifcopenshell_wrapper .open (str (path .absolute ()), mmap = mmap ) # type : ignore[unknown-argument]
207+ f = ifcopenshell_wrapper .open (str (path .absolute ()), mmap = mmap ) # ty : ignore[unknown-argument]
209208 else :
210209 f = ifcopenshell_wrapper .open (str (path .absolute ()))
211210 return file (f )
@@ -288,7 +287,10 @@ def schema_by_name(
288287 return ifcopenshell_wrapper .schema_by_name (schema )
289288
290289
291- def guess_format (path : Path ) -> Literal [".ifc" , ".ifcZIP" , ".ifcXML" , ".ifcJSON" , ".ifcSQLite" , None ]:
290+ SupportedFormat = Literal [".ifc" , ".ifcZIP" , ".ifcXML" , ".ifcJSON" , ".ifcSQLite" , "rocksdb" , None ]
291+
292+
293+ def guess_format (path : Path ) -> SupportedFormat :
292294 """Guesses the IFC format using file extension
293295
294296 IFCs may be serialised as different formats. The most common is a ``.ifc``
0 commit comments