iblrig.tools.call_bonsai

iblrig.tools.call_bonsai(workflow_file, parameters=None, start=True, debug=False, bootstrap=True, editor=True, wait=True, check=False)[source]

Execute a Bonsai workflow within a subprocess call.

Parameters:
  • workflow_file (str | Path) – Path to the Bonsai workflow file.

  • parameters (dict[str, str], optional) – Parameters to be passed to Bonsai workflow.

  • start (bool, optional) – Start execution of the workflow within Bonsai (default is True).

  • debug (bool, optional) – Enable debugging mode if True (default is False). Only applies if editor is True.

  • bootstrap (bool, optional) – Enable Bonsai bootstrapping if True (default is True).

  • editor (bool, optional) – Enable Bonsai editor if True (default is True).

  • wait (bool, optional) – Wait for Bonsai process to finish (default is True).

  • check (bool, optional) – Raise CalledProcessError if Bonsai process exits with non-zero exit code (default is False). Only applies if wait is True.

Returns:

Pointer to the Bonsai subprocess if wait is False, otherwise subprocess.CompletedProcess.

Return type:

Popen[bytes] | Popen[str | bytes | Any] | CompletedProcess

Raises:

FileNotFoundError – If the Bonsai executable does not exist. If the specified workflow file does not exist.

Parameters: