Skip to content

Commit a86807c

Browse files
committed
fix documentation build
1 parent 32983f5 commit a86807c

File tree

4 files changed

+12
-70
lines changed

4 files changed

+12
-70
lines changed

docs/src/developers_guide.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,10 @@ GraphPPL.ResizableArray
112112
```
113113
`ResizableArray` is a subtype of `AbstractArray`, and implements all the functions that are expected from an array. Note that `size` returns the largest size of the array across each dimension, so an array of size `(2, 3)` does not necessarily has to have an element stored at index `(2, 3)`, instead there exists a vector of length 3 along the second dimension.
114114

115-
## Source code of the model
116-
117-
The source code of a model can be accessed using the `source_code` function. This function returns a string representation of the model specification, which can be useful for debugging or documentation purposes.
118-
119-
```@docs
120-
GraphPPL.source_code
121-
```
122-
123115
## Model creation engine internal
124116

125117
```@docs
126118
GraphPPL.Context
127-
GraphPPL.ModelGenerator
128119
GraphPPL.FactorID
129120
GraphPPL.NodeData
130121
GraphPPL.NodeLabel
@@ -164,6 +155,11 @@ GraphPPL.hasextra
164155
GraphPPL.getextra
165156
GraphPPL.setextra!
166157
158+
GraphPPL.ModelGenerator
159+
GraphPPL.with_plugins
160+
GraphPPL.with_backend
161+
GraphPPL.with_source
162+
167163
GraphPPL.make_node!
168164
GraphPPL.add_atomic_factor_node!
169165
GraphPPL.add_toplevel_model!
@@ -200,7 +196,6 @@ GraphPPL.apply_pipeline
200196
GraphPPL.options_vector_to_named_tuple
201197
GraphPPL.get_created_by
202198
GraphPPL.convert_to_anonymous
203-
GraphPPL.get_source_code_function
204199
```
205200

206201
## Auxiliary functionality

docs/src/plugins/overview.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ The following plugins are available by default in `GraphPPL`:
2424

2525
## Using a plugin
2626

27-
To use a plugin, call the `with_plugins` function when constructing a model:
28-
29-
```@docs
30-
GraphPPL.with_plugins
31-
```
27+
To use a plugin, call the [`GraphPPL.with_plugins`](@ref) function when constructing a model:
3228

3329
The `PluginsCollection` is a collection of plugins that will be applied to the model. The order of plugins in the collection is important, as the `preprocess_plugin` and `postprocess_plugin` functions are called in the order of the plugins in the collection.
3430

src/graph_engine.jl

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2189,45 +2189,3 @@ function preprocess_plugins(
21892189
return preprocess_plugin(plugin, model, context, label, nodedata, options)::Tuple{NodeLabel, NodeData}
21902190
end::Tuple{NodeLabel, NodeData}
21912191
end
2192-
2193-
"""
2194-
source_code(backend, model_function, n_interfaces)
2195-
2196-
Returns the source code of the model function. The `n_interfaces` argument can be either an `Integer` or a `StaticInt`
2197-
specifying the total number of interfaces expected by the model.
2198-
2199-
!!! note
2200-
The example below uses `DefaultBackend`, which is not necessarily the backend that is currently active.
2201-
2202-
```jldoctest
2203-
julia> import GraphPPL: @model, DefaultBackend
2204-
2205-
julia> @model function beta_bernoulli(y)
2206-
θ ~ Beta(1, 1)
2207-
for i = eachindex(y)
2208-
y[i] ~ Bernoulli(θ)
2209-
end
2210-
end
2211-
2212-
julia> println(GraphPPL.source_code(DefaultBackend(), beta_bernoulli, 1))
2213-
function beta_bernoulli(y)
2214-
θ ~ Beta(1, 1)
2215-
for i = eachindex(y)
2216-
y[i] ~ Bernoulli(θ)
2217-
end
2218-
end
2219-
2220-
julia> println(GraphPPL.source_code(DefaultBackend(), beta_bernoulli, GraphPPL.static(1)))
2221-
function beta_bernoulli(y)
2222-
θ ~ Beta(1, 1)
2223-
for i = eachindex(y)
2224-
y[i] ~ Bernoulli(θ)
2225-
end
2226-
end
2227-
```
2228-
"""
2229-
function source_code end
2230-
2231-
source_code(backend, model_function, n_interfaces::Integer) = source_code(backend, model_function, GraphPPL.static(n_interfaces))
2232-
source_code(backend, model_function, n_interfaces::StaticInt) =
2233-
error("Backend $backend must implement a method for `source_code` for `$(model_function)` with $(n_interfaces) interfaces.")

src/model_generator.jl

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,14 @@ julia> @model function beta_bernoulli(y)
2929
end
3030
end
3131
32-
# Create basic generator
33-
julia> generator = beta_bernoulli(y = rand(10))
32+
julia> generator = beta_bernoulli(y = rand(10));
3433
35-
# Define custom backend
3634
julia> struct CustomBackend end
3735
38-
# Create generator with custom backend
39-
julia> generator_with_backend = GraphPPL.with_backend(generator, CustomBackend())
36+
julia> generator_with_backend = GraphPPL.with_backend(generator, CustomBackend());
4037
41-
# Create generator with additional plugins
42-
julia> generator_with_plugins = GraphPPL.with_plugins(generator, PluginsCollection())
38+
julia> generator_with_plugins = GraphPPL.with_plugins(generator, GraphPPL.PluginsCollection());
4339
44-
# Retrieve source code
4540
julia> println(GraphPPL.getsource(generator))
4641
function beta_bernoulli(y)
4742
θ ~ Beta(1, 1)
@@ -50,15 +45,13 @@ function beta_bernoulli(y)
5045
end
5146
end
5247
53-
# Override source code
54-
julia> generator_with_source = GraphPPL.with_source(generator, "Hello, world!")
48+
julia> generator_with_source = GraphPPL.with_source(generator, "Hello, world!");
5549
56-
# Retrieve modified source code
57-
julia> println(GraphPPL.getsource(generator))
50+
julia> println(GraphPPL.getsource(generator_with_source))
5851
Hello, world!
5952
```
6053
61-
See also: [`with_plugins`](@ref), [`with_backend`](@ref), [`with_source`](@ref), [`source_code`](@ref)
54+
See also: [`with_plugins`](@ref), [`with_backend`](@ref), [`with_source`](@ref)
6255
"""
6356
struct ModelGenerator{G, K, P, B, S}
6457
model::G

0 commit comments

Comments
 (0)