Skip to content

Commit 7e32615

Browse files
fix doctests
1 parent b96376c commit 7e32615

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
lines changed

GNNGraphs/docs/make.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ mathengine = MathJax3(Dict(:loader => Dict("load" => ["[tex]/require", "[tex]/ma
2525

2626
makedocs(;
2727
modules = [GNNGraphs],
28-
doctest = false, # TODO enable doctest
2928
format = Documenter.HTML(; mathengine,
3029
prettyurls = get(ENV, "CI", nothing) == "true",
3130
assets = [],

GNNGraphs/docs/src/guides/heterograph.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,11 @@ julia> g.etypes # edge types
8888

8989
Node, edge, and graph features can be added at construction time or later using:
9090
```jldoctest hetero
91-
# equivalent to g.ndata[:user][:x] = ...
92-
julia> g[:user].x = rand(Float32, 64, 3);
91+
julia> g[:user].x = rand(Float32, 64, 3); # equivalent to g.ndata[:user][:x] = ...
9392
9493
julia> g[:movie].z = rand(Float32, 64, 13);
9594
96-
# equivalent to g.edata[(:user, :rate, :movie)][:e] = ...
97-
julia> g[:user, :rate, :movie].e = rand(Float32, 64, 4);
95+
julia> g[:user, :rate, :movie].e = rand(Float32, 64, 4); # equivalent to g.edata[(:user, :rate, :movie)][:e] = ...
9896
9997
julia> g
10098
GNNHeteroGraph:
@@ -110,6 +108,8 @@ GNNHeteroGraph:
110108
## Batching
111109
Similarly to graphs, also heterographs can be batched together.
112110
```jldoctest hetero
111+
julia> using MLUtils
112+
113113
julia> gs = [rand_bipartite_heterograph((5, 10), 20) for _ in 1:32];
114114
115115
julia> MLUtils.batch(gs)
@@ -140,4 +140,4 @@ end
140140

141141
## Graph convolutions on heterographs
142142

143-
See `HeteroGraphConv` for how to perform convolutions on heterogeneous graphs.
143+
See [`HeteroGraphConv`](@ref) for how to perform convolutions on heterogeneous graphs.

GNNGraphs/docs/src/guides/temporalgraph.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ Snapshots in a temporal graph can be accessed using indexing:
6565
julia> snapshots = [rand_graph(10, 20), rand_graph(10, 14), rand_graph(10, 22)];
6666
6767
julia> tg = TemporalSnapshotsGNNGraph(snapshots)
68+
TemporalSnapshotsGNNGraph:
69+
num_nodes: [10, 10, 10]
70+
num_edges: [20, 14, 22]
71+
num_snapshots: 3
6872
6973
julia> tg[1] # first snapshot
7074
GNNGraph:
@@ -169,7 +173,7 @@ TemporalSnapshotsGNNGraph:
169173
num_edges: [20, 14, 22]
170174
num_snapshots: 3
171175
tgdata:
172-
y = 3×1 Matrix{Float32}
176+
y = 3×1 Matrix{Float32}
173177
174178
julia> tg.ndata # vector of DataStore containing node features for each snapshot
175179
3-element Vector{DataStore}:

GNNGraphs/src/gnnheterograph/gnnheterograph.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,18 @@ function Base.show(io::IO, ::MIME"text/plain", g::GNNHeteroGraph)
198198
print(io, "\n ndata:")
199199
for k in sort(collect(keys(g.ndata)))
200200
isempty(g.ndata[k]) && continue
201-
print(io, "\n\t", _str(k), " => $(shortsummary(g.ndata[k]))")
201+
print(io, "\n ", _str(k), " => $(shortsummary(g.ndata[k]))")
202202
end
203203
end
204204
if !isempty(g.edata) && !all(isempty, values(g.edata))
205205
print(io, "\n edata:")
206206
for k in sort(collect(keys(g.edata)))
207207
isempty(g.edata[k]) && continue
208-
print(io, "\n\t$k => $(shortsummary(g.edata[k]))")
208+
print(io, "\n $k => $(shortsummary(g.edata[k]))")
209209
end
210210
end
211211
if !isempty(g.gdata)
212-
print(io, "\n gdata:\n\t")
212+
print(io, "\n gdata:\n ")
213213
shortsummary(io, g.gdata)
214214
end
215215
end

GNNGraphs/src/mldatasets.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ GNNGraph:
1515
num_nodes: 2708
1616
num_edges: 10556
1717
ndata:
18-
val_mask = 2708-element BitVector
19-
targets = 2708-element Vector{Int64}
20-
test_mask = 2708-element BitVector
21-
features = 1433×2708 Matrix{Float32}
22-
train_mask = 2708-element BitVector
18+
val_mask = 2708-element BitVector
19+
targets = 2708-element Vector{Int64}
20+
test_mask = 2708-element BitVector
21+
features = 1433×2708 Matrix{Float32}
22+
train_mask = 2708-element BitVector
2323
```
2424
"""
2525
function mldataset2gnngraph(dataset::D) where {D}

GNNGraphs/src/transform.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,14 +459,14 @@ GNNGraph:
459459
num_nodes: 4
460460
num_edges: 5
461461
edata:
462-
e = 5-element Vector{Float64}
462+
e = 5-element Vector{Float64}
463463
464464
julia> g2 = to_bidirected(g)
465465
GNNGraph:
466466
num_nodes: 4
467467
num_edges: 7
468468
edata:
469-
e = 7-element Vector{Float64}
469+
e = 7-element Vector{Float64}
470470
471471
julia> edge_index(g2)
472472
([1, 2, 2, 3, 3, 4, 4], [2, 1, 3, 2, 4, 3, 4])
@@ -644,22 +644,22 @@ GNNGraph:
644644
num_nodes: 4
645645
num_edges: 4
646646
ndata:
647-
x = 3×4 Matrix{Float32}
647+
x = 3×4 Matrix{Float32}
648648
649649
julia> g2 = rand_graph(5, 4, ndata=zeros(Float32, 3, 5))
650650
GNNGraph:
651651
num_nodes: 5
652652
num_edges: 4
653653
ndata:
654-
x = 3×5 Matrix{Float32}
654+
x = 3×5 Matrix{Float32}
655655
656656
julia> g12 = MLUtils.batch([g1, g2])
657657
GNNGraph:
658658
num_nodes: 9
659659
num_edges: 8
660660
num_graphs: 2
661661
ndata:
662-
x = 3×9 Matrix{Float32}
662+
x = 3×9 Matrix{Float32}
663663
664664
julia> g12.ndata.x
665665
3×9 Matrix{Float32}:

GNNLux/docs/make.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ cp(joinpath(@__DIR__, "../../GNNlib/docs/src"),
3737

3838
makedocs(;
3939
modules = [GNNLux, GNNGraphs, GNNlib],
40-
doctest = false, # TODO: enable doctest
4140
plugins = [interlinks],
4241
format = Documenter.HTML(; mathengine,
4342
prettyurls = get(ENV, "CI", nothing) == "true",

GNNlib/docs/make.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ cp(joinpath(@__DIR__, "../../GNNGraphs/docs/src/"),
2626

2727
makedocs(;
2828
modules = [GNNlib, GNNGraphs],
29-
doctest = false, # TODO enable doctest
3029
plugins = [interlinks],
3130
format = Documenter.HTML(; mathengine, prettyurls, assets = assets, size_threshold=nothing),
3231
sitename = "GNNlib.jl",

GraphNeuralNetworks/docs/make.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ cp(joinpath(@__DIR__, "../../GNNlib/docs/src"),
3737

3838
makedocs(;
3939
modules = [GraphNeuralNetworks, GNNGraphs, GNNlib],
40-
doctest = false, # TODO: enable doctest
4140
plugins = [interlinks],
4241
format = Documenter.HTML(; mathengine,
4342
prettyurls = get(ENV, "CI", nothing) == "true",

0 commit comments

Comments
 (0)