Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
#1038)

* addresses JuliaGraphs/GraphIO.jl#18 (comment)

* test coverage
  • Loading branch information
sbromberger authored Oct 5, 2018
1 parent d9787a2 commit b05462a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/persistence/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ The default graph name assigned to `gname` may change in the future.
function savegraph(fn::AbstractString, g::AbstractGraph, gname::AbstractString,
format::AbstractGraphFormat; compress=nothing
)
compress === nothing ||
Base.depwarn("Saving compressed graphs is no longer supported in LightGraphs. Use `LGCompressedFormat()` from the `GraphIO.jl` package instead. Saving uncompressed.", :savegraph)
if compress !== nothing
if !compress
@info("Note: the `compress` keyword is no longer supported in LightGraphs. Saving uncompressed.")
else
Base.depwarn("Saving compressed graphs is no longer supported in LightGraphs. Use `LGCompressedFormat()` from the `GraphIO.jl` package instead. Saving uncompressed.", :savegraph)
end
end
io = open(fn, "w")
try
return savegraph(io, g, gname, format)
Expand Down
1 change: 1 addition & 0 deletions test/persistence/persistence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@test_deprecated r"Saving compressed graphs is no longer supported" savegraph(f, p1; compress=true)
@test savegraph(f, p1) == 1
@test_deprecated r"Saving compressed graphs is no longer supported" savegraph(f, p1, LGFormat(); compress=true)
@test_logs (:info,r"Note: the `compress` keyword is no longer supported in LightGraphs") savegraph(f, p1; compress=false)
@test savegraph(f, p1, LGFormat()) == 1
@test savegraph(f, p2) == 1
@test (ne(p2), nv(p2)) == (9, 10)
Expand Down

0 comments on commit b05462a

Please sign in to comment.