diff --git a/Project.toml b/Project.toml index 47d4a23..631b235 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Jadex" uuid = "302b6ea9-03d1-47d0-b3e6-7bc5ec1c11d5" authors = ["Brian Svoboda and contributors"] -version = "0.3.2" +version = "0.3.3" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" @@ -10,6 +10,7 @@ Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890" +PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" RecursiveFactorization = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" [compat] diff --git a/src/Jadex.jl b/src/Jadex.jl index 34270cf..838044c 100644 --- a/src/Jadex.jl +++ b/src/Jadex.jl @@ -23,4 +23,6 @@ using .RunDefinition using .EscapeProbability using .GridRunner +include("precompile.jl") + end diff --git a/src/precompile.jl b/src/precompile.jl new file mode 100644 index 0000000..9c09ab5 --- /dev/null +++ b/src/precompile.jl @@ -0,0 +1,18 @@ +using PrecompileTools + +@setup_workload begin + datadir = joinpath(pkgdir(Jadex), "test", "data") + @compile_workload begin + βlvg(0.5) + βslab(0.5) + βsphere(0.5) + mol = Specie("hco+", datadir=datadir) + rdf = RunDef(mol, density=Dict("h2" => 1e4)) + sol = Solution(rdf) + solve!(sol, rdf) + reset!(sol) + solve(rdf) + get_results(rdf) + get_results(sol, rdf) + end +end diff --git a/test/profile.jl b/test/profile.jl index 225afd9..481a039 100644 --- a/test/profile.jl +++ b/test/profile.jl @@ -10,7 +10,7 @@ using Jadex.RunDefinition: get_collision_rates function get_test_data(;reduced=false) - datadir = joinpath(@__DIR__, "data") + datadir = joinpath(pkgdir(Jadex), "test", "data") mol = Specie("hco+", datadir=datadir) bg = blackbody_background(mol, tbg=2.730) rdf = RunDef(mol, density=Dict("h2" => 1e4), tkin=20.0, cdmol=1e13, diff --git a/test/runtests.jl b/test/runtests.jl index f82a4c2..0c2dfd4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,7 @@ using Test using Logging +using Jadex using Jadex.Solver using Jadex.ReadData using Jadex.Background @@ -9,7 +10,7 @@ using Jadex.EscapeProbability using Jadex.GridRunner -const TEST_DATA_DIR = joinpath(@__DIR__, "data") +const TEST_DATA_DIR = joinpath(pkgdir(Jadex), "test", "data") Logging.disable_logging(Logging.Info)