Install the shared challenge-tools package; read the field grid from axes and shape
3 changed files+6−5
.mochi/workflows/results.ymlmodified+1−1View file
@@ -15,7 +15,7 @@ jobs:
1515 - uses: actions/setup-python@v5
1616 with:
1717 python-version: '3.12'
18- - run: pip install ./challenge-repo
18+ - run: pip install git+https://vault1.magland.org/challenges/challenge-tools
1919 - name: Validate submissions
2020 run: challenge-tools validate --challenges challenge-repo/challenges --solutions solutions
2121 - name: Build this repository's site
README.mdmodified+2−2View file
@@ -15,7 +15,7 @@ web/ this repository's site (built b
1515 ## Adding a submission to this repository
1616
1717 1. Read the challenge specification, for example [string-pluck-v1](https://vault1.magland.org/challenges/string/blob/main/challenges/string-pluck-v1/README.md), and produce the output exactly as specified.
18-2. Choose a submission ID (lowercase letters, digits, hyphens) and write `solutions/<challenge-id>/<submission-id>.json` following the [schema](https://vault1.magland.org/challenges/string/blob/main/schema/solution.schema.json). The existing files are complete examples.
18+2. Choose a submission ID (lowercase letters, digits, hyphens) and write `solutions/<challenge-id>/<submission-id>.json` following the [schema](https://vault1.magland.org/challenges/challenge-tools/blob/main/schema.json). The existing files are complete examples.
1919 3. Put the wav files (and optional field exports) in `solutions/<challenge-id>/<submission-id>/`. Files over 1 MiB must be pushed with git rather than written through the web interface.
2020 4. If the submission contains several solutions of known relative accuracy, record that in `more_accurate_than`; this is what lets the reference be chosen automatically.
2121 5. Open a pull request. The workflow validates the files and, on `main`, rebuilds this site. The comparison on the challenge repository's site is rebuilt when that repository's workflow next runs (on a push there, or by dispatching it).
@@ -29,7 +29,7 @@ Any public repository with the same `solutions/` layout can be registered by a p
2929 ## Validating locally
3030
3131 ```
32-pip install git+https://vault1.magland.org/challenges/string
32+pip install git+https://vault1.magland.org/challenges/challenge-tools
3333 challenge-tools validate --challenges <path-to-string-repo>/challenges --solutions solutions
3434 python web/build.py --out site
3535 ```
solvers/fields.pymodified+3−2View file
@@ -11,8 +11,9 @@ def field_grid(challenge: dict):
1111 """The recommended export grid for a challenge, from challenge.json."""
1212 fg = challenge["fields"]
1313 p = challenge["parameters"]
14- x = np.linspace(0.0, p["L"], int(fg["nx"]))
15- t = np.arange(int(fg["nt"])) / float(fg["frame_rate_hz"])
14+ nt, nx = fg["shape"]
15+ x = np.linspace(0.0, p["L"], int(nx))
16+ t = np.arange(int(nt)) / float(fg["frame_rate_hz"])
1617 return x, t
1718
1819