Lean
$LEAN_TAG$
|
Helper class for Python initialization More...
Static Public Member Functions | |
static void | Initialize (bool beginAllowThreads=true) |
Initialize python. More... | |
static void | Shutdown () |
Shutdown python More... | |
static bool | AddPythonPaths (IEnumerable< string > paths) |
Adds directories to the python path at runtime More... | |
static void | AddAlgorithmLocationPath (string algorithmLocation) |
Adds the algorithm location to the python path. This will make sure that AddPythonPaths keeps the algorithm location path at the beginning of the pythonpath. More... | |
static void | ResetAlgorithmLocationPath () |
Resets the algorithm location path so another can be set More... | |
static bool | ActivatePythonVirtualEnvironment (string pathToVirtualEnv) |
"Activate" a virtual Python environment by prepending its library storage to Pythons path. This allows the libraries in this venv to be selected prior to our base install. Requires PYTHONNET_PYDLL to be set to base install. More... | |
Helper class for Python initialization
Definition at line 31 of file PythonInitializer.cs.
|
static |
Initialize python.
In some cases, we might not need to call BeginAllowThreads, like when we're running in a python or non-threaded environment. In those cases, we can set the beginAllowThreads parameter to false.
Definition at line 51 of file PythonInitializer.cs.
|
static |
Shutdown python
Definition at line 76 of file PythonInitializer.cs.
|
static |
Adds directories to the python path at runtime
Definition at line 100 of file PythonInitializer.cs.
|
static |
Adds the algorithm location to the python path. This will make sure that AddPythonPaths keeps the algorithm location path at the beginning of the pythonpath.
Definition at line 159 of file PythonInitializer.cs.
|
static |
Resets the algorithm location path so another can be set
Definition at line 180 of file PythonInitializer.cs.
|
static |
"Activate" a virtual Python environment by prepending its library storage to Pythons path. This allows the libraries in this venv to be selected prior to our base install. Requires PYTHONNET_PYDLL to be set to base install.
If a module is already loaded, Python will use its cached version first these modules must be reloaded by reload() from importlib library
Definition at line 192 of file PythonInitializer.cs.