You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-24Lines changed: 26 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,29 @@ You can modify the list of AD types in `main.jl`.
14
14
15
15
You can modify the list of models in `models.jl`.
16
16
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.
18
19
19
-
The HTML is generated by the `ad.py` script.
20
-
You can edit it there.
20
+
## I want to edit the website!
21
21
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.
23
40
24
41
## I want to see the HTML generated by a PR!
25
42
@@ -46,33 +63,18 @@ The purpose of having this Python -> Julia setup (as opposed to doing the loopin
46
63
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'.
47
64
48
65
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.
51
67
(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).
52
68
Thankfully, [there is an existing action](https://github.com/beacon-biosignals/matrix-output) which is designed to get around this problem by uploading artefacts.)
53
69
54
70
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).
55
71
56
72
## Can I run this locally?
57
73
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>`.
71
75
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>`.
74
77
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.
77
79
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