bupaverse / pm4py

R Interface between bupaR and the PM4Py Process Mining library
https://bupaverse.github.io/pm4py/
GNU General Public License v3.0
16 stars 2 forks source link

Error in py_to_r.default(X[[i]], ...) : Object to convert is not a Python object #1

Closed gertjanssenswillen closed 5 years ago

gertjanssenswillen commented 5 years ago
> library(pm4py)
> 
> # Most of the data structures are converted in their bupaR equivalents
> library(bupaR)
> 
> # As Inductive Miner of PM4PY is not life-cycle aware, keep only `complete` events:
> patients_completes <- patients[patients$registration_type == "complete", ]
> 
> # Discovery with Inductive Miner
> pn <- discovery_inductive(patients_completes)

Gives the following error:

Error in py_to_r.default(X[[i]], ...) : 
  Object to convert is not a Python object

install_pm4py was executed without error. pm4py_available returns TRUE.

> traceback()
6: stop("Object to convert is not a Python object")
5: py_to_r.default(X[[i]], ...)
4: FUN(X[[i]], ...)
3: lapply(model, py_to_r)
2: prepare_pn_with_markings(model, convert)
1: discovery_inductive(patients_completes)

> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252    LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] petrinetR_0.2.0     processmonitR_0.1.0 xesreadR_0.2.3      processmapR_0.3.3   eventdataR_0.2.0    edeaR_0.8.2         bupaR_0.4.2         pm4py_1.1.19        forcats_0.3.0       stringr_1.4.0       dplyr_0.8.0.1      
[12] purrr_0.3.2         readr_1.3.1         tidyr_0.8.2         tibble_2.0.1        ggplot2_3.1.0       tidyverse_1.2.1    

loaded via a namespace (and not attached):
 [1] viridis_0.5.1          httr_1.3.1             viridisLite_0.3.0      jsonlite_1.6           modelr_0.1.1           shinyTime_0.2.1        shiny_1.3.2            assertthat_0.2.0       cellranger_1.1.0      
[10] yaml_2.2.0             pillar_1.3.1           lattice_0.20-35        glue_1.3.0             downloader_0.4         reticulate_1.13.0-9000 digest_0.6.15          RColorBrewer_1.1-2     promises_1.0.1        
[19] rvest_0.3.2            colorspace_1.3-2       htmltools_0.3.6        httpuv_1.5.1           Matrix_1.2-12          plyr_1.8.4             psych_1.8.3.3          XML_3.98-1.16          pkgconfig_2.0.2       
[28] broom_0.4.4            haven_1.1.1            DiagrammeR_1.0.1       xtable_1.8-2           scales_1.0.0           brew_1.0-6             later_0.8.0            influenceR_0.1.0       withr_2.1.2           
[37] lazyeval_0.2.1         cli_1.0.1              mnormt_1.5-5           rgexf_0.15.3           magrittr_1.5           crayon_1.3.4           readxl_1.0.0           mime_0.5               fansi_0.4.0           
[46] nlme_3.1-131.1         xml2_1.2.0             foreign_0.8-69         ggthemes_4.0.1         Rook_1.1-1             tools_3.4.4            data.table_1.12.0      hms_0.4.2              plotly_4.8.0          
[55] munsell_0.5.0          compiler_3.4.4         rlang_0.3.1            grid_3.4.4             rstudioapi_0.7         visNetwork_2.0.6       htmlwidgets_1.2        igraph_1.2.1           miniUI_0.1.1.1        
[64] gtable_0.2.0           reshape2_1.4.3         R6_2.3.0               gridExtra_2.3          zoo_1.8-1              lubridate_1.7.4        utf8_1.1.3             stringi_1.3.1          parallel_3.4.4        
[73] Rcpp_1.0.1             tidyselect_0.2.5  
fmannhardt commented 5 years ago

Could reproduce it and might be related to updates in reticulate as this did not happen in my environment before I upgraded to the most recent versions.