Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/IMASdd.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module IMASdd

import PrecompileTools
import OrderedCollections
import CoordinateConventions
import ThreadSafeDicts
Expand Down Expand Up @@ -40,6 +39,8 @@ include("math.jl")

include("diagnostics.jl")

include("precompile_workload.jl")

# call dd here to cache precompiled data structure
PrecompileTools.@compile_workload begin
dd()
Expand Down
23 changes: 23 additions & 0 deletions src/precompile_workload.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using PrecompileTools: @compile_workload

@compile_workload begin
# call dd here to cache precompiled data structure
empty_dd = IMASdd.dd()

# File I/O
dd_h5 = IMASdd.hdf2imas(joinpath(pkgdir(IMASdd), "sample", "omas_sample_with_attrs.h5"))
dd_json = IMASdd.json2imas(joinpath(pkgdir(IMASdd), "sample", "omas_sample.json"))
mktempdir() do tmpdir
IMASdd.imas2hdf(dd_h5, joinpath(tmpdir, "imas_sample_copy.h5"))
IMASdd.imas2json(dd_h5, joinpath(tmpdir, "imas_sample_copy.json"))
end

# Equality
dd_h5 == dd_json

# Deep copy
dd_copy = deepcopy(dd_h5)

# Compile REPL display methods (output to devnull to avoid clutter)
show(devnull, MIME"text/plain"(), dd_h5; maxdepth=99)
end
Loading