Skip to content

Commit

Permalink
prepare task result processors for viash 0.9 (#455)
Browse files Browse the repository at this point in the history
* prepare task result processors for viash 0.9

* remove assertion
  • Loading branch information
rcannood authored May 31, 2024
1 parent 907447b commit 2a8390c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 19 deletions.
30 changes: 19 additions & 11 deletions src/common/process_task_results/get_method_info/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,28 @@ outputs <- map(configs, function(config) {
if (length(config$functionality$status) > 0 && config$functionality$status == "disabled") {
return(NULL)
}
info <- config$functionality$info

# prep for viash 0.9.0
build_info <- config$build_info %||% config$info
if ("functionality" %in% names(config)) {
config[names(config$functionality)] <- config$functionality
config[["functionality"]] <- NULL
}

info <- config$info

# add extra info
info$config_path <- gsub(".*openproblems-v2/src/", "src/", config$info$config)
info$task_id <- gsub("/.*", "", config$functionality$namespace)
info$id <- config$functionality$name
info$namespace <- config$functionality$namespace
info$commit_sha <- config$info$git_commit %||% "missing-sha"
info$config_path <- gsub(".*/src/", "src/", build_info$config)
info$task_id <- gsub("/.*", "", config$namespace)
info$id <- config$name
info$namespace <- config$namespace
info$commit_sha <- build_info$git_commit %||% "missing-sha"
info$code_version <- "missing-version"
info$implementation_url <- paste0(
"https://github.com/openproblems-bio/openproblems-v2/tree/",
info$commit_sha, "/",
info$config_path
)
info$implementation_url <- paste0(
build_info$git_remote, "/blob/",
build_info$git_commit, "/",
info$config_path
)

# ↑ this could be used as the new format

Expand Down
23 changes: 15 additions & 8 deletions src/common/process_task_results/get_metric_info/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,27 @@ outputs <- map(configs, function(config) {
return(NULL)
}

# prep for viash 0.9.0
build_info <- config$build_info %||% config$info
if ("functionality" %in% names(config)) {
config[names(config$functionality)] <- config$functionality
config[["functionality"]] <- NULL
}

map(
config$functionality$info$metrics,
config$info$metrics,
function(info) {
# add extra info
info$config_path <- gsub(".*openproblems-v2/src/", "src/", config$info$config)
info$task_id <- gsub("/.*", "", config$functionality$namespace)
info$config_path <- gsub(".*/src/", "src/", build_info$config)
info$task_id <- gsub("/.*", "", config$namespace)
info$id <- info$name
info$component_id <- config$functionality$name
info$namespace <- config$functionality$namespace
info$commit_sha <- config$info$git_commit %||% "missing-sha"
info$component_id <- config$name
info$namespace <- config$namespace
info$commit_sha <- build_info$git_commit %||% "missing-sha"
info$code_version <- "missing-version"
info$implementation_url <- paste0(
"https://github.com/openproblems-bio/openproblems-v2/tree/",
info$commit_sha, "/",
build_info$git_remote, "/blob/",
build_info$git_commit, "/",
info$config_path
)

Expand Down

0 comments on commit 2a8390c

Please sign in to comment.