Skip to content

Commit

Permalink
Merge pull request #151 from gaelforget/v0p3p14b
Browse files Browse the repository at this point in the history
V0p3p14b
  • Loading branch information
gaelforget authored Sep 19, 2024
2 parents f0af994 + cfdd8ca commit 29a6194
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MeshArrays"
uuid = "cb8c808f-1acf-59a3-9d2b-6e38d009f683"
authors = ["gaelforget <[email protected]>"]
version = "0.3.13"
version = "0.3.14"

[deps]
CatViews = "81a5f4ea-a946-549a-aa7e-2a7f63a27d31"
Expand Down
2 changes: 2 additions & 0 deletions src/Type_gcmarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
29 changes: 28 additions & 1 deletion src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 29a6194

Please sign in to comment.