Lean  $LEAN_TAG$
QuantConnect.Util.PythonUtil Class Reference

Collection of utils for python objects processing More...

Static Public Member Functions

static Action< T1 > ToAction< T1 > (PyObject pyObject)
 Encapsulates a python method with a System.Action<T1> More...
 
static Action< T1, T2 > ToAction< T1, T2 > (PyObject pyObject)
 Encapsulates a python method with a System.Action<T1, T2> More...
 
static Func< T1, T2 > ToFunc< T1, T2 > (PyObject pyObject)
 Encapsulates a python method with a System.Func<T1, T2> More...
 
static Func< T1, T2, T3 > ToFunc< T1, T2, T3 > (PyObject pyObject)
 Encapsulates a python method with a System.Func<T1, T2, T3> More...
 
static Func< IEnumerable< CoarseFundamental >, IEnumerable< Symbol > > ToCoarseFundamentalSelector (PyObject pyObject)
 Encapsulates a python method in coarse fundamental universe selector. More...
 
static Func< IEnumerable< FineFundamental >, IEnumerable< Symbol > > ToFineFundamentalSelector (PyObject pyObject)
 Encapsulates a python method in fine fundamental universe selector. More...
 
static string PythonExceptionParser (PythonException pythonException)
 Parsers PythonException into a readable message More...
 
static string PythonExceptionMessageParser (string message)
 Parsers Exception.Message into a readable message More...
 
static string PythonExceptionStackParser (string value)
 Parsers PythonException.StackTrace into a readable message More...
 
static IEnumerable< SymbolConvertToSymbols (PyObject input)
 Convert Python input to a list of Symbols More...
 

Properties

static int ExceptionLineShift = 0 [get, set]
 The python exception stack trace line shift to use More...
 

Detailed Description

Collection of utils for python objects processing

Definition at line 32 of file PythonUtil.cs.

Member Function Documentation

◆ ToAction< T1 >()

static Action<T1> QuantConnect.Util.PythonUtil.ToAction< T1 > ( PyObject  pyObject)
static

Encapsulates a python method with a System.Action<T1>

Template Parameters
T1The input type
Parameters
pyObjectThe python method
Returns
A System.Action<T1> that encapsulates the python method

Definition at line 49 of file PythonUtil.cs.

◆ ToAction< T1, T2 >()

static Action<T1, T2> QuantConnect.Util.PythonUtil.ToAction< T1, T2 > ( PyObject  pyObject)
static

Encapsulates a python method with a System.Action<T1, T2>

Template Parameters
T1The first input type
T2The second input type type
Parameters
pyObjectThe python method
Returns
A System.Action<T1, T2> that encapsulates the python method

Definition at line 70 of file PythonUtil.cs.

◆ ToFunc< T1, T2 >()

static Func<T1, T2> QuantConnect.Util.PythonUtil.ToFunc< T1, T2 > ( PyObject  pyObject)
static

Encapsulates a python method with a System.Func<T1, T2>

Template Parameters
T1The data type
T2The output type
Parameters
pyObjectThe python method
Returns
A System.Func<T1, T2> that encapsulates the python method

Definition at line 91 of file PythonUtil.cs.

◆ ToFunc< T1, T2, T3 >()

static Func<T1, T2, T3> QuantConnect.Util.PythonUtil.ToFunc< T1, T2, T3 > ( PyObject  pyObject)
static

Encapsulates a python method with a System.Func<T1, T2, T3>

Template Parameters
T1The first argument's type
T2The first argument's type
T3The output type
Parameters
pyObjectThe python method
Returns
A System.Func<T1, T2, T3> that encapsulates the python method

Definition at line 113 of file PythonUtil.cs.

◆ ToCoarseFundamentalSelector()

static Func<IEnumerable<CoarseFundamental>, IEnumerable<Symbol> > QuantConnect.Util.PythonUtil.ToCoarseFundamentalSelector ( PyObject  pyObject)
static

Encapsulates a python method in coarse fundamental universe selector.

Parameters
pyObjectThe python method
Returns
A Func<T, TResult> (parameter is IEnumerable<CoarseFundamental>, return value is IEnumerable<Symbol>) that encapsulates the python method

Definition at line 132 of file PythonUtil.cs.

◆ ToFineFundamentalSelector()

static Func<IEnumerable<FineFundamental>, IEnumerable<Symbol> > QuantConnect.Util.PythonUtil.ToFineFundamentalSelector ( PyObject  pyObject)
static

Encapsulates a python method in fine fundamental universe selector.

Parameters
pyObjectThe python method
Returns
A Func<T, TResult> (parameter is IEnumerable<FineFundamental>, return value is IEnumerable<Symbol>) that encapsulates the python method

Definition at line 150 of file PythonUtil.cs.

◆ PythonExceptionParser()

static string QuantConnect.Util.PythonUtil.PythonExceptionParser ( PythonException  pythonException)
static

Parsers PythonException into a readable message

Parameters
pythonExceptionThe exception to parse
Returns
String with relevant part of the stacktrace

Definition at line 168 of file PythonUtil.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PythonExceptionMessageParser()

static string QuantConnect.Util.PythonUtil.PythonExceptionMessageParser ( string  message)
static

Parsers Exception.Message into a readable message

Parameters
messageThe python exception message
Returns
String with relevant part of the stacktrace

Definition at line 178 of file PythonUtil.cs.

Here is the caller graph for this function:

◆ PythonExceptionStackParser()

static string QuantConnect.Util.PythonUtil.PythonExceptionStackParser ( string  value)
static

Parsers PythonException.StackTrace into a readable message

Parameters
valueString with the stacktrace information
Returns
String with relevant part of the stacktrace

Definition at line 202 of file PythonUtil.cs.

Here is the caller graph for this function:

◆ ConvertToSymbols()

static IEnumerable<Symbol> QuantConnect.Util.PythonUtil.ConvertToSymbols ( PyObject  input)
static

Convert Python input to a list of Symbols

Parameters
inputObject with the desired property
Returns
List of Symbols

Definition at line 315 of file PythonUtil.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

Property Documentation

◆ ExceptionLineShift

int QuantConnect.Util.PythonUtil.ExceptionLineShift = 0
staticgetset

The python exception stack trace line shift to use

Definition at line 41 of file PythonUtil.cs.


The documentation for this class was generated from the following file: