Skip to content

Commit 783f8be

Browse files
authored
Fix docstring issue #234 (#235)
* Remove g * Improve docstring * Remove default format from signature * Add example * FIx
1 parent c6589db commit 783f8be

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/persistence/common.jl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,25 @@ function savegraph(fn::AbstractString, g::AbstractSimpleGraph; compress=nothing)
107107
end
108108

109109
"""
110-
savegraph(file, g, d, format=LGFormat)
110+
savegraph(file, d, format=LGFormat())
111111
112-
Save a dictionary of `graphname => graph` to `file` in the format `format`.
112+
Save a dictionary `d` of `graphname => graph` to `file` in the format `format`.
113113
Return the number of graphs written.
114114
115+
# Examples
116+
```jldoctest
117+
julia> g1 = SimpleGraph(5,8)
118+
{5, 8} undirected simple Int64 graph
119+
120+
julia> g2 = SimpleGraph(7,10)
121+
{7, 10} undirected simple Int64 graph
122+
123+
julia> d = Dict("graph_1" => g1, "graph_2" => g2);
124+
125+
julia> savegraph("myfile.txt", d, LGFormat())
126+
2
127+
```
128+
115129
### Implementation Notes
116130
Will only work if the file format supports multiple graph types.
117131
"""

0 commit comments

Comments
 (0)