diff --git a/R/processes.R b/R/processes.R index 3846b13..a871c47 100644 --- a/R/processes.R +++ b/R/processes.R @@ -900,14 +900,6 @@ run_udf <- Process$new( subtype = "string" ) ), - Parameter$new( - name = "names", - description = "List of names to define outputs from a reducer UDF", - schema = list( - type = "string", - subtype = "string" - ) - ), Parameter$new( name = "runtime", description = "A UDF runtime identifier available at the back-end.", @@ -935,7 +927,7 @@ run_udf <- Process$new( description = "The computed result.", schema = list(type = c("number", "null")) ), - operation = function(data, udf, names = c("default"), runtime = "R", version = NULL, context = NULL, job) { + operation = function(data, udf, runtime = "R", version = NULL, context = NULL, job) { if (runtime != "R") { stop("Only R runtime is supported.") } @@ -953,7 +945,7 @@ run_udf <- Process$new( user_function <- eval(func_parse) # reducer udf message("reducer function -> time") - data <- reduce_time(data, names = names, FUN = user_function) + data <- reduce_time(data, names = context, FUN = user_function) return(data) } else { # convert parsed string function to class function diff --git a/README.md b/README.md index 23bdf6c..5f2246a 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,7 @@ change_detection = "function(x) { }" # run udf -datacube_udf = p$run_udf(data = datacube_filtered, udf = change_detection, names = c("change_date", "change_magnitude")) +datacube_udf = p$run_udf(data = datacube_filtered, udf = change.detection, context = c("change_date", "change_magnitude")) # supported formats formats = list_file_formats() @@ -233,7 +233,7 @@ result = p$save_result(data = datacube_udf, format = formats$output$NetCDF) # Process and download data synchronously start.time <- Sys.time() -compute_result(graph = result, output_file = "change_detection.nc") +compute_result(graph = result, output_file = "detected_changes.nc") end.time <- Sys.time() time.taken <- end.time - start.time time.taken diff --git a/examples/03-change-detection/R-Client-bfast-brandenburg.R b/examples/03-change-detection/R-Client-bfast-brandenburg.R index b8c16c8..8bc32de 100644 --- a/examples/03-change-detection/R-Client-bfast-brandenburg.R +++ b/examples/03-change-detection/R-Client-bfast-brandenburg.R @@ -57,7 +57,7 @@ change.detection = 'function(x) { }' # run udf -datacube_udf = p$run_udf(data = datacube_filtered, udf = change.detection, names = c("change_date", "change_magnitude")) +datacube_udf = p$run_udf(data = datacube_filtered, udf = change.detection, context = c("change_date", "change_magnitude")) # supported formats formats = list_file_formats() @@ -67,7 +67,7 @@ result = p$save_result(data = datacube_udf, format = formats$output$NetCDF) # Process and download data synchronously start.time <- Sys.time() -compute_result(graph = result, output_file = "change_detection.nc") +compute_result(graph = result, output_file = "detected_changes.nc") end.time <- Sys.time() time.taken <- end.time - start.time time.taken diff --git a/man/load_stac.Rd b/man/load_stac.Rd new file mode 100644 index 0000000..a02f085 --- /dev/null +++ b/man/load_stac.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/processes.R +\docType{data} +\name{load_stac} +\alias{load_stac} +\title{load stac} +\format{ +An object of class \code{Process} (inherits from \code{R6}) of length 12. +} +\usage{ +load_stac +} +\description{ +load stac +} +\keyword{datasets}