Skip to content

Commit 2200a58

Browse files
committed
Update README
1 parent d82ea68 commit 2200a58

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,30 @@ You can modify the list of AD types in `main.jl`.
1313
## I want to add more models!
1414

1515
You can modify the list of models by adding a new file inside the `models` directory.
16-
This file should contain the model definition, and call the `@register` macro to register the model with the `ADTests` package.
17-
See the existing files in that directory for examples.
18-
Then, make sure to `include` the new source file in `main.jl`.
1916

20-
To make sure that the definition is included in the final website, you will have to make sure that the filename is the same as the model name (i.e. a model `@model function f()` is in `models/f.jl`).
17+
Inside this file, you do not need to call `using Turing` or any of the AD backends.
18+
However, you will have to make sure to import any other packages that your model uses.
19+
20+
This file should have, as the final line, the creation of the Turing model object using `model = model_f(...)`.
21+
(It is mandatory for the model object to be called `model`.)
22+
23+
Then, inside `main.jl`, call `@include_model category_heading model_name`.
24+
25+
- `category_heading` is a string that is used to determine which table the model appears under on the website.
26+
- For the automated tests to run properly, `model_name` **must** be consistent between the following:
27+
- The name of the model itself i.e. `@model function model_name(...)`
28+
- The filename i.e. `models/model_name.jl`
29+
- The name of the model in `main.jl` i.e. `@include_model "Category Heading" model_name`
30+
31+
Ideally, `model_name` would be self-explanatory, i.e. it would serve to illustrate exactly one feature and the name would indicate this.
32+
However, if necessary, you can add explanatory comments inside the model definition file.
33+
34+
You can see the existing files in that directory for examples.
35+
36+
> [!NOTE]
37+
> This setup does admittedly feel a bit complicated.
38+
> Unfortunately I could not find a simpler way to get all the components (Julia, Python, web app) to work together in an automated fashion.
39+
> Hopefully it is a small price to pay for the ability to just add a new model and have it be automatically included on the website.
2140
2241
## I want to edit the website!
2342

0 commit comments

Comments
 (0)