Study Object¶
A Study object in VOR Stream contains the following data:
Data | Description | Data Type |
---|---|---|
Name | Name of study | String |
ID | ID of the study (generated) | Integer |
Desc | Description of study | String |
UserName | User name that created the study | String |
UserID | User ID that created the study | String |
UserEmail | User email that created the study | String |
Version | Version number of the study | Integer |
Created | DateTime when the study was created | DateTime |
Scenarios | Details about scenarios included in study | Structure |
Methodology | Details about the methodology included in the study | Structure |
Options | Details about options selected for the study | Structure |
The Methodology structure within the Study object contains the following data:
Data | Description | Data Type |
---|---|---|
Name | Name of methodology | String |
ID | ID of methodology (generated) | Integer |
Frameworks | Frameworks included in the methodology | Structure |
Global Filters | Global filters applied to methodology | Structure |
The Framework structure within the Methodology structure contains the following data:
Data | Description | Data Type |
---|---|---|
Name | Name of framework | String |
ID | ID of the framework (generated) | Integer |
Type Code | Type of framework | String |
Models | Models contained in the framework | Structure |
Filter | Filter applied to framework | Structure |
Each Models structure in a Framework structure contains the following data:
Data | Description | Data_Type |
---|---|---|
Name | Name of model | String |
ID | ID of model (generated) | Integer |
Description | Model description | String |
Definition | Model definition | String |
Type Code | Type of model | String |
Type Description | Description of the model type | String |
Filter | Filter applied to model | Structure |
In VOR Stream filters at the methodology, framework, and model level. The Filter structure at each of these levels contains the following data:
Data | Description | Data Type |
---|---|---|
ID | ID of filter (generated) | Integer |
Type Code | Type of filter | String |
Description | Description of filter | String |
Value | Value of filter | String |
Negate Flag | If the filter should be negated | String |
If scenarios are included in the study, the Scenarios structure within the Study object contains the following data:
Data | Description | Data Type |
---|---|---|
Name | Name of the scenario | String |
ID | ID of the scenario (generated) | Integer |
Version | Version of the scenario | Integer |
Description | Description of scenario | String |
Type | Type of scenario | String |
Base Date | Base date of scenario | Time |
Stress Type | Type of stress scenario | String |
Category | Category of scenario | String |
Frequency | Frequency of scenario | String |
Weight | Weight of scenario inside study | Float |
Upload | Upload ID that created scenario | Integer |
Lastly, the Options structure within the Study object contains the following data:
Data | Description | Data Type |
---|---|---|
As of Date | When study was created | Time |
Save Results | Where to save the study results | String |
Output Currency | The currency of the study results | String |
Email Notification | If the user wants to receive an email | String |
Percent to Process | How much of the study to process before showing preliminary results | Float |
To retrieve data about a study, pass the study's unique numeric identifier to the GetStudy function in Golang or the get_study function in Python.
Get Study Object, Golang Example¶
studyDetails, err := sdkClient.GetStudy(StudyID)
if err != nil {
log.Fatal(err)
}
// Get study options using GetStudy
studyOptions, err := studyDetails.GetOptionJson().UnmarshalNewMap()
if err != nil {
log.Errorln(err)
}
log.Printf("%+v", studyOptions)
// Get study options using GetStudyOptions
studyOptions, err = sdkClient.GetStudyOptions(study.GetId())
if err != nil {
log.Errorln(err)
}
log.Printf("%+v", studyOptions)
Get Study Object, Python Example¶
from sdk import study
from sdk import upload
import datetime
mystudy = study.get_study(studyID)
study_options = study.unpack_map(my_study.option_json)
>>> mystudy.name
First Study
# Grab the AsOfDate in string format
>>> study_options['as_of_date']
'2021-07-14T00:00:00.000Z'
# Convert AsOfDate string into datetime format
>>> datetime.datetime.strptime(study_options['as_of_date'], '%Y-%m-%dT%H:%M:%S.%fZ').date()
datetime.date(2021, 7, 14)
# Grab the names of all attached uploads
first = True
>>> for scenario in mystudy.scenarios:
... if first:
... upload_id = scenario.scenario.id
... upload.get_upload(upload_id).name
... first = False
... "Name: {}, Weight: {}".format(scenario.scenario.name, scenario.weight)
CECL_Economic_Scenario_31MAY2021_5.xlsx
'Name: Severe Data, Weight: 0.2'
'Name: Adverse Data, Weight: 0.2'
'Name: Baseline Data, Weight: 0.2'
'Name: Pandemic Data, Weight: 0.2'
'Name: Benign Data, Weight: 0.2'