@@ -6,48 +6,38 @@ REPO_ROOT=$(git rev-parse --show-toplevel)
66# ensure that the command below is run from the root of the repository
77cd " $REPO_ROOT "
88
9- # # remove this when you have implemented the script
10- # echo "TODO: replace the commands in this script with the sequence of components that you need to run to generate test_resources."
11- # echo " Inside this script, you will need to place commands to generate example files for each of the 'src/api/file_*.yaml' files."
12- # exit 1
13-
149set -e
1510
16- RAW_DATA=resources_test/common
17- DATASET_DIR=resources_test/task_template
18-
19- mkdir -p $DATASET_DIR
20-
21- # process dataset
22- viash run src/data_processors/process_dataset/config.vsh.yaml -- \
23- --input $RAW_DATA /cxg_mouse_pancreas_atlas/dataset.h5ad \
24- --output_train $DATASET_DIR /cxg_mouse_pancreas_atlas/train.h5ad \
25- --output_test $DATASET_DIR /cxg_mouse_pancreas_atlas/test.h5ad \
26- --output_solution $DATASET_DIR /cxg_mouse_pancreas_atlas/solution.h5ad
27-
28- # run one method
29- viash run src/methods/logistic_regression/config.vsh.yaml -- \
30- --input_train $DATASET_DIR /cxg_mouse_pancreas_atlas/train.h5ad \
31- --input_test $DATASET_DIR /cxg_mouse_pancreas_atlas/test.h5ad \
32- --output $DATASET_DIR /cxg_mouse_pancreas_atlas/prediction.h5ad
33-
34- # run one metric
35- viash run src/metrics/accuracy/config.vsh.yaml -- \
36- --input_prediction $DATASET_DIR /cxg_mouse_pancreas_atlas/prediction.h5ad \
37- --input_solution $DATASET_DIR /cxg_mouse_pancreas_atlas/solution.h5ad \
38- --output $DATASET_DIR /cxg_mouse_pancreas_atlas/score.h5ad
39-
40- # write manual state.yaml. this is not actually necessary but you never know it might be useful
41- cat > $DATASET_DIR /cxg_mouse_pancreas_atlas/state.yaml << HERE
42- id: cxg_mouse_pancreas_atlas
43- train: !file train.h5ad
44- test: !file test.h5ad
45- solution: !file solution.h5ad
46- prediction: !file prediction.h5ad
47- score: !file score.h5ad
48- HERE
11+ OUT_DIR=resources_test/task_foundation_models/results
12+
13+ TASKS=(
14+ " task_label_projection"
15+ " task_batch_integration"
16+ )
17+
18+ if [ -d " $OUT_DIR " ]; then
19+ echo " Removing existing directory '$OUT_DIR '"
20+ rm -rf " $OUT_DIR "
21+ fi
22+
23+ mkdir -p " $OUT_DIR "
24+
25+ for TASK in " ${TASKS[@]} " ; do
26+ BASE_DIR=" s3://openproblems-data/resources/$TASK /results"
27+
28+ # find subdir in bucket with latest date which has a 'task_info.yaml' file
29+ DATE=$( aws s3 ls " $BASE_DIR /" --recursive --no-sign-request | awk ' {print $4}' | grep ' task_info.yaml' | sort -r | head -n 1 | sed ' s#.*/run_\(.*\)/[^/]*$#\1#' )
30+
31+ INPUT_DIR=" $BASE_DIR /run_$DATE "
32+ TASK_STRIP_PREFIX=$( echo $TASK | sed ' s/task_//' )
33+ OUTPUT_DIR=" $OUT_DIR /$TASK_STRIP_PREFIX "
34+
35+ echo " Syncing '$INPUT_DIR ' to '$OUTPUT_DIR '"
36+ aws s3 sync " $INPUT_DIR " " $OUTPUT_DIR " --delete --no-sign-request
37+ done
4938
5039# only run this if you have access to the openproblems-data bucket
5140aws s3 sync --profile op \
52- " $DATASET_DIR " s3://openproblems-data/resources_test/task_template \
41+ " resources_test/task_foundation_models" \
42+ s3://openproblems-data/resources_test/task_foundation_models \
5343 --delete --dryrun
0 commit comments