R/development/review/hpds_flash_scout.R

Defines functions flash_scout

library(magrittr)
library(data.table)
library(stringr)
library(parallel)
library(tcltk)
library(rlang)

#' @describeIn tokens get arbitrary function on search path
#' @export
flash_scout <- function(FUN=NULL, expr = NULL, ...){
  FUN    <- function() m*x + b
  p_expr <- substitute(mean(.))
  expr   <- substitute(cbind(x = 4.22, CJ(b = 2:5, m = runif(10000, 1, 10))))

  ## Process the piping if provided
  args <- call_args(...)#pipe_expr)
  args[[which(args %>% `==`(., "."))]] <- substitute(FUN())


  input_pll <- splitRows(eval(expr), 50)#parallel::detectCores())

  i <- input_pll[[1]]
  fn_env(FUN) <- env_new(env_base(), i)
  do.call(call_fn(pipe_expr), args)

  ### recursively call flash_scout until input_pll is small enough where
  ### it runs in 1 second.
  ### This may involve spawnning rapidly with smaller bucket sizes until you identify the
  ### number of splits required so that it: call_latency - call_computation_time == 0
  ### (This is the theoretical minimum elapsed time required)
}
bfatemi/ninjar documentation built on Sept. 8, 2019, 7:37 p.m.