From aa4acf2c127728a3732c7f886d6ea7a1b17d934a Mon Sep 17 00:00:00 2001 From: imreddyTeja Date: Tue, 6 Jan 2026 14:29:35 -0800 Subject: [PATCH 1/4] Add compact show method for space type --- src/Spaces/Spaces.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Spaces/Spaces.jl b/src/Spaces/Spaces.jl index 721019506e..bf5fa73c93 100644 --- a/src/Spaces/Spaces.jl +++ b/src/Spaces/Spaces.jl @@ -61,6 +61,17 @@ abstract type AbstractSpace end function grid end function staggering end +function Base.show(io::IO, ::MIME"text/plain", x::Type{<:AbstractSpace}) + compact = get(io, :compact, true) + compact || return Base._show_type(io, x) + Base.show_type_name(io, x.name) +end + +function Base.show(io::IO, x::Type{<:AbstractSpace}) + compact = get(io, :compact, true) + compact || return Base._show_type(io, x) + Base.show_type_name(io, x.name) +end ClimaComms.context(space::AbstractSpace) = ClimaComms.context(grid(space)) ClimaComms.device(space::AbstractSpace) = ClimaComms.device(grid(space)) From 2e7aa76386ea41613322dfaa3ca126c21ded2d90 Mon Sep 17 00:00:00 2001 From: imreddyTeja Date: Fri, 9 Jan 2026 14:27:34 -0800 Subject: [PATCH 2/4] show staggering --- src/Spaces/Spaces.jl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Spaces/Spaces.jl b/src/Spaces/Spaces.jl index bf5fa73c93..4987b27efc 100644 --- a/src/Spaces/Spaces.jl +++ b/src/Spaces/Spaces.jl @@ -62,15 +62,22 @@ function grid end function staggering end function Base.show(io::IO, ::MIME"text/plain", x::Type{<:AbstractSpace}) - compact = get(io, :compact, true) - compact || return Base._show_type(io, x) - Base.show_type_name(io, x.name) + Base.show(io, x) end function Base.show(io::IO, x::Type{<:AbstractSpace}) - compact = get(io, :compact, true) - compact || return Base._show_type(io, x) + compact = get(io, :compact, true) + (compact && x isa DataType) || return Base._show_type(io, x) + Base.show_typealias(io, x) && return Base.show_type_name(io, x.name) + print(io, "{") + first_param = true + for param in x.parameters + first_param || print(io, ", ") + Base.show_type_name(io, param.name) + first_param = false + end + print(io, "}") end ClimaComms.context(space::AbstractSpace) = ClimaComms.context(grid(space)) From 07608d3d83a3d5ef86232a8d032623e530ac3799 Mon Sep 17 00:00:00 2001 From: imreddyTeja Date: Wed, 14 Jan 2026 13:07:24 -0800 Subject: [PATCH 3/4] nospec --- src/Spaces/Spaces.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Spaces/Spaces.jl b/src/Spaces/Spaces.jl index 4987b27efc..b8fc55b2fc 100644 --- a/src/Spaces/Spaces.jl +++ b/src/Spaces/Spaces.jl @@ -61,12 +61,12 @@ abstract type AbstractSpace end function grid end function staggering end -function Base.show(io::IO, ::MIME"text/plain", x::Type{<:AbstractSpace}) +function Base.show(io::IO, ::MIME"text/plain", @nospecialize(x::Type{<:AbstractSpace})) Base.show(io, x) end -function Base.show(io::IO, x::Type{<:AbstractSpace}) - compact = get(io, :compact, true) +function Base.show(io::IO, @nospecialize(x::Type{<:AbstractSpace})) + compact = get(io, :compact, true) (compact && x isa DataType) || return Base._show_type(io, x) Base.show_typealias(io, x) && return Base.show_type_name(io, x.name) From fb807ba5a21ccb561901fd769d6a916120868cfd Mon Sep 17 00:00:00 2001 From: imreddyTeja Date: Wed, 14 Jan 2026 13:51:33 -0800 Subject: [PATCH 4/4] force spec --- src/Spaces/Spaces.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Spaces/Spaces.jl b/src/Spaces/Spaces.jl index b8fc55b2fc..7b0e73f0c9 100644 --- a/src/Spaces/Spaces.jl +++ b/src/Spaces/Spaces.jl @@ -61,11 +61,11 @@ abstract type AbstractSpace end function grid end function staggering end -function Base.show(io::IO, ::MIME"text/plain", @nospecialize(x::Type{<:AbstractSpace})) +function Base.show(io::IO, ::MIME"text/plain", x::Type{T}) where {T<:AbstractSpace} Base.show(io, x) end -function Base.show(io::IO, @nospecialize(x::Type{<:AbstractSpace})) +function Base.show(io::IO, x::Type{T}) where {T<:AbstractSpace} compact = get(io, :compact, true) (compact && x isa DataType) || return Base._show_type(io, x) Base.show_typealias(io, x) && return