File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -19,3 +19,4 @@ GraphNeuralNetworks/docs/src/GNNGraphs
19
19
GraphNeuralNetworks /docs /src /GNNlib
20
20
tutorials /docs /build
21
21
prova.jl
22
+ pyg.ipynb
Original file line number Diff line number Diff line change @@ -230,16 +230,20 @@ function Base.copy(g::GNNGraph; deep = false)
230
230
end
231
231
end
232
232
233
+ feature_summary (x:: AbstractArray ) = " $(dims2string (size (x))) "
234
+ feature_summary (x:: AbstractString ) = " string($(length (x)) )"
235
+ feature_summary (x:: T ) where T = " $T "
236
+
233
237
function print_feature (io:: IO , feature)
234
238
if ! isempty (feature)
235
239
if length (keys (feature)) == 1
236
240
k = first (keys (feature))
237
241
v = first (values (feature))
238
- print (io, " $(k) : $(dims2string ( size (v) )) " )
242
+ print (io, " $(k) : $(feature_summary (v )) " )
239
243
else
240
244
print (io, " (" )
241
245
for (i, (k, v)) in enumerate (pairs (feature))
242
- print (io, " $k : $(dims2string ( size (v) )) " )
246
+ print (io, " $k : $(feature_summary (v )) " )
243
247
if i == length (feature)
244
248
print (io, " )" )
245
249
else
Original file line number Diff line number Diff line change 344
344
@test g1 != = g2
345
345
end
346
346
347
+ @testset " show" begin
348
+ # no throw when global data is not an array
349
+ g = rand_graph (10 , 20 , gdata = " ciao" )
350
+ @test sprint (show, g) == " GNNGraph(10, 20) with u: string(4) data"
351
+ @test sprint (show, MIME (" text/plain" ), g) == " GNNGraph:\n num_nodes: 10\n num_edges: 20\n gdata:\n u = 4-codeunit String"
352
+ end
353
+
347
354
# # Cannot test this because DataStore is not an ordered collection
348
355
# # Uncomment when/if it will be based on OrderedDict
349
356
# @testset "show" begin
You can’t perform that action at this time.
0 commit comments