Model.export#

Model.export(path, use_slots=True, locked_spaces=None)[source]#

Export the model as a Python package.

This method performs the export_model() on self. See export_model() section for the details, including the limitations of the export.

Parameters:
  • path – The path where the generated Python package will be located.

  • use_slots (bool, optional) – Whether the generated Space classes declare __slots__. Defaults to True. See export_model().

  • locked_spaces (optional) – Spaces to export with a lock, so that several threads can share them on a free-threaded build of Python. An iterable of Space names relative to the model ("Parent.Child" for a nested Space) or Space objects; each listed Space is locked together with the Spaces below it. Defaults to None, which locks no Space. See export_model().

Added in version 0.22.0.

Changed in version 0.33.0: The use_slots and locked_spaces parameters are added, and the generated Space classes declare __slots__ by default.