Skip to content

DebuggerHelper

QuantConnect.AlgorithmFactory.DebuggerHelper

Bases: Object

Helper class used to start a new debugging session

DebuggingMethod

Bases: IntEnum

The different implemented debugging methods

LOCAL_CMDLINE

LOCAL_CMDLINE = 0

Local debugging through cmdline. Language.PYTHON will use built in 'pdb'

VISUAL_STUDIO

VISUAL_STUDIO = 1

Visual studio local debugging. Language.PYTHON will use 'Python Tools for Visual Studio', attach manually selecting Python code type.

PTVSD

PTVSD = 2

Python Tool for Visual Studio Debugger for remote python debugging. Language.PYTHON. Deprecated, routes to DebugPy which is it's replacement. Used in the same way.

DEBUG_PY

DEBUG_PY = 3

DebugPy - a debugger for Python. Language.PYTHON can use Python Extension in VS Code or attach to Python in Visual Studio

PY_CHARM

PY_CHARM = 4

PyCharm PyDev Debugger for remote python debugging. Language.PYTHON will use 'Python Debug Server' in PyCharm

initialize

initialize(
    language: Language,
    workers_initialization_callback: Optional[
        Callable[[], Any]
    ],
) -> Tuple[None, Callable[[], Any]]

Will start a new debugging session

Parameters:

Name Type Description Default
language Language

The algorithms programming language

required
workers_initialization_callback Optional[Callable[[], Any]]

Optionally, the debugging method will set an action which the data stack workers should execute so we can debug code executed by them, this is specially important for python.

required