From 46e451de1532ba0af5af98345a57536276dafb28 Mon Sep 17 00:00:00 2001 From: Robin Lovelace Date: Tue, 14 Nov 2023 03:47:16 +0000 Subject: [PATCH] Revert "Add successThreshold, close #86" --- DESCRIPTION | 2 +- NEWS.md | 4 ---- R/batch.R | 10 ++-------- man/batch.Rd | 9 +-------- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index bda7ef0..53f9ecd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: cyclestreets Title: Cycle Routing and Data for Cycling Advocacy -Version: 1.1.0 +Version: 1.0.1 Authors@R: c( person("Robin", "Lovelace", , "rob00x@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-5679-6536")), diff --git a/NEWS.md b/NEWS.md index 4b4ef50..630ecee 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,3 @@ -# cyclestreets 1.1.0 (November 2023) - -* New argument `successThreshold` (#86) - # cyclestreets 1.0.1 * Bug fix: issue with batch identified and fix (#80) thanks to @mem48 diff --git a/R/batch.R b/R/batch.R index e198bec..eda65bb 100644 --- a/R/batch.R +++ b/R/batch.R @@ -41,8 +41,6 @@ #' pause: Pause job #' continue: Continue (re-open) job #' terminate: Terminate job and delete data -#' @param successThreshold int (0-100) The percentage of routes that must be successfully -#' calculated before the job is considered complete. #' @param delete_job Delete the job? TRUE by default to avoid clogged servers #' @param cols_to_keep Columns to return in output sf object #' @param segments logical, return segments TRUE/FALSE/"both" @@ -96,7 +94,6 @@ batch = function( emailOnCompletion = "you@example.com", username = Sys.getenv("CYCLESTREETS_UN"), password = Sys.getenv("CYCLESTREETS_PW"), - successThreshold = 90, base_url = "https://api.cyclestreets.net/v2/batchroutes.createjob", pat = Sys.getenv("CYCLESTREETS_BATCH"), silent = TRUE, @@ -134,7 +131,6 @@ batch = function( password, base_url, id, - successThreshold, pat, silent = silent ) @@ -281,8 +277,7 @@ batch_routes = function( base_url = "https://api.cyclestreets.net/v2/batchroutes.createjob", id = 1, pat, - silent = TRUE, - successThreshold + silent = TRUE ) { batch_url = paste0(base_url, "?key=", pat) desire_lines_to_send = desire_lines["id"] @@ -303,8 +298,7 @@ batch_routes = function( includeJsonOutput = includeJsonOutput, emailOnCompletion = emailOnCompletion, username = username, - password = password, - successThreshold + password = password ) message("POSTing the request to create and start the job") if(!silent) { diff --git a/man/batch.Rd b/man/batch.Rd index d6580b0..42bd264 100644 --- a/man/batch.Rd +++ b/man/batch.Rd @@ -21,7 +21,6 @@ batch( emailOnCompletion = "you@example.com", username = Sys.getenv("CYCLESTREETS_UN"), password = Sys.getenv("CYCLESTREETS_PW"), - successThreshold = 90, base_url = "https://api.cyclestreets.net/v2/batchroutes.createjob", pat = Sys.getenv("CYCLESTREETS_BATCH"), silent = TRUE, @@ -81,9 +80,6 @@ Your CycleStreets account username. In due course this will be replaced with an Your CycleStreets account password. You can set it with Sys.setenv(CYCLESTREETS_PW="xxxxxx")} -\item{successThreshold}{int (0-100) The percentage of routes that must be successfully -calculated before the job is considered complete.} - \item{base_url}{The base url from which to construct API requests (with default set to main server)} @@ -118,7 +114,6 @@ routes_id = batch(desire_lines, username = "robinlovelace", wait = FALSE) # Wait for some time, around a minute or 2 routes_wait = batch(id = routes_id, username = "robinlovelace", wait = TRUE, delete_job = FALSE) names(routes_wait) -sapply(routes_wait, class) plot(routes_wait) plot(desire_lines$geometry[4]) plot(routes_wait$geometry[routes_wait$route_number == "4"], add = TRUE) @@ -133,9 +128,7 @@ routes_id = batch(desire_lines_huge, username = "robinlovelace", wait = FALSE) names(routes) plot(routes$geometry) plot(desire_lines$geometry, add = TRUE, col = "red") -routes = batch(desire_lines, username = "robinlovelace", wait_time = 5, segments = FALSE) -segments = batch(desire_lines, username = "robinlovelace", wait_time = 5, segments = TRUE) -both = batch(desire_lines, username = "robinlovelace", wait_time = 5, segments = "both") +routes = batch(desire_lines, username = "robinlovelace", wait_time = 5) # profvis::profvis(batch_read("test-data.csv.gz")) } }