From c505871978aa4514dcf40822c3eb279685a96207 Mon Sep 17 00:00:00 2001 From: Simone Carlo Surace <51025924+simsurace@users.noreply.github.com> Date: Thu, 2 May 2024 12:52:18 +0200 Subject: [PATCH 1/2] Print information about static nature of graph in display The `show` function is only overloaded for inline printing, but when displaying the graph, the information about its static nature is missing, potentially confusing users: ``` julia> g {58089, 120148} directed simple Int32 graph julia> (g, nothing) ({58089, 120148} directed simple static {Int32, Int32} graph, nothing) ``` This PR fixes that. --- src/StaticGraphs.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/StaticGraphs.jl b/src/StaticGraphs.jl index eda5cb8..d01d0cf 100644 --- a/src/StaticGraphs.jl +++ b/src/StaticGraphs.jl @@ -61,6 +61,11 @@ function show(io::IO, g::AbstractStaticGraph) print(io, "{$(nv(g)), $(ne(g))} $dir simple static {$(vectype(g)), $(indtype(g))} graph") end +function show(io::IO, ::MIME"text/plain", g::AbstractStaticGraph) + dir = is_directed(g) ? "directed" : "undirected" + print(io, "{$(nv(g)), $(ne(g))} $dir simple static {$(vectype(g)), $(indtype(g))} graph") +end + @inline function _fvrange(g::AbstractStaticGraph, s::Integer) @inbounds r_start = g.f_ind[s] @inbounds r_end = g.f_ind[s + 1] - 1 From 77480f78214abc15b9b594b6261063880c16fa95 Mon Sep 17 00:00:00 2001 From: Simone Carlo Surace Date: Thu, 10 Apr 2025 10:38:23 +0200 Subject: [PATCH 2/2] Ignore manifest --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1face5b..c35353a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.jl.*.cov *.jl.mem .DS_Store +Manifest.toml