Open briochemc opened 6 years ago
That's not good. As a quick work-around you can use the @with_kw_noshow
.
Related, I think the printing should leave away the types of the fields.
Yes, printing just the values without the types would be much nicer. With Unitful:
julia> AAA(a=1.0u"m/s", b=2)
AAA
a: Quantity{Float64,Unitful.Dimensions{(Unitful.Dimension{:Length}(1//1), Unitful.Dimension{:Time}(-1//1))},Unitful.FreeUnits{(Unitful.Unit{:Meter,Unitful.Dimensions{(Unitful.Dimension{:Length}(1//1),)}}(0, 1//1), Unitful.Unit{:Second,Unitful.Dimensions{(Unitful.Dimension{:Time}(1//1),)}}(0, -1//1)),Unitful.Dimensions{(Unitful.Dimension{:Length}(1//1), Unitful.Dimension{:Time}(-1//1))}}}
b: Int64 2
I just use dump
for the printing (with maxdepth=1
). A custom rolled printer would be great. Alternatively increasing maxdepth would yield:
julia> dump(Para(),maxdepth=2)
Para
a: Float64 0.0
b: Complex{Float64}
re: Float64 0.0
im: Float64 1.0
which isn't great either.
Is it on purpose that values of complex or dual types are not shown? (But arrays of those element types are shown?) MWE (v0.7):
Output (added comments are mine):