MLJBase.jl icon indicating copy to clipboard operation
MLJBase.jl copied to clipboard

Avoid printing empty NamedTuples like empty tuples

Open andreasnoack opened this issue 3 years ago • 2 comments

It can be pretty confusing

julia> (;)
()

julia> ()
()

julia> (;) == ()
false

so it would nice to print the empty case as NamedTuple().

andreasnoack avatar Oct 12 '22 09:10 andreasnoack

Makes sense. I expect the change would happen around about here:

https://github.com/JuliaAI/MLJBase.jl/blob/d2af6bd2ca7b85399db0cf79a1f96f738d342aea/src/show.jl#L72

ablaom avatar Oct 12 '22 21:10 ablaom

In #841 items returned by report(mach) and fitted_params(mach) with empty named tuple values (or nothing) are dropped.

ablaom avatar Oct 12 '22 22:10 ablaom