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