diff --git a/Project.toml b/Project.toml index 926a140..6cd266e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MeshArrays" uuid = "cb8c808f-1acf-59a3-9d2b-6e38d009f683" authors = ["gaelforget "] -version = "0.3.13" +version = "0.3.14" [deps] CatViews = "81a5f4ea-a946-549a-aa7e-2a7f63a27d31" diff --git a/src/Type_gcmarray.jl b/src/Type_gcmarray.jl index 857fcb0..8eca75a 100644 --- a/src/Type_gcmarray.jl +++ b/src/Type_gcmarray.jl @@ -239,6 +239,8 @@ function Base.show(io::IO, z::gcmarray{T, N, Array{T,2}}) where {T,N} return end +import Base: display; display(X::gcmarray)=show(X) + function Base.similar(A::gcmarray;m::varmeta=defaultmeta) if ndims(A)==1 B=gcmarray(similar(A.grid),eltype(A),copy(A.fSize),copy(A.fIndex); meta=m) diff --git a/src/Types.jl b/src/Types.jl index 9919f50..f7685d7 100644 --- a/src/Types.jl +++ b/src/Types.jl @@ -52,6 +52,21 @@ copy_if_isarray(x) = isa(x,Array) ? copy(x) : x Base.similar(g::gcmgrid)=gcmgrid(g.path, g.class, g.nFaces, copy(g.fSize), copy_if_isarray(g.ioSize), g.ioPrec, g.read, g.write) +function Base.show(io::IO, z::gcmgrid) + printstyled(io, " gcmgrid \n",color=:normal) + printstyled(io, " class = ",color=:normal) + printstyled(io, "$(z.class)\n",color=:magenta) + printstyled(io, " path = ",color=:normal) + printstyled(io, "$(z.path)\n",color=:magenta) + printstyled(io, " fSize = ",color=:normal) + printstyled(io, "$(z.fSize)\n",color=:magenta) + printstyled(io, " ioSize = ",color=:normal) + printstyled(io, "$(z.ioSize)\n",color=:magenta) + printstyled(io, " ioPrec = ",color=:normal) + printstyled(io, "$(z.ioPrec)\n",color=:magenta) + return +end + """ varmeta @@ -252,5 +267,17 @@ Base.@kwdef struct gridmask tmp3d::MeshArray end - +function Base.show(io::IO, z::gridmask) + printstyled(io, " gridmask \n",color=:normal) + printstyled(io, " map = ",color=:normal) + printstyled(io, "$(typeof(z.map))\n",color=:blue) + printstyled(io, " depths = ",color=:normal) + printstyled(io, "$(typeof(z.depths))\n",color=:blue) + printstyled(io, " names = ",color=:normal) + printstyled(io, "$(z.names[1] )\n",color=:cyan) + for iFace=2:length(z.names) + printstyled(io, " $(z.names[iFace])\n",color=:cyan) + end + return +end