|
32 | 32 | password = "<apiKey>" |
33 | 33 |
|
34 | 34 | pa_document_name = "PA_DOCUMENTS:DEFAULT" |
| 35 | +pa_component_name = "Weights" |
| 36 | +pa_component_category = "Weights / Exposures" |
35 | 37 | pa_benchmark_sp_50 = "BENCH:SP50" |
36 | 38 | pa_benchmark_r_1000 = "BENCH:R.1000" |
37 | 39 | spar_document_name = "pmw_root:/spar_documents/Factset Default Document" |
| 40 | +spar_component_name = "Returns Data" |
| 41 | +spar_component_category = "Raw Data / Returns" |
38 | 42 | spar_benchmark_r_1000 = "R.1000" |
39 | 43 | spar_benchmark_russell_pr_2000 = "RUSSELL_P:R.2000" |
40 | 44 | spar_benchmark_russell_prefix = "RUSSELL" |
41 | 45 | spar_benchmark_russell_return_type = "GTR" |
42 | 46 | vault_document_name = "PA3_DOCUMENTS:DEFAULT" |
| 47 | +vault_component_name = "Exposures" |
| 48 | +vault_component_category = "General / Positioning" |
43 | 49 | vault_default_account = "Client:/analytics/data/US_MID_CAP_CORE.ACTM" |
44 | 50 | vault_startdate = "FIRST_REPOSITORY" |
45 | 51 | vault_enddate = "LAST_REPOSITORY" |
|
60 | 66 | components_api = ComponentsApi(api_client) |
61 | 67 |
|
62 | 68 | components = components_api.get_pa_components(pa_document_name) |
63 | | -component_id = list(components.keys())[0] |
| 69 | +component_id = list((dict(filter(lambda component: (component[1].name == pa_component_name and component[1].category == pa_component_category), components.items()))).keys())[0] |
64 | 70 |
|
65 | 71 | pa_account_identifier = PAIdentifier(pa_benchmark_sp_50) |
66 | 72 | pa_accounts = [pa_account_identifier] |
|
71 | 77 | pa_calculation_parameters = {"1": PACalculationParameters(component_id, pa_accounts, pa_benchmarks, pa_dates)} |
72 | 78 |
|
73 | 79 | components = components_api.get_spar_components(spar_document_name) |
74 | | -component_id = list(components.keys())[0] |
| 80 | +component_id = list((dict(filter(lambda component: (component[1].name == spar_component_name and component[1].category == spar_component_category), components.items()))).keys())[0] |
75 | 81 |
|
76 | 82 | spar_account_identifier = SPARIdentifier(spar_benchmark_r_1000, spar_benchmark_russell_return_type, spar_benchmark_russell_prefix) |
77 | 83 | spar_accounts = [spar_account_identifier] |
|
81 | 87 | spar_calculation_parameters = {"2": SPARCalculationParameters(component_id, spar_accounts, spar_benchmark_identifier, spar_dates)} |
82 | 88 |
|
83 | 89 | components = components_api.get_vault_components(vault_document_name) |
84 | | -component_id = list(components.keys())[0] |
| 90 | +component_id = list((dict(filter(lambda component: (component[1].name == vault_component_name and component[1].category == vault_component_category), components.items()))).keys())[0] |
85 | 91 |
|
86 | 92 | vault_account_identifier = VaultIdentifier(vault_default_account) |
87 | 93 | vault_dates = VaultDateParameters(vault_startdate, vault_enddate, frequency) |
|
0 commit comments