From b05462a8ae2bcab19a30d974808c5dc6f57ac53a Mon Sep 17 00:00:00 2001 From: Seth Bromberger Date: Fri, 5 Oct 2018 12:28:20 -0700 Subject: [PATCH] =?UTF-8?q?addresses=20https://github.com/JuliaGraphs/Grap?= =?UTF-8?q?hIO.jl/pull/18#issuecomm=E2=80=A6=20(#1038)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * addresses https://github.com/JuliaGraphs/GraphIO.jl/pull/18#issuecomment-426700659 * test coverage --- src/persistence/common.jl | 9 +++++++-- test/persistence/persistence.jl | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/persistence/common.jl b/src/persistence/common.jl index 2c3b94b01..5c38b1e55 100644 --- a/src/persistence/common.jl +++ b/src/persistence/common.jl @@ -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) diff --git a/test/persistence/persistence.jl b/test/persistence/persistence.jl index efc3dd920..62a86be7a 100644 --- a/test/persistence/persistence.jl +++ b/test/persistence/persistence.jl @@ -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)