Skip to content

Commit

Permalink
update components
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Oct 19, 2024
1 parent 25e3a1d commit 16e107d
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 55 deletions.
10 changes: 7 additions & 3 deletions src/reporting/get_dataset_info/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ arguments:
type: file
description: A yaml file
required: true
example: resources_test/common/task_metadata/dataset_info.yaml
example: resources_test/openproblems/task_results_v3/raw/dataset_uns.yaml
- name: --output
type: file
direction: output
default: output.json
description: Output json
info:
format:
type: json
# TODO: add schema
resources:
- type: r_script
path: script.R
test_resources:
- type: python_script
path: /common/component_tests/run_and_check_output.py
- path: /resources_test/common/task_metadata
dest: resources_test/common/task_metadata
- path: /resources_test/openproblems/task_results_v3
dest: resources_test/openproblems/task_results_v3
engines:
- type: docker
image: openproblems/base_r:1.0.0
Expand Down
1 change: 0 additions & 1 deletion src/reporting/get_dataset_info/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ outputs <- map(datasets, function(dataset) {

# construct v1 format
out <- list(
"task_id" = par$task_id,
"dataset_id" = dataset$dataset_id,
"dataset_name" = dataset$dataset_name,
"dataset_summary" = dataset$dataset_summary,
Expand Down
10 changes: 7 additions & 3 deletions src/reporting/get_method_info/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ arguments:
type: file
description: A yaml file
required: true
example: resources_test/common/task_metadata/method_configs.yaml
example: resources_test/openproblems/task_results_v3/raw/method_configs.yaml
- name: --output
type: file
direction: output
default: output.json
description: Output json
info:
format:
type: json
# TODO: add schema
resources:
- type: r_script
path: script.R
test_resources:
- type: python_script
path: /common/component_tests/run_and_check_output.py
- path: /resources_test/common/task_metadata
dest: resources_test/common/task_metadata
- path: /resources_test/openproblems/task_results_v3
dest: resources_test/openproblems/task_results_v3
engines:
- type: docker
image: openproblems/base_r:1.0.0
Expand Down
16 changes: 10 additions & 6 deletions src/reporting/get_method_info/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ library(rlang, warn.conflicts = FALSE)

## VIASH START
par <- list(
input = "output/temp/method_configs.yaml",
input = "resources_test/openproblems/task_results_v3/raw/method_configs.yaml",
output = "output/test/method_info.json"
)
## VIASH END
Expand All @@ -31,13 +31,17 @@ outputs <- map(configs, function(config) {
info$task_id <- gsub("/.*", "", config$namespace)
info$id <- config$name
info$namespace <- config$namespace
info$label <- config$label %||% info$label
info$summary <- config$summary %||% info$summary
info$description <- config$description %||% info$description
info$commit_sha <- build_info$git_commit %||% "missing-sha"
info$code_version <- "missing-version"
info$implementation_url <- paste0(
build_info$git_remote, "/blob/",
build_info$git_commit, "/",
info$config_path
)
info$implementation_url <- paste0(
build_info$git_remote, "/blob/",
build_info$git_commit, "/",
info$config_path
)
info$type_info <- NULL

# ↑ this could be used as the new format

Expand Down
10 changes: 7 additions & 3 deletions src/reporting/get_metric_info/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@ arguments:
type: file
description: A yaml file
required: true
example: resources_test/common/task_metadata/metric_configs.yaml
example: resources_test/openproblems/task_results_v3/raw/metric_configs.yaml
- name: --output
type: file
direction: output
default: output.json
description: Output json
info:
format:
type: json
# TODO: add schema
resources:
- type: r_script
path: script.R
test_resources:
- type: python_script
path: /common/component_tests/run_and_check_output.py
- path: /resources_test/common/task_metadata
dest: resources_test/common/task_metadata
- path: /resources_test/openproblems/task_results_v3
dest: resources_test/openproblems/task_results_v3
engines:
- type: docker
image: openproblems/base_r:1.0.0
Expand Down
3 changes: 2 additions & 1 deletion src/reporting/get_metric_info/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ library(rlang, warn.conflicts = FALSE)

## VIASH START
par <- list(
input = "output/temp/metric_configs.yaml",
input = "resources_test/openproblems/task_results_v3/raw/metric_configs.yaml",
output = "output/metric_info.json"
)
## VIASH END
Expand All @@ -31,6 +31,7 @@ outputs <- map(configs, function(config) {
info$config_path <- gsub(".*/src/", "src/", build_info$config)
info$task_id <- gsub("/.*", "", config$namespace)
info$id <- info$name
info$name <- NULL
info$component_id <- config$name
info$namespace <- config$namespace
info$commit_sha <- build_info$git_commit %||% "missing-sha"
Expand Down
82 changes: 45 additions & 37 deletions src/reporting/get_results/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,57 @@
name: get_results
namespace: reporting
description: Extract execution info
arguments:
- name: --task_id
type: string
description: Task id
example: batch_integration
- name: --input_scores
type: file
description: Scores file
example: score_uns.yaml
- name: --input_execution
type: file
description: Nextflow log file
example: trace.txt
- name: --input_dataset_info
type: file
description: Method info file
example: dataset_info.json
- name: --input_method_info
type: file
description: Method info file
example: method_info.json
- name: --input_metric_info
type: file
description: Metric info file
example: metric_info.json
- name: --output_results
type: file
direction: output
description: Output json
default: results.json
- name: --output_metric_execution_info
type: file
direction: output
description: Output metric execution info
default: metric_execution_info.json
argument_groups:
- name: Inputs
arguments:
- name: --input_scores
type: file
description: Scores file
example: resources_test/openproblems/task_results_v3/raw/score_uns.yaml
- name: --input_execution
type: file
description: Nextflow log file
example: resources_test/openproblems/task_results_v3/raw/trace.txt
- name: --input_dataset_info
type: file
description: Method info file
example: resources_test/openproblems/task_results_v3/processed/dataset_info.json
- name: --input_method_info
type: file
description: Method info file
example: resources_test/openproblems/task_results_v3/processed/method_info.json
- name: --input_metric_info
type: file
description: Metric info file
example: resources_test/openproblems/task_results_v3/processed/metric_info.json
- name: Outputs
arguments:
- name: --output_results
type: file
direction: output
description: Output json
default: results.json
info:
format:
type: json
# TODO: add schema
- name: --output_metric_execution_info
type: file
direction: output
description: Output metric execution info
default: metric_execution_info.json
info:
format:
type: json
# TODO: add schema
resources:
- type: r_script
path: script.R
test_resources:
- type: python_script
path: /common/component_tests/run_and_check_output.py
- path: /resources_test/common/task_metadata
dest: resources_test/common/task_metadata
- path: /resources_test/openproblems/task_results_v3
dest: resources_test/openproblems/task_results_v3
engines:
- type: docker
image: openproblems/base_r:1.0.0
Expand Down
1 change: 0 additions & 1 deletion src/reporting/get_results/script.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ library(rlang, warn.conflicts = FALSE)
## VIASH START
dir <- "work/c1/6660ea0cc6155d7e13fa341d16057b/_viash_par"
par <- list(
task_id = "task_1",
input_scores = paste0(dir, "/input_scores_1/score_uns.yaml"),
input_execution = paste0(dir, "/input_execution_1/trace.txt"),
input_dataset_info = paste0(dir, "/input_dataset_info_1/output.json"),
Expand Down

0 comments on commit 16e107d

Please sign in to comment.