gregorbj/Archive-VisionEval

Remotes, install.R potential improvements

Closed this issue · 2 comments

Currently running the install.R; into hour 5 and up to VETransportSupplyUse. This is on Windows, over VPN, so not the fastest test, but still quite slow. A few changes should improve this:

  • The following should be added to the Getting Started page, rather than a link to the install.R page on GitHub:
source("https://raw.githubusercontent.com/gregorbj/VisionEval/master/install.R")
  • VESimHouseholds, VECommercialTravel still have @develop remote
  • VEEnergyAndEmissions still has @storagetest remote
  • Every module that imports VESimHouseholds (such as VELandUse) also therefore downloads @develop
  • Each module still installs framework from source. This seems to be driven by the imports option in the DESCRIPTION; this is probably unavoidable if we stay with the single repository and use install_github. Possible that install_local from a downloaded zip of the repository would not have this issue.

If time allows, consider testing a method like this in the install.R script to download once and then install_local:

VE_modules = c(
                "VESyntheticFirms",
                "VESimHouseholds",
                "VELandUse",
                "VETransportSupply",
                "VETransportSupplyUse",
                "VEHouseholdVehicles",
                "VEHouseholdTravel",
                "VERoadPerformance",
                "VEEnergyAndEmissions",
                "VETravelCost",
                "VEReports",
                "VECommercialTravel"
                )

# inspired by https://github.com/r-lib/devtools/blob/master/R/install-github.r
  dest <- "~/ve_temp"
  request <- httr::GET("https://api.github.com/repos/gregorbj/visioneval/zipball/master")
  
  writeBin(httr::content(request, "raw"), paste0(dest, ".zip"))
  
  unzip(paste0(dest, ".zip"), exdir = dest, overwrite = T)

  devtools::install_local(path = file.path(dest, "/sources/framework/visioneval"))
  
  for(i in 1:length(VE_modules)){
    cat(rep("<<>>", 10), "\n Installing", VE_modules[i], "\n")
    devtools::install_local(path = file.path(dest, "/sources/modules/", VE_modules[i]))
    )
  }