Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion on 'r5r_core' failed #352

Closed
keyingtang opened this issue Sep 29, 2023 · 9 comments
Closed

Assertion on 'r5r_core' failed #352

keyingtang opened this issue Sep 29, 2023 · 9 comments

Comments

@keyingtang
Copy link

keyingtang commented Sep 29, 2023

Brief description of the problem:

Hi all, I have the same error when running every function that takes 'r5r_core' as an assertion. For example:

> # calculate a travel time matrix
> ttm <- travel_time_matrix(r5r_core = r5r_core,
+                           origins = poi,
+                           destinations = poi,
+                           mode = mode,
+                           departure_datetime = departure_datetime,
+                           max_walk_time = max_walk_time,
+                           max_trip_duration = max_trip_duration)
Error in travel_time_matrix(r5r_core = r5r_core, origins = poi, destinations = poi,  : 
  Assertion on 'r5r_core' failed: Must inherit from class 'jobjRef', but has class 'NULL'.

Could you please help me solve this problems? Many thanks!

@rafapereirabr
Copy link
Member

Could you please run r5r::r5r_sitrep() and paste the output in a comment below ?

@keyingtang
Copy link
Author

r5r::r5r_sitrep()
$r5r_package_version
[1] ‘1.1.0’

$r5_jar_version
character(0)

$java_version
[1] "11.0.20"

$set_memory
[1] "-Xmx2G"

$session_info
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.5.2

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Amsterdam
tzcode source: internal

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

other attached packages:
[1] ggplot2_3.4.3 data.table_1.14.8 sf_1.0-14 r5r_1.1.0

loaded via a namespace (and not attached):
[1] gtable_0.3.4 xfun_0.40 htmlwidgets_1.6.2 devtools_2.4.5 remotes_2.4.2.1
[6] processx_3.8.2 rJava_1.0-6 callr_3.7.3 vctrs_0.6.3 tools_4.3.1
[11] ps_1.7.5 generics_0.1.3 curl_5.0.2 tibble_3.2.1 proxy_0.4-27
[16] fansi_1.0.4 pkgconfig_2.0.3 KernSmooth_2.23-21 checkmate_2.2.0 lifecycle_1.0.3
[21] compiler_4.3.1 stringr_1.5.0 munsell_0.5.0 httpuv_1.6.11 htmltools_0.5.6
[26] usethis_2.2.2 class_7.3-22 yaml_2.3.7 later_1.3.1 pillar_1.9.0
[31] crayon_1.5.2 urlchecker_1.0.1 ellipsis_0.3.2 classInt_0.4-10 cachem_1.0.8
[36] sessioninfo_1.2.2 mime_0.12 tidyselect_1.2.0 digest_0.6.33 stringi_1.7.12
[41] dplyr_1.1.3 purrr_1.0.2 fastmap_1.1.1 grid_4.3.1 colorspace_2.1-0
[46] cli_3.6.1 magrittr_2.0.3 pkgbuild_1.4.2 utf8_1.2.3 e1071_1.7-13
[51] withr_2.5.1 backports_1.4.1 prettyunits_1.2.0 scales_1.2.1 promises_1.2.1
[56] rmarkdown_2.25 memoise_2.0.1 shiny_1.7.5 evaluate_0.22 knitr_1.44
[61] miniUI_0.1.1.1 profvis_0.3.8 rlang_1.1.1 Rcpp_1.0.11 xtable_1.8-4
[66] glue_1.6.2 DBI_1.1.3 pkgload_1.3.3 rstudioapi_0.15.0 R6_2.5.1
[71] fs_1.6.3 units_0.8-4

@rafapereirabr
Copy link
Member

The problems seems to occur in the step of creating the r5r_core object. Here's an explanation on how to do it.

Could you please paste the code you have used to build the r5r_core object?

@keyingtang
Copy link
Author

Hi @rafapereirabr I am running r5r.Rmd in vignettes folder, so it' exactly the same as the one on the page you shared.

# Indicate the path where OSM and GTFS data are stored
r5r_core <- setup_r5(data_path = data_path)

@rafapereirabr
Copy link
Member

could you please paste the code you're using? I mean the code from the beginning of loading libraries, pointing to data path etc etc etc

@keyingtang
Copy link
Author

data_path <- system.file("extdata/poa", package = "r5r")
list.files(data_path)
Here is the output (I can load all the files such as poi):
[1] "fares" "poa_elevation.tif" "poa_eptc.zip"
[4] "poa_hexgrid.csv" "poa_osm.pbf" "poa_points_of_interest.csv"
[7] "poa_trensurb.zip"

Then I use this line to create r5r_core object, it also runs well:
r5r_core <- setup_r5(data_path = data_path)

But then I want to call functions using r5r_core as an assertion, it showed the error:
Error in accessibility(r5r_core = r5r_core, origins = points, destinations = points, :
Assertion on 'r5r_core' failed: Must inherit from class 'jobjRef', but has class 'NULL'.

@rafapereirabr
Copy link
Member

could you please try running this code and paste the output below?

library(r5r)

# build transport network
data_path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path)

# load origin/destination points
points <- read.csv(file.path(data_path, "poa_points_of_interest.csv"))

departure_datetime <- as.POSIXct( "13-05-2019 14:00:00", format = "%d-%m-%Y %H:%M:%S" )


ttm <- travel_time_matrix(
  r5r_core,
  origins = points,
  destinations = points,
  mode = c("WALK", "TRANSIT"),
  departure_datetime = departure_datetime,
  max_trip_duration = 60
)

head(ttm)

@keyingtang
Copy link
Author

Hi, I have run this code and I met a bomb which is the same as Issue#315 (fatal error). Maybe it's a Mac problem.
But I managed to import r5py so I will try using it now.
Thanks a lot!

@rafapereirabr
Copy link
Member

thanks for letting us know. Issue #315. closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants