Hi,
I have a general question regarding dictionaries display. I have a dictionary that has several fields, some of which are instances of types I’ve created that conatin really large arrays of numbers. When I print its contents to screen I get things like this
display(INP_PT_LB)
OrderedDict{Any, Any} with 24 entries:
"kind" => Float64
"rbm" => RBM_net{Float64}(Binary_01(), 180, 20, #undef, #undef, …
"Nβ" => 1000
"T0" => 2000.0
"λ" => 0.95
"Nflip" => 1
"α" => [0.315438, 0.356355, 0.84791, 0.873976, 0.925063, 0.878…
"u_ini" => Bool[1 0 … 1 1; 1 0 … 0 1; … ; 0 1 … 1 0; 1 1 … 0 0]
"xx" => Bool[0 0 … 0 1; 0 1 … 1 0; … ; 1 0 … 1 0; 0 1 … 1 0]
"NMC" => 100
"Nepochs" => 1000
"Nbest" => 1000
"IOUT" => "/tmp/dalenomas.res"
"Print_Bo" => true
"Print_List_Best" => true
"Iters_Print_Best" => 10
"List_Best" => false
"List_uBest" => false
"List_xBest" => false
"List_αBest" => 0.0
"Bmax" => 0
"umax" => 0
"xmax" => 0
"αmax" => 0
which is very nice because large arrays are summarized in one line, and I do not need to see every single number at this point. So display is doing the trick for me.
But now I want to store that same exact form to an ouput strem IO I have opened with
something like
IO = open("/tmp/dale.dat","w")
So the question is: is it possible to redirect the contents of display() to IO?
Notice a println(IO,…) or similar does not work, as it insists in printing the whole (laaaarge) arrays.
Thanks a lot.