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
1919GraphNeuralNetworks /docs /src /GNNlib 
2020tutorials /docs /build 
2121prova.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)
230230    end 
231231end 
232232
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+ 
233237function  print_feature (io:: IO , feature)
234238    if  ! isempty (feature)
235239        if  length (keys (feature)) ==  1 
236240            k =  first (keys (feature))
237241            v =  first (values (feature))
238-             print (io, " $(k) : $(dims2string ( size (v) )) " 
242+             print (io, " $(k) : $(feature_summary (v )) " 
239243        else 
240244            print (io, " (" 
241245            for  (i, (k, v)) in  enumerate (pairs (feature))
242-                 print (io, " $k : $(dims2string ( size (v) )) " 
246+                 print (io, " $k : $(feature_summary (v )) " 
243247                if  i ==  length (feature)
244248                    print (io, " )" 
245249                else 
Original file line number Diff line number Diff line change 344344    @test  g1 != =  g2
345345end 
346346
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" ==  " GNNGraph:\n   num_nodes: 10\n   num_edges: 20\n   gdata:\n     u = 4-codeunit String" 
352+ end 
353+ 
347354# # Cannot test this because DataStore is not an ordered collection
348355# # Uncomment when/if it will be based on OrderedDict
349356#  @testset "show" begin
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments