Skip to content

Commit

Permalink
Improve on meta info display
Browse files Browse the repository at this point in the history
  • Loading branch information
henry2004y committed Apr 20, 2021
1 parent 74083fa commit 8965e09
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
*.outs
*.log
*.dat
*.tree
*.info
*.vtu
*.eps
*.png
*.avi
Expand Down
15 changes: 11 additions & 4 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[JLLWrappers]]
git-tree-sha1 = "a431f5f2ca3f4feef3bd7a5e94b8b8d4f2f647a0"
deps = ["Preferences"]
git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.2.0"
version = "1.3.0"

[[LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
Expand Down Expand Up @@ -99,6 +100,12 @@ uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Preferences]]
deps = ["TOML"]
git-tree-sha1 = "ea79e4c9077208cd3bc5d29631a26bc0cff78902"
uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.2.1"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Expand Down Expand Up @@ -151,9 +158,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[WriteVTK]]
deps = ["Base64", "CodecZlib", "FillArrays", "LightXML", "Random", "TranscodingStreams"]
git-tree-sha1 = "37eef911a9c5211e0ae4362dc0477cfe6c537ffa"
git-tree-sha1 = "2d559f58ff021c0f0f3d2394d2688a84a84257aa"
uuid = "64499a7a-5c06-52f2-abe2-ccb03c286192"
version = "1.9.1"
version = "1.9.2"

[[XML2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"]
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Batsrus"
uuid = "e74ebddf-6ac1-4047-a0e5-c32c99e57753"
authors = ["Hongyang Zhou <[email protected]>"]
version = "0.2.6"
version = "0.2.7"

[deps]
FortranFiles = "c58ffaec-ab22-586d-bfc5-781a99fd0b10"
Expand Down
18 changes: 12 additions & 6 deletions src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ searchdir(path,key) = filter(x->occursin(key,x), readdir(path))

function Base.show(io::IO, s::Data)
showhead(s)
println(io, "filesize = ", s.list.bytes, " bytes")
println(io, "snapshots = ", s.list.npictinfiles)
println(io, "x = ", s.x)
println(io, "w = ", s.w)
if s.list.bytes 1e9
@info "filesize = $(s.list.bytes/1e9) GB"
elseif s.list.bytes 1e6
@info "filesize = $(s.list.bytes/1e6) MB"
elseif s.list.bytes 1e3
@info "filesize = $(s.list.bytes/1e3) KB"
else
@info "filesize = $(s.list.bytes) bytes"
end
@info "snapshots = $(s.list.npictinfiles)"
end

"""
Expand Down Expand Up @@ -335,9 +341,9 @@ function getfilehead(fileID::IOStream, type::String)
eqpar = parse.(Float64, split(readline(fileID)))
end
varname = readline(fileID)
elseif ftype ["real4","binary"]
elseif ftype ["real4", "binary"]
skip(fileID, tag) # skip record start tag.
headline = String(read(fileID, lenstr))
headline = rstrip(String(read(fileID, lenstr)))
skip(fileID, 2*tag) # skip record end/start tags.
it = read(fileID, Int32)
t = read(fileID, Float32)
Expand Down

0 comments on commit 8965e09

Please sign in to comment.