Skip to content

Commit 01b6acf

Browse files
authored
Merge branch 'main' into predict
2 parents 7862931 + 82e1e4a commit 01b6acf

File tree

14 files changed

+659
-185
lines changed

14 files changed

+659
-185
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ jobs:
1212
- name: CompatHelper.main()
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} # for triggering CI
15+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
1616
run: julia -e 'using CompatHelper; CompatHelper.main(; subdirs=["", "test"])'

.github/workflows/Docs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags: '*'
8+
pull_request:
9+
branches:
10+
- main
11+
12+
concurrency:
13+
# Skip intermediate builds: always.
14+
# Cancel intermediate builds: only if it is a pull request build.
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
17+
18+
permissions:
19+
contents: write
20+
pull-requests: read
21+
statuses: write
22+
23+
jobs:
24+
docs:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: julia-actions/setup-julia@latest
29+
with:
30+
version: '1'
31+
- name: Install dependencies
32+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
33+
- name: Build and deploy
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
36+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
37+
JULIA_DEBUG: Documenter # Print `@debug` statements (https://github.com/JuliaDocs/Documenter.jl/issues/955)
38+
run: julia --project=docs/ docs/make.jl

.github/workflows/DocsNav.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Add Navbar
2+
3+
on:
4+
page_build: # Triggers the workflow on push events to gh-pages branch
5+
workflow_dispatch: # Allows manual triggering
6+
schedule:
7+
- cron: '0 0 * * 0' # Runs every week on Sunday at midnight (UTC)
8+
9+
jobs:
10+
add-navbar:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout gh-pages
16+
uses: actions/checkout@v4
17+
with:
18+
ref: gh-pages
19+
fetch-depth: 0
20+
21+
- name: Download insert_navbar.sh
22+
run: |
23+
curl -O https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/insert_navbar.sh
24+
chmod +x insert_navbar.sh
25+
26+
- name: Update Navbar
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
run: |
30+
git config user.name github-actions[bot]
31+
git config user.email github-actions[bot]@users.noreply.github.com
32+
33+
# Define the URL of the navbar to be used
34+
NAVBAR_URL="https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/TuringNavbar.html"
35+
36+
# Update all HTML files in the current directory (gh-pages root)
37+
./insert_navbar.sh . $NAVBAR_URL
38+
39+
# Remove the insert_navbar.sh file
40+
rm insert_navbar.sh
41+
42+
# Check if there are any changes
43+
if [[ -n $(git status -s) ]]; then
44+
git add .
45+
git commit -m "Added navbar and removed insert_navbar.sh"
46+
git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages
47+
else
48+
echo "No changes to commit"
49+
fi

.github/workflows/TagBot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ jobs:
1212
- uses: JuliaRegistries/TagBot@v1
1313
with:
1414
token: ${{ secrets.GITHUB_TOKEN }}
15+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ docs/site/
2424
Manifest.toml
2525

2626
# vs code environment
27-
.vscode
27+
.vscode
28+
29+
.DS_Store

Project.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@ uuid = "7a57a42e-76ec-4ea3-a279-07e840d6d9cf"
33
keywords = ["probablistic programming"]
44
license = "MIT"
55
desc = "Common interfaces for probabilistic programming"
6-
version = "0.7"
6+
version = "0.9.0"
77

88
[deps]
99
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
10+
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
1011
DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
12+
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1113
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
12-
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
1314
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1415
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
1516

1617
[compat]
1718
AbstractMCMC = "2, 3, 4, 5"
19+
Accessors = "0.1"
1820
DensityInterface = "0.4"
19-
Setfield = "0.8.2, 1"
20-
StatsBase = "0.32, 0.33"
21+
JSON = "0.19 - 0.21"
2122
Random = "1.6"
22-
SparseArrays = "1.6"
23+
StatsBase = "0.32, 0.33"
2324
julia = "~1.6.6, 1.7.3"

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

docs/make.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Documenter
2+
using AbstractPPL
3+
4+
# Doctest setup
5+
DocMeta.setdocmeta!(AbstractPPL, :DocTestSetup, :(using AbstractPPL); recursive=true)
6+
7+
makedocs(;
8+
sitename="AbstractPPL",
9+
modules=[AbstractPPL],
10+
pages=[
11+
"Home" => "index.md",
12+
"API" => "api.md",
13+
],
14+
checkdocs=:exports,
15+
doctest=false,
16+
)
17+
18+
deploydocs(; repo="github.com/TuringLang/AbstractPPL.jl.git", push_preview=true)

docs/src/api.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# API
2+
3+
## VarNames
4+
5+
```@docs
6+
VarName
7+
getsym
8+
getoptic
9+
inspace
10+
subsumes
11+
subsumedby
12+
vsym
13+
@varname
14+
@vsym
15+
```
16+
17+
## VarName serialisation
18+
19+
```@docs
20+
index_to_dict
21+
dict_to_index
22+
varname_to_string
23+
string_to_varname
24+
```
25+
26+
## Abstract model functions
27+
28+
```@docs
29+
AbstractProbabilisticProgram
30+
condition
31+
decondition
32+
logdensityof
33+
AbstractContext
34+
evaluate!!
35+
```
36+
37+
## Abstract traces
38+
39+
```@docs
40+
AbstractModelTrace
41+
```

docs/src/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# AbstractPPL.jl
2+
3+
A lightweight package containing interfaces and associated APIs for modelling languages for probabilistic programming.

0 commit comments

Comments
 (0)