/ concept-collection / timeseries-entropy
Sign in
concept-collection / timeseries-entropy
timeseries-entropy / .github / workflows / estimates.yml
65 lines · 1.9 KBBlameHistoryRaw
1name: estimates
3# Runs the parameter grid in scripts/grid.py and caches the results on the
4# `estimates` branch. Each dispatch adds fresh, independent pasts to every cell
5# and rebuilds the pooled means, so repeated runs tighten the error bars.
7on:
8 workflow_dispatch:
10permissions:
11 contents: write
13# One sweep at a time — two concurrent dispatches would race on the push.
14concurrency:
15 group: estimates
16 cancel-in-progress: false
18jobs:
19 sweep:
20 runs-on: ubuntu-latest
21 timeout-minutes: 60
22 steps:
23 - uses: actions/checkout@v4
25 - uses: actions/setup-python@v5
26 with:
27 python-version: '3.12'
29 - run: pip install -e .
31 - name: Check out the estimates branch (creating it if absent)
32 env:
33 GH_TOKEN: ${{ github.token }}
34 run: |
35 set -euo pipefail
36 mkdir -p data
37 cd data
38 git init -q
39 git remote add origin \
40 "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
41 if git fetch -q --depth 1 origin estimates; then
42 git checkout -q -B estimates FETCH_HEAD
43 echo "continuing $(wc -l < runs.jsonl) cached records"
44 else
45 git checkout -q -b estimates
46 echo "estimates branch does not exist yet — starting it"
47 fi
49 - name: Run the sweep
50 run: python scripts/run_sweep.py --data-dir data
52 - name: Commit and push
53 run: |
54 set -euo pipefail
55 cd data
56 git add -A
57 if git diff --cached --quiet; then
58 echo "nothing to commit"
59 exit 0
60 fi
61 git \
62 -c user.name='github-actions[bot]' \
63 -c user.email='41898282+github-actions[bot]@users.noreply.github.com' \
64 commit -q -m "estimates: run ${GITHUB_RUN_NUMBER} from ${GITHUB_SHA:0:7}"
65 git push -q origin estimates
moveopenescclose