Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions scripts/create_resources/task_results_v4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ cd "$REPO_ROOT"

set -e

export NXF_VER=25.10.5

OUT_DIR="resources_test/openproblems/task_results_v4"
RUN_S3_PATH="s3://openproblems-data/resources/task_batch_integration/results/run_2025-01-23_18-03-16"

Expand All @@ -27,6 +29,48 @@ aws s3 sync --profile op \
"$OUT_DIR/raw/" \
--delete

echo
echo ">>> Adding dummy paramsets if none are present..."
# get_results keys its output by parameter set as well as by method, so the test
# resources need score entries with a paramset. This run predates paramsets, so
# duplicate one method's scores under two dummy paramsets. The report drops the
# extra rows (they have no metric component runs), so the rest of the processed
# output is unaffected.
python3 - "$OUT_DIR/raw/score_uns.yaml" << 'HERE'
import copy
import sys
import yaml

path = sys.argv[1]
with open(path) as f:
scores = yaml.safe_load(f)

if any("paramset_id" in entry for entry in scores):
print("Scores already contain paramsets; leaving them as-is.")
sys.exit(0)

method_id = scores[0]["method_id"]
paramsets = {
"dummy_paramset_1": {"learning_rate": 0.1, "n_iterations": 100, "mode": "fast"},
"dummy_paramset_2": {"learning_rate": 0.01, "n_iterations": 500, "mode": "accurate"},
}
new_entries = []
for entry in scores:
if entry["method_id"] != method_id:
continue
for paramset_id, paramset in paramsets.items():
dup = copy.deepcopy(entry)
dup["paramset_id"] = paramset_id
dup["paramset"] = dict(paramset)
new_entries.append(dup)

scores.extend(new_entries)
with open(path, "w") as f:
yaml.safe_dump(scores, f, sort_keys=False)

print(f"Added {len(new_entries)} dummy paramset entries for method '{method_id}'.")
HERE

echo
echo ">>> Processing results (timestamp: $TIMESTAMP)..."
if [ -d "$OUT_DIR/processed" ]; then rm -Rf $OUT_DIR/processed; fi
Expand Down
Loading
Loading