-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@show output needs to be compactified #13
Comments
I have no idea how to do this, it might be a good idea to post a question on the julia-users page. Or see if you can find other packages that do it for their custom types. (Maybe look at LightGraphs.jl and see how they handle the show macro?) |
I don't think there's any way to get around this for now. I asked here.. and multiple issues opened on IJulia but none of the workarounds worked for me - I don't see one standard solution anyway. |
If you define a function
This is from LightGraphs.jl function show(io::IO, g::Graph)
if nv(g) == 0
print(io, "empty undirected graph")
else
print(io, "{$(nv(g)), $(ne(g))} undirected graph")
end
end Does this not work for you in IJulia specifically? In order to achieve the effect of "truncating," you could have a threshold that says: if number of vertices is more than threshold, print summary information, otherwise dump the whole COO representation. |
Something like this should work for us... It's just a matter of figuring out if there is a standard "Julia" way of handling this problem (doesn't seem to be) or if we should just roll something ourselves (not too hard...). Most of our types are going to be structs of standard Julia types that would be fairly clean to "@show" using the truncated output that appears in the console, for instance. I think the routine I was looking for was
So the real question is how to structure |
If you run @show scomponents(A) then it outputs ALL of the information with no truncation. This breaks IJulia if you have a large matrix.
The text was updated successfully, but these errors were encountered: