This tutorial guides you through configuring an environment within the SigTech platform before you begin your analysis.
This page assumes you have started a research environment on the Sigtech platform. If you have not:
- 2.Select Research.
- 4.Configure your research environment using the Set up your Research Environment window.
- 5.Select Start Research Environment.
- 6.Open an instance of your preferred IDE.
You are required to import the
import sigtech.framework as sig
Import any python libraries you require. For example:
import datetime as dtm
import pandas as pd
import numpy as np
import seaborn as sns
To see the complete list of libraries you can import without installing, run
help('modules'). To see a list of the supported libraries and versions run
%pip install. Please note that
%pip installdoes not show all supported Python libraries.
After importing the necessary libraries, you must initialize your environment. Initialization is performed with the command
sig.init(env_date=dtm.datetime(2020, 7, 1, 11))
# this sets the env_date to July 1st 2020, at 11:00am
The following parameters can be used during environment initialization:
When configuring your environment, the
log_levelargument lets you set log messages and exactly what kind of information is displayed. There are four log levels:
'ERROR'- displays error messages that are fatal to the code operation.
'WARNING'- displays information that can explain application oddities or issues. These issues are not 'fatal' and will not disrupt the code.
- Selecting this level will cause both
'WARNING'messages to be displayed.
'DEBUG'- displays information that is diagnostically helpful. For example, a debug message could be
'stopping Strategy Service'.
- Selecting this level will cause
'DEBUG'messages to all be displayed..
'INFO'- displays all useful information such as configuration assumptions, success messages, etc.
- This level displays all
After the initialization of the environment, several additional configurations can be made.
In the following code block,
TM_TIMEZONEhave been included:
The following parameters can be used to further configure the environment:
Note: to destroy your configured environment and clear the cache in preparation for initializing a new environment,
Sometimes, you may want to re-initialize an environment with new parameters. Attempts to re-initialize an already initialized environment will produce different behaviour based on the value of the
repeat_modeparameter. This parameter controls how the environment behaves if
init()is called more than once (i.e. you reinitialize an environment). The three
repeat_modeoptions are as follows:
'reinit'- runs the
de_init()command (destroying the environment) and then runs
init()again (creating a new environment).
'error'- if a second
init()command is called, this command is terminated and an error is displayed explaining why.
'warning'- the second
init()command is allowed to finish and a warning is displayed that another environment has been created.
sig.init()performs the same function as
These behaviors are described in the code block below:
# The environment is now initialized
# The call above has no effect (default is 'warning')
# The call above destroys the current environment and creates a new one
# The execution terminates with an error