fix(ui): browser-playable overlay video (H.264) + light all dropdown option lists
Browse filesFiles changed (3)
9 unmodified lines10111213141516171831 unmodified lines505152535455562 unmodified lines5960616263646566676869707172737475767778798081828384858687888990919 unmodified lines"""from __future__ import annotationsfrom formscout.types import (MovementResult, BiomechFeatures, ScoreResult, JudgeResult, ReportResult,)from formscout import config# Bilateral tests that need L/R scoring31 unmodified lineselse:unilateral.append(entry)# Process bilateral tests β take the lower score, emit asymmetryfor test_name, entries in bilateral_groups.items():scores = []for entry in entries:2 unmodified linesscore = judge.score if judge.score is not None else Nonescores.append({"side": side, "score": score, "entry": entry})# Find best entry per sideleft = next((s for s in scores if s["side"] == "left"), None)right = next((s for s in scores if s["side"] == "right"), None)left_score = left["score"] if left else Noneright_score = right["score"] if right else None# Report lowerif left_score is not None and right_score is not None:final_score = min(left_score, right_score)delta = abs(left_score - right_score)asymmetries.append({"test": test_name,"left_score": left_score,"right_score": right_score,"delta": delta,})elif left_score is not None:final_score = left_scoreelif right_score is not None:final_score = right_scoreelse:final_score = None# Use the entry with the lower score for detailsprimary = (left["entry"] if left and (right is None or (left_score or 4) <= (right_score or 4))else right["entry"] if right else entries[0])per_test.append({"test_name": test_name,9 unmodified lines1011121314151631 unmodified lines484950515253545556572 unmodified lines606162636465666768697071727374757677787980818283848586878889909192939 unmodified lines"""from __future__ import annotationsfrom formscout.types import ReportResultfrom formscout import config# Bilateral tests that need L/R scoring31 unmodified lineselse:unilateral.append(entry)# Process bilateral tests β report the lower side and emit an asymmetry# when both sides exist; otherwise fall back to whatever was scored (e.g.# a single clip submitted with side="na", the UI default) so the test# still counts toward the composite instead of being dropped as unscored.for test_name, entries in bilateral_groups.items():scores = []for entry in entries:2 unmodified linesscore = judge.score if judge.score is not None else Nonescores.append({"side": side, "score": score, "entry": entry})left = next((s for s in scores if s["side"] == "left"), None)right = next((s for s in scores if s["side"] == "right"), None)left_score = left["score"] if left else Noneright_score = right["score"] if right else Noneif left_score is not None and right_score is not None:# Both sides present β report the lower and record the asymmetry.final_score = min(left_score, right_score)asymmetries.append({"test": test_name,"left_score": left_score,"right_score": right_score,"delta": abs(left_score - right_score),})primary = left["entry"] if left_score <= right_score else right["entry"]elif left_score is not None:final_score, primary = left_score, left["entry"]elif right_score is not None:final_score, primary = right_score, right["entry"]else:# No explicit L/R side: use the lowest available score across the# group (covers side="na" and needs_human/unscored entries).scored = [s for s in scores if s["score"] is not None]if scored:best = min(scored, key=lambda s: s["score"])final_score, primary = best["score"], best["entry"]else:final_score, primary = None, entries[0]per_test.append({"test_name": test_name,
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384#!/usr/bin/env bash# Upload the FormScout source tree to the Build Small Hackathon Space, as a PR.## Usage:# ./scripts/hackathon_upload.sh # message from last git commit# ./scripts/hackathon_upload.sh "feat: my change" # custom message## Pushes (PR) to:# spaces/build-small-hackathon/small-functional-movement-screening## The Space already exists, so this script only uploads β it does not create the# repo. Like hf_upload.sh, `hf upload` ignores .hfignore, so we parse it into# --exclude globs ourselves. Above LARGE_THRESHOLD files it falls back to# `hf upload-large-folder` (resumable, but commits to main directly β no PR).set -euo pipefail
cd "$(dirname "$0")/.."
HACKATHON_OWNER="${FORMSCOUT_HF_HACKATHON_OWNER:-build-small-hackathon}"REPO_NAME="small-functional-movement-screening"SPACE_REPO="spaces/$HACKATHON_OWNER/$REPO_NAME"MSG="${1:-$(git log -1 --pretty=%s)}"LARGE_THRESHOLD="${FORMSCOUT_HF_LARGE_THRESHOLD:-500}"
# Belt-and-suspenders extras on top of .hfignore. `.cache/` is the resume# state upload-large-folder writes into the folder being uploaded.PATTERNS=( "*.pdf" "**/node_modules/**" ".cache/**")
# Parse .hfignore into fnmatch-style globs. fnmatch's `*` crosses `/`, but a# bare name like `.DS_Store` or `dir/` only matches at the root, so emit both# the rooted and `**/`-prefixed forms.while IFS= read -r line; do line="${line%%#*}" line="${line#"${line%%[![:space:]]*}"}" line="${line%"${line##*[![:space:]]}"}" [[ -z "$line" ]] && continue if [[ "$line" == */ ]]; then PATTERNS+=("${line}**" "**/${line}**") else PATTERNS+=("$line" "**/$line") fidone < .hfignore
EXCLUDES=()for p in "${PATTERNS[@]}"; do EXCLUDES+=(--exclude="$p")done
# Count what would actually be uploaded, using the same filter the hub client# applies, so the mode decision matches reality.N_FILES=$(python3 - "${PATTERNS[@]}" <<'EOF'import sysfrom pathlib import Pathfrom huggingface_hub.utils import filter_repo_objects
patterns = sys.argv[1:]files = ( str(p) for p in Path(".").rglob("*") if p.is_file() and p.parts[0] != ".git")print(len(list(filter_repo_objects(files, ignore_patterns=patterns))))EOF)echo "ββ $N_FILES files to upload after .hfignore filtering"
if (( N_FILES == 0 )); then echo "β nothing to upload β check .hfignore" >&2 exit 1fi
if (( N_FILES > LARGE_THRESHOLD )); then echo "ββ $SPACE_REPO: $N_FILES files > $LARGE_THRESHOLD, using upload-large-folder" echo " (resumable; commits directly to main β no PR, no custom message)" hf upload-large-folder "$SPACE_REPO" . "${EXCLUDES[@]}"else echo "ββ uploading (PR) to: $SPACE_REPO" hf upload "$SPACE_REPO" . . "${EXCLUDES[@]}" --create-pr --commit-message="$MSG"fi
echo "β done β PR opened on $SPACE_REPO (review & merge in the HF UI)"337 unmodified lines338339340341342343337 unmodified linesassert len(result.asymmetries) == 1assert result.asymmetries[0]["delta"] == 1def test_composite_none_when_unscored(self):agent = ReportAgent()entries = [{337 unmodified lines338339340341342343344345346347348349350351352353354355356357358359360361362363337 unmodified linesassert len(result.asymmetries) == 1assert result.asymmetries[0]["delta"] == 1def test_bilateral_na_side_is_scored(self):"""A bilateral test run once with side='na' (the UI default) must stillcount toward the composite, not be dropped as unscored."""agent = ReportAgent()entries = [{"movement": MovementResult(test_name="hurdle_step", side="na", confidence=1.0),"features": _make_features("hurdle_step", side="na"),"rubric_score": ScoreResult(score=2, rationale="", confidence=0.9),"judge": JudgeResult(score=2, rationale="", compensation_tags=[], corrective_hint="",confidence=0.9,),"side": "na",}]result = agent.run(entries)assert len(result.per_test) == 1assert result.per_test[0]["score"] == 2assert result.composite == 2assert result.asymmetries == [] # no L/R pair β no asymmetrydef test_composite_none_when_unscored(self):agent = ReportAgent()entries = [{
formscout/agents/report.py+18-16
scripts/hackathon_upload.shAdded+84
tests/test_phase2.py+20