Skip to content

Commit b3bbc27

Browse files
committed
[skip ci] Update README
1 parent ecf6f2f commit b3bbc27

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

README.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,29 @@ You can modify the list of AD types in `main.jl`.
1414

1515
You can modify the list of models in `models.jl`.
1616

17-
## I want to edit the HTML that gets generated!
17+
Note that if you want the model definition to be shown on the website, your model definitions must be of the form `@model function name() ... end`.
18+
One-liner function definitions like `@model f(x) = ...`will not work.
1819

19-
The HTML is generated by the `ad.py` script.
20-
You can edit it there.
20+
## I want to edit the website!
2121

22-
Note that the links-to-existing-GitHub-issues in the table are also defined in this script.
22+
The website is a small Svelte app in the `web` directory.
23+
24+
To build this website locally, you will need to:
25+
26+
1. Install `pnpm` if you don't already have it.
27+
(`npm` is fine too, just replace `pnpm` with `npm run` in the commands below)
28+
29+
2. Download the JSON files from the `gh-pages` branch, and place them in the `web/src/data` directory.
30+
Currently, there are three JSON files: `adtests.json`, `manifest.json`, and `model_definitions.json`.
31+
These represent the latest results from running the AD tests on CI.
32+
33+
3. `cd web`
34+
35+
4. `pnpm install`
36+
37+
5. `pnpm dev`
38+
39+
6. Open `http://localhost:5173` in your browser.
2340

2441
## I want to see the HTML generated by a PR!
2542

@@ -46,33 +63,18 @@ The purpose of having this Python -> Julia setup (as opposed to doing the loopin
4663
If the Julia process successfully finishes, it will print the result which is picked up by the Python script; if it crashes, we just record the result as 'error'.
4764

4865
Finally, the results are collated and sent to the final job in the workflow, which is `python ad.py html`.
49-
It _could_ be written in Julia (PRs are welcome).
50-
However, it was much faster for me to do it in Python.
66+
This bit of the Python script is responsible for generating the three JSON files which the web app uses.
5167
(Fun fact: collating these results is also somewhat involved because we can't just write to `$GITHUB_OUTPUT`; it turns out that [output from different jobs in a matrix will override each other](https://github.com/orgs/community/discussions/26639).
5268
Thankfully, [there is an existing action](https://github.com/beacon-biosignals/matrix-output) which is designed to get around this problem by uploading artefacts.)
5369

5470
Overall, what this means is that the entire table can be generated in around 10 minutes (longer if you need to install + precompile dependencies, but on GitHub Actions dependencies will for the most part have been cached).
5571

5672
## Can I run this locally?
5773

58-
Yes, but it's quite tricky.
59-
60-
The easiest thing to do is to run one specific combination of model and adtype.
61-
This doesn't require any environment variables: you can run `julia --project=. main.jl --run <model> <adtype>`.
62-
63-
However, if you want to run the Python script locally, you will need to set the `RESULTS_JSON` environment variable.
64-
The easiest way to do this is to go to the GitHub Actions log for the collate job, where the value of `RESULTS_JSON` is printed.
65-
It is a multiline string (it's JSON), so you will need to do something like this:
66-
67-
```bash
68-
read -d '' RESULTS_JSON << EOF
69-
(paste the JSON here)
70-
EOF
74+
If you just want to run one specific combination of model and adtype, you can run `julia --project=. main.jl --run <model> <adtype>`.
7175

72-
export RESULTS_JSON
73-
```
76+
If you want to run one model with all adtypes, you can run `uv run ad.py run --model <model_name>`.
7477

75-
Then you can run the Python script locally with `python ad.py html`.
76-
It will generate the HTML file in the `html` directory.
78+
You probably don't want to run all models with all adtypes, as that takes a really long time.
7779

78-
PRs to make this simpler are more than welcome.
80+
If you just want to build the website using results that were obtained from CI, that's described in the section above.

0 commit comments

Comments
 (0)