RMI-PACTA / PACTA_analysis

Run the PACTA analysis on EQ & CB portfolios
Other
25 stars 71 forks source link

bonds and equity with valid_input==FALSE #20

Open cjyetman opened 4 years ago

cjyetman commented 4 years ago

I found a few cases where bond and/or equity holdings have valid_input==FALSE. My expectation, after the change in #17, is that this should not be possible? (based on data created on 2020-04-09 16:00:26 CEST)

library(fs)
library(dplyr)
this_project_dir <- path_expand('~/Dropbox (2° Investing)/PortCheck_v2/10_Projects/PACTA_2020_TESTS_CJ')

file_info(path(this_project_dir, '30_Processed_Inputs', 
               'PACTA_2020_TESTS_CJ_audit_file.rda'))$modification_time
# [1] "2020-04-09 16:00:26 CEST"

path(this_project_dir,
     '30_Processed_Inputs', 'PACTA_2020_TESTS_CJ_audit_file.rda') %>%
  readRDS() %>%
  as_tibble() %>%
  filter(asset_type %in% c('Bonds', 'Equity')) %>% 
  filter(valid_input == FALSE) %>% 
  select(investor_name, portfolio_name, holding_id, isin, value_usd, 
         asset_type, valid_input)

# # A tibble: 9 x 7
#   investor_name    portfolio_name   holding_id isin   value_usd asset_type valid_input
#   <chr>            <chr>            <chr>      <chr>      <dbl> <chr>      <lgl>      
# 1 Platform Sample… Asian Portfolio  305        TW000…       NA  Equity     FALSE      
# 2 Platform Sample… Asian Portfolio  357        XS202…       NA  Bonds      FALSE      
# 3 Platform Sample… Mixed Portfolio  14293      INE00…   498171. Equity     FALSE      
# 4 Platform Sample… Platform Sample… 19304      TW000…       NA  Equity     FALSE      
# 5 Platform Sample… Platform Sample… 19356      XS202…       NA  Bonds      FALSE      
# 6 Platform Sample… Platform Sample… 33292      INE00…   498171. Equity     FALSE      
# 7 Meta Investor    Meta Portfolio   38303      TW000…       NA  Equity     FALSE      
# 8 Meta Investor    Meta Portfolio   38355      XS202…       NA  Bonds      FALSE      
# 9 Meta Investor    Meta Portfolio   52291      INE00…   498171. Equity     FALSE      
cjyetman commented 4 years ago

I don't even remember why this was a concern, but it does seem to still be happening, even though it was supposedly resolved according to https://github.com/2DegreesInvesting/PACTA_analysis/issues/17#issuecomment-611549921

@Clare2D is this a problem?

library(dplyr)

source("web_tool_script_1.R")

file.path('working_dir/30_Processed_Inputs/TestPortfolio_Input/audit_file.rda') %>%
  readRDS() %>%
  as_tibble() %>%
  filter(asset_type %in% c('Bonds', 'Equity')) %>% 
  filter(valid_input == FALSE) %>% 
  select(investor_name, portfolio_name, holding_id, isin, value_usd, 
         asset_type, valid_input)

# # A tibble: 2 x 7
#   investor_name portfolio_name      holding_id isin         value_usd asset_type valid_input
#   <chr>         <chr>               <chr>      <chr>            <dbl> <chr>      <lgl>      
# 1 Test          TestPortfolio_Input 1486       MHY0436Q1098      750. Equity     FALSE      
# 2 Test          TestPortfolio_Input 1552       US69047Q1022      284. Equity     FALSE     
Clare2D commented 4 years ago

Is there a flag you can also select and review here?

cjyetman commented 4 years ago

flag?

Clare2D commented 4 years ago

A text string describing anything?

cjyetman commented 3 years ago

using current master 926d584eafd2d07c32017cf580dede5195775773

library(dplyr)

source("web_tool_script_1.R")

file.path('working_dir/30_Processed_Inputs/TestPortfolio_Input/audit_file.rda') %>%
  readRDS() %>%
  as_tibble() %>%
  filter(asset_type %in% c('Bonds', 'Equity')) %>% 
  filter(valid_input == FALSE) %>% 
  select(investor_name, portfolio_name, holding_id, isin, value_usd, 
         asset_type, valid_input, flag)

# # A tibble: 1 x 8
#   investor_name portfolio_name      holding_id isin         value_usd asset_type valid_input flag                             
#   <chr>         <chr>               <chr>      <chr>            <dbl> <chr>      <lgl>       <chr>                            
# 1 Test          TestPortfolio_Input 1143       US53601P3047     5862. Equity     FALSE       Holding not in Bloomberg database