From ba9b03708351f97085e62aefbb5e911b16cefaea Mon Sep 17 00:00:00 2001 From: Melanie Bieli Date: Thu, 18 Jun 2020 16:37:38 -0400 Subject: [PATCH 1/2] Add unit tests --- Manifest.toml | 859 ++++++++++++++++++++++++++++++++-- Project.toml | 7 + src/CalibrateEmulateSample.jl | 6 +- src/GPEmulator.jl | 21 +- src/MCMC.jl | 14 +- src/Observations.jl | 31 +- src/Utilities.jl | 2 +- test/Cloudy/runtests.jl | 5 +- test/EKI/runtests.jl | 64 +++ test/GPEmulator/runtests.jl | 46 ++ test/MCMC/runtests.jl | 79 ++++ test/Observations/runtests.jl | 33 ++ test/Utilities/runtests.jl | 49 +- test/runtests.jl | 14 +- 14 files changed, 1152 insertions(+), 78 deletions(-) create mode 100644 test/EKI/runtests.jl create mode 100644 test/GPEmulator/runtests.jl create mode 100644 test/MCMC/runtests.jl create mode 100644 test/Observations/runtests.jl diff --git a/Manifest.toml b/Manifest.toml index 328af398e..0a68fe3fb 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -1,5 +1,29 @@ # This file is machine-generated - editing it directly is not advised +[[AbstractFFTs]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "051c95d6836228d120f5f4b984dd5aba1624f716" +uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" +version = "0.5.0" + +[[AbstractTrees]] +deps = ["Markdown"] +git-tree-sha1 = "33e450545eaf7699da1a6e755f9ea65f14077a45" +uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" +version = "0.3.3" + +[[Adapt]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "fd04049c7dd78cfef0b06cdc1f0f181467655712" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "1.1.0" + +[[ArnoldiMethod]] +deps = ["DelimitedFiles", "LinearAlgebra", "Random", "SparseArrays", "StaticArrays", "Test"] +git-tree-sha1 = "2b6845cea546604fb4dca4e31414a6a59d39ddcd" +uuid = "ec485272-7323-5ecc-a04f-4719b315124d" +version = "0.0.4" + [[Arpack]] deps = ["Arpack_jll", "Libdl", "LinearAlgebra"] git-tree-sha1 = "2ff92b71ba1747c5fdd541f8fc87736d82f40ec9" @@ -8,66 +32,472 @@ version = "0.4.0" [[Arpack_jll]] deps = ["Libdl", "OpenBLAS_jll", "Pkg"] -git-tree-sha1 = "68a90a692ddc0eb72d69a6993ca26e2a923bf195" +git-tree-sha1 = "e214a9b9bd1b4e1b4f15b22c0994862b66af7ff7" uuid = "68821587-b530-5797-8361-c406ea357684" -version = "3.5.0+2" +version = "3.5.0+3" + +[[ArrayInterface]] +deps = ["LinearAlgebra", "Requires", "SparseArrays"] +git-tree-sha1 = "649c08a5a3a513f4662673d3777fe6ccb4df9f5d" +uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" +version = "2.8.7" + +[[ArrayLayouts]] +deps = ["FillArrays", "LinearAlgebra"] +git-tree-sha1 = "89182776a99b69964e995cc2f1e37b5fc3476d56" +uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" +version = "0.3.4" + +[[BandedMatrices]] +deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "Random", "SparseArrays"] +git-tree-sha1 = "fd300e252fa1d96c75884cfa37fd6a5402c79d4b" +uuid = "aae01518-5342-5314-be14-df237901396f" +version = "0.15.12" [[Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" +[[BinDeps]] +deps = ["Libdl", "Pkg", "SHA", "URIParser", "Unicode"] +git-tree-sha1 = "46cf2c1668ad07aba5a9d331bdeea994a1f13856" +uuid = "9e28174c-4ba2-5203-b857-d8d62c4213ee" +version = "1.0.1" + +[[BinaryProvider]] +deps = ["Libdl", "Logging", "SHA"] +git-tree-sha1 = "ecdec412a9abc8db54c0efc5548c64dfce072058" +uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232" +version = "0.5.10" + +[[BoundaryValueDiffEq]] +deps = ["BandedMatrices", "DiffEqBase", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "NLsolve", "Reexport", "SparseArrays"] +git-tree-sha1 = "3f2969de608af70db755cee9d4490a7294a6afc3" +uuid = "764a87c0-6b3e-53db-9096-fe964310641d" +version = "2.5.0" + +[[CEnum]] +git-tree-sha1 = "215a9aa4a1f23fbd05b92769fdd62559488d70e9" +uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" +version = "0.4.1" + +[[CanonicalTraits]] +deps = ["MLStyle"] +git-tree-sha1 = "1728d2633a206e931daf818309d90eb39c1ce93b" +uuid = "a603d957-0e48-4f86-8fbd-0b7bc66df689" +version = "0.2.1" + +[[CategoricalArrays]] +deps = ["DataAPI", "Future", "JSON", "Missings", "Printf", "Statistics", "Unicode"] +git-tree-sha1 = "a6c17353ee38ddab30e73dcfaa1107752de724ec" +uuid = "324d7699-5711-5eae-9e2f-1d82baa6b597" +version = "0.8.1" + +[[ChainRules]] +deps = ["ChainRulesCore", "LinearAlgebra", "Reexport", "Requires", "Statistics"] +git-tree-sha1 = "85f130f2c5ce208a5a395b550802398d2fcc5ee6" +uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2" +version = "0.6.4" + +[[ChainRulesCore]] +deps = ["MuladdMacro"] +git-tree-sha1 = "32e2c6e44d4fdd985b5688b5e85c1f6892cf3d15" +uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" +version = "0.8.0" + +[[Cloudy]] +deps = ["Coverage", "DifferentialEquations", "DocStringExtensions", "ForwardDiff", "HCubature", "LinearAlgebra", "Optim", "PyPlot", "SpecialFunctions", "TaylorSeries", "Test"] +git-tree-sha1 = "7cb3ce76f5a63d17eb358b6030f7664931c75857" +uuid = "9e3b23bb-e7cc-4b94-886c-65de2234ba87" +version = "0.1.0" + +[[ColorTypes]] +deps = ["FixedPointNumbers", "Random"] +git-tree-sha1 = "27eb374570946a02aa184ef5b403dabaa7380693" +uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" +version = "0.10.4" + +[[Colors]] +deps = ["ColorTypes", "FixedPointNumbers", "InteractiveUtils", "Reexport"] +git-tree-sha1 = "1e9bba7984e78aa8cdeea7f9f7cc984ad4e4b1c7" +uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" +version = "0.12.2" + +[[Combinatorics]] +git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860" +uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" +version = "1.0.2" + +[[CommonSubexpressions]] +deps = ["Test"] +git-tree-sha1 = "efdaf19ab11c7889334ca247ff4c9f7c322817b0" +uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" +version = "0.2.0" + +[[Compat]] +deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"] +git-tree-sha1 = "054993b6611376ddb40203e973e954fd9d1d1902" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "3.12.0" + [[CompilerSupportLibraries_jll]] deps = ["Libdl", "Pkg"] git-tree-sha1 = "7c4f882c41faa72118841185afc58a2eb00ef612" uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" version = "0.3.3+0" +[[Conda]] +deps = ["JSON", "VersionParsing"] +git-tree-sha1 = "7a58bb32ce5d85f8bf7559aa7c2842f9aecf52fc" +uuid = "8f4d0f93-b110-5947-807f-2305c1781a2d" +version = "1.4.1" + +[[ConsoleProgressMonitor]] +deps = ["Logging", "ProgressMeter"] +git-tree-sha1 = "3ab7b2136722890b9af903859afcf457fa3059e8" +uuid = "88cd18e8-d9cc-4ea6-8889-5259c0d15c8b" +version = "0.1.2" + +[[ConstructionBase]] +git-tree-sha1 = "a2a6a5fea4d6f730ec4c18a76d27ec10e8ec1c50" +uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" +version = "1.0.0" + +[[Coverage]] +deps = ["CoverageTools", "HTTP", "JSON", "LibGit2", "MbedTLS"] +git-tree-sha1 = "aad69c0c2d8080427f507c36b289c77fe465c9fe" +uuid = "a2441757-f6aa-5fb2-8edb-039e3f45d037" +version = "1.1.1" + +[[CoverageTools]] +deps = ["LibGit2"] +git-tree-sha1 = "328154f6062b0053588295df6bffe22e1436597a" +uuid = "c36e975a-824b-4404-a568-ef97ca766997" +version = "1.1.0" + +[[CpuId]] +deps = ["Markdown", "Test"] +git-tree-sha1 = "f0464e499ab9973b43c20f8216d088b61fda80c6" +uuid = "adafc99b-e345-5852-983c-f28acb93d879" +version = "0.2.2" + [[DataAPI]] -git-tree-sha1 = "674b67f344687a88310213ddfa8a2b3c76cc4252" +git-tree-sha1 = "176e23402d80e7743fc26c19c681bfb11246af32" uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" -version = "1.1.0" +version = "1.3.0" + +[[DataFrames]] +deps = ["CategoricalArrays", "Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "Missings", "PooledArrays", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"] +git-tree-sha1 = "02f08ae77249b7f6d4186b081a016fb7454c616f" +uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +version = "0.21.2" [[DataStructures]] deps = ["InteractiveUtils", "OrderedCollections"] -git-tree-sha1 = "73eb18320fe3ba58790c8b8f6f89420f0a622773" +git-tree-sha1 = "be680f1ad03c0a03796aa3fda5a2180df7f83b46" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.17.11" +version = "0.17.18" + +[[DataValueInterfaces]] +git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" +uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" +version = "1.0.0" [[Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" +[[DelayDiffEq]] +deps = ["DataStructures", "DiffEqBase", "LinearAlgebra", "Logging", "OrdinaryDiffEq", "Printf", "RecursiveArrayTools", "Reexport", "Roots", "UnPack"] +git-tree-sha1 = "ede535e084589ca2ed626f4179337ac7fd610e7f" +uuid = "bcd4f6db-9728-5f36-b5f7-82caef46ccdb" +version = "5.24.1" + +[[DelimitedFiles]] +deps = ["Mmap"] +uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" + +[[DiffEqBase]] +deps = ["ArrayInterface", "ChainRulesCore", "ConsoleProgressMonitor", "DataStructures", "Distributed", "DocStringExtensions", "FunctionWrappers", "IterativeSolvers", "IteratorInterfaceExtensions", "LabelledArrays", "LinearAlgebra", "Logging", "LoggingExtras", "MuladdMacro", "Parameters", "Printf", "ProgressLogging", "RecipesBase", "RecursiveArrayTools", "RecursiveFactorization", "Requires", "Roots", "SparseArrays", "StaticArrays", "Statistics", "SuiteSparse", "TableTraits", "TerminalLoggers", "TreeViews", "ZygoteRules"] +git-tree-sha1 = "ae65fac7d9933f3d039c0296b5d41bf8c3d8f4ea" +uuid = "2b5f629d-d688-5b77-993f-72d75c75574e" +version = "6.38.4" + +[[DiffEqCallbacks]] +deps = ["DataStructures", "DiffEqBase", "ForwardDiff", "LinearAlgebra", "NLsolve", "OrdinaryDiffEq", "RecipesBase", "RecursiveArrayTools", "StaticArrays"] +git-tree-sha1 = "c0619bba19db9b033d011b91e30663e4baf74184" +uuid = "459566f4-90b8-5000-8ac3-15dfb0a30def" +version = "2.13.3" + +[[DiffEqFinancial]] +deps = ["DiffEqBase", "DiffEqNoiseProcess", "LinearAlgebra", "Markdown", "RandomNumbers"] +git-tree-sha1 = "f0c6f2b0b9fa463a90da06142e45ecf8e0b70bac" +uuid = "5a0ffddc-d203-54b0-88ba-2c03c0fc2e67" +version = "2.3.0" + +[[DiffEqJump]] +deps = ["ArrayInterface", "Compat", "DataStructures", "DiffEqBase", "FunctionWrappers", "LinearAlgebra", "Parameters", "PoissonRandom", "Random", "RandomNumbers", "RecursiveArrayTools", "StaticArrays", "Statistics", "TreeViews"] +git-tree-sha1 = "0dfb3aa84f687c78f697173665e304d28651dd55" +uuid = "c894b116-72e5-5b58-be3c-e6d8d4ac2b12" +version = "6.9.2" + +[[DiffEqNoiseProcess]] +deps = ["DataStructures", "DiffEqBase", "Distributions", "LinearAlgebra", "PoissonRandom", "Random", "RandomNumbers", "RecipesBase", "RecursiveArrayTools", "Requires", "ResettableStacks", "StaticArrays", "Statistics"] +git-tree-sha1 = "fc9ba5c47246d1e6c15ae36ce9f5e67b6ffc06b7" +uuid = "77a26b50-5914-5dd7-bc55-306e6241c503" +version = "4.2.0" + +[[DiffEqPhysics]] +deps = ["DiffEqBase", "DiffEqCallbacks", "ForwardDiff", "LinearAlgebra", "Printf", "Random", "RecipesBase", "RecursiveArrayTools", "Reexport", "StaticArrays"] +git-tree-sha1 = "9f4b98590c63bf202d12ae20783203baad3dd27a" +uuid = "055956cb-9e8b-5191-98cc-73ae4a59e68a" +version = "3.2.0" + +[[DiffResults]] +deps = ["StaticArrays"] +git-tree-sha1 = "da24935df8e0c6cf28de340b958f6aac88eaa0cc" +uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" +version = "1.0.2" + +[[DiffRules]] +deps = ["NaNMath", "Random", "SpecialFunctions"] +git-tree-sha1 = "eb0c34204c8410888844ada5359ac8b96292cfd1" +uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" +version = "1.0.1" + +[[DifferentialEquations]] +deps = ["BoundaryValueDiffEq", "DelayDiffEq", "DiffEqBase", "DiffEqCallbacks", "DiffEqFinancial", "DiffEqJump", "DiffEqNoiseProcess", "DiffEqPhysics", "DimensionalPlotRecipes", "LinearAlgebra", "MultiScaleArrays", "OrdinaryDiffEq", "ParameterizedFunctions", "Random", "RecursiveArrayTools", "Reexport", "SteadyStateDiffEq", "StochasticDiffEq", "Sundials"] +git-tree-sha1 = "d554ed4743c174e62d4c81efe5a12f2ff67b2f33" +uuid = "0c46a032-eb83-5123-abaf-570d42b7fbaa" +version = "6.14.0" + +[[DimensionalPlotRecipes]] +deps = ["LinearAlgebra", "RecipesBase"] +git-tree-sha1 = "af883a26bbe6e3f5f778cb4e1b81578b534c32a6" +uuid = "c619ae07-58cd-5f6d-b883-8f17bd6a98f9" +version = "1.2.0" + +[[Distances]] +deps = ["LinearAlgebra", "Statistics"] +git-tree-sha1 = "bed62cc5afcff16de797a9f38fb358b74071f785" +uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" +version = "0.9.0" + [[Distributed]] deps = ["Random", "Serialization", "Sockets"] uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" [[Distributions]] deps = ["FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns"] -git-tree-sha1 = "c4ed10355637fcb0725dc6a27060f74df24f13cd" +git-tree-sha1 = "78c4c32a2357a00a0a7d614880f02c2c6e1ec73c" uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" -version = "0.23.2" +version = "0.23.4" [[DocStringExtensions]] deps = ["LibGit2", "Markdown", "Pkg", "Test"] -git-tree-sha1 = "88bb0edb352b16608036faadcc071adda068582a" +git-tree-sha1 = "c5714d9bcdba66389612dc4c47ed827c64112997" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.8.1" +version = "0.8.2" + +[[Documenter]] +deps = ["Base64", "Dates", "DocStringExtensions", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] +git-tree-sha1 = "395fa1554c69735802bba37d9e7d9586fd44326c" +uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +version = "0.24.11" + +[[ElasticArrays]] +deps = ["Adapt"] +git-tree-sha1 = "d7d8924a01f5170d16cb24a24df20f027a45383a" +uuid = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4" +version = "1.2.2" + +[[ElasticPDMats]] +deps = ["LinearAlgebra", "MacroTools", "PDMats", "Test"] +git-tree-sha1 = "c6ac4406d9b4a549f7316fc746f7ccd5f1bcd2cd" +uuid = "2904ab23-551e-5aed-883f-487f97af5226" +version = "0.2.1" + +[[ExponentialUtilities]] +deps = ["LinearAlgebra", "Printf", "SparseArrays"] +git-tree-sha1 = "1672dedeacaab85345fd359ad56dde8fb5d48a45" +uuid = "d4d017d3-3776-5f7e-afef-a10c40355c18" +version = "1.6.0" + +[[FastGaussQuadrature]] +deps = ["LinearAlgebra", "SpecialFunctions"] +git-tree-sha1 = "c139e3f4c75dc489a493627c7ee44befc177420f" +uuid = "442a2c76-b920-505d-bb47-c5924d526838" +version = "0.4.2" [[FillArrays]] deps = ["LinearAlgebra", "Random", "SparseArrays"] -git-tree-sha1 = "3eb5253af6186eada40de3df524a1c10f0c6bfa2" +git-tree-sha1 = "44f561e293987ffc84272cd3d2b14b0b93123d63" uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" -version = "0.8.6" +version = "0.8.10" + +[[FiniteDiff]] +deps = ["ArrayInterface", "LinearAlgebra", "Requires", "SparseArrays", "StaticArrays"] +git-tree-sha1 = "fec7c2cb45c27071ef487fa7cae4fcac7509aa10" +uuid = "6a86dc24-6348-571c-b903-95158fe2bd41" +version = "2.3.2" + +[[FixedPointNumbers]] +git-tree-sha1 = "8fb797c37a3b7ced4327a05ac4ca0dd6a4f1ba92" +uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" +version = "0.8.1" + +[[Formatting]] +deps = ["Printf"] +git-tree-sha1 = "a0c901c29c0e7c763342751c0a94211d56c0de5c" +uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" +version = "0.4.1" + +[[ForwardDiff]] +deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "NaNMath", "Random", "SpecialFunctions", "StaticArrays"] +git-tree-sha1 = "869540e4367122fbffaace383a5bdc34d6e5e5ac" +uuid = "f6369f11-7733-5829-9624-2563aa707210" +version = "0.10.10" + +[[FunctionWrappers]] +git-tree-sha1 = "e4813d187be8c7b993cb7f85cbf2b7bfbaadc694" +uuid = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e" +version = "1.1.1" + +[[Future]] +deps = ["Random"] +uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" + +[[GaussianProcesses]] +deps = ["Distances", "Distributions", "Documenter", "ElasticArrays", "ElasticPDMats", "FastGaussQuadrature", "ForwardDiff", "LinearAlgebra", "Optim", "PDMats", "Printf", "ProgressMeter", "Random", "RecipesBase", "ScikitLearnBase", "SpecialFunctions", "StaticArrays", "Statistics", "StatsFuns", "Zygote"] +git-tree-sha1 = "9b33cd8be0fd2bc59c46911def57331a7d5f6e84" +uuid = "891a1506-143c-57d2-908e-e1f8e92e6de9" +version = "0.12.1" + +[[GeneralizedGenerated]] +deps = ["CanonicalTraits", "DataStructures", "JuliaVariables", "MLStyle"] +git-tree-sha1 = "9a917449bebc5a241d23e13d36ea62c77129ce6e" +uuid = "6b9d7cbe-bcb9-11e9-073f-15a7a543e2eb" +version = "0.2.4" + +[[GenericSVD]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "62909c3eda8a25b5673a367d1ad2392ebb265211" +uuid = "01680d73-4ee2-5a08-a1aa-533608c188bb" +version = "0.3.0" + +[[HCubature]] +deps = ["Combinatorics", "DataStructures", "LinearAlgebra", "QuadGK", "StaticArrays"] +git-tree-sha1 = "fc4adde0a029bf69c0da3f7c25ca24b5e0e389ed" +uuid = "19dc6840-f33b-545b-b366-655c7e3ffd49" +version = "1.4.0" + +[[HTTP]] +deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"] +git-tree-sha1 = "ec87d5e2acbe1693789efbbe14f5ea7525758f71" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "0.8.15" + +[[IRTools]] +deps = ["InteractiveUtils", "MacroTools", "Test"] +git-tree-sha1 = "6875ae3cfcb9a50af80553d5cc825f406e8d13bc" +uuid = "7869d1d1-7146-5819-86e3-90919afe41df" +version = "0.4.0" + +[[Inflate]] +git-tree-sha1 = "f5fc07d4e706b84f72d54eedcc1c13d92fb0871c" +uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" +version = "0.1.2" + +[[IniFile]] +deps = ["Test"] +git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8" +uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f" +version = "0.5.0" [[InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" +[[InvertedIndices]] +deps = ["Test"] +git-tree-sha1 = "15732c475062348b0165684ffe28e85ea8396afc" +uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" +version = "1.0.0" + +[[IterTools]] +git-tree-sha1 = "05110a2ab1fc5f932622ffea2a003221f4782c18" +uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e" +version = "1.3.0" + +[[IterativeSolvers]] +deps = ["LinearAlgebra", "Printf", "Random", "RecipesBase", "SparseArrays"] +git-tree-sha1 = "3b7e2aac8c94444947facea7cc7ca91c49169be0" +uuid = "42fd0dbc-a981-5370-80f2-aaf504508153" +version = "0.8.4" + +[[IteratorInterfaceExtensions]] +git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" +uuid = "82899510-4779-5014-852e-03e436cf321d" +version = "1.0.0" + +[[JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.0" + +[[JuliaVariables]] +deps = ["MLStyle", "NameResolution"] +git-tree-sha1 = "8868479ff35ab98588ed0a529a9c2a4f8bda3bd6" +uuid = "b14d175d-62b4-44ba-8fb7-3064adc8c3ec" +version = "0.2.0" + +[[LLVM]] +deps = ["CEnum", "Libdl", "Printf", "Unicode"] +git-tree-sha1 = "72fc0a39d5899091ff2d4cdaa64cb5e4862cf813" +uuid = "929cbde3-209d-540e-8aea-75f648917ca0" +version = "1.5.2" + +[[LaTeXStrings]] +git-tree-sha1 = "de44b395389b84fd681394d4e8d39ef14e3a2ea8" +uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" +version = "1.1.0" + +[[LabelledArrays]] +deps = ["ArrayInterface", "LinearAlgebra", "MacroTools", "StaticArrays"] +git-tree-sha1 = "f6def2c9c88908fdde81b9a39c236cf69de94450" +uuid = "2ee39098-c373-598a-b85f-a56591580800" +version = "1.2.2" + +[[Latexify]] +deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"] +git-tree-sha1 = "864527aa4d14c893fb8c51d48ef314410c88c7b9" +uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" +version = "0.13.5" + +[[LeftChildRightSiblingTrees]] +deps = ["AbstractTrees"] +git-tree-sha1 = "71be1eb5ad19cb4f61fa8c73395c0338fd092ae0" +uuid = "1d6d02ad-be62-4b6b-8a6d-2f90e265016e" +version = "0.1.2" + [[LibGit2]] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[Libdl]] uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +[[LightGraphs]] +deps = ["ArnoldiMethod", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] +git-tree-sha1 = "6f85a35d2377cb2db1bc448ed0d6340d2bb1ea64" +uuid = "093fc24a-ae57-5d10-9952-331d41423f4d" +version = "1.3.3" + +[[LineSearches]] +deps = ["LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "Printf", "Test"] +git-tree-sha1 = "54eb90e8dbe745d617c78dee1d6ae95c7f6f5779" +uuid = "d3d80556-e9d4-5f37-9878-2ab0fcc64255" +version = "7.0.1" + [[LinearAlgebra]] deps = ["Libdl"] uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" @@ -75,33 +505,132 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [[Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" +[[LoggingExtras]] +git-tree-sha1 = "b60616c70eff0cc2c0831b6aace75940aeb0939d" +uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" +version = "0.4.1" + +[[LoopVectorization]] +deps = ["DocStringExtensions", "LinearAlgebra", "OffsetArrays", "SIMDPirates", "SLEEFPirates", "UnPack", "VectorizationBase"] +git-tree-sha1 = "59f7e9fddaae12967a0c0903aff2d06a8813e2b1" +uuid = "bdcacae8-1622-11e9-2a5c-532679323890" +version = "0.8.5" + +[[METIS_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "3f52ed323683398498ef163a45ce998f1ceca363" +uuid = "d00139f3-1899-568f-a2f0-47f597d42d70" +version = "5.1.0+4" + +[[MLStyle]] +git-tree-sha1 = "67f9a88611bc79f992aa705d9bbc833a2547dec7" +uuid = "d8e11817-5142-5d16-987a-aa16d5891078" +version = "0.3.1" + +[[MacroTools]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "f7d2e3f654af75f01ec49be82c231c382214223a" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.5" + [[Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" +[[MbedTLS]] +deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"] +git-tree-sha1 = "426a6978b03a97ceb7ead77775a1da066343ec6e" +uuid = "739be429-bea8-5141-9913-cc70e7f3736d" +version = "1.0.2" + +[[MbedTLS_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "c83f5a1d038f034ad0549f9ee4d5fac3fb429e33" +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.16.0+2" + [[Missings]] deps = ["DataAPI"] git-tree-sha1 = "de0a5ce9e5289f27df672ffabef4d1e5861247d5" uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" version = "0.4.3" +[[Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[ModelingToolkit]] +deps = ["ArrayInterface", "DiffEqBase", "DiffRules", "Distributed", "DocStringExtensions", "GeneralizedGenerated", "Latexify", "LinearAlgebra", "MacroTools", "NaNMath", "SafeTestsets", "SparseArrays", "SpecialFunctions", "StaticArrays", "TreeViews", "UnPack", "Unitful"] +git-tree-sha1 = "b3a75a48ddb401d30b2548e72609c27675bde25f" +uuid = "961ee093-0014-501f-94e3-6117800e7a78" +version = "3.1.1" + +[[MuladdMacro]] +git-tree-sha1 = "c6190f9a7fc5d9d5915ab29f2134421b12d24a68" +uuid = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221" +version = "0.2.2" + +[[MultiScaleArrays]] +deps = ["DiffEqBase", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "OrdinaryDiffEq", "Random", "RecursiveArrayTools", "SparseDiffTools", "Statistics", "StochasticDiffEq", "TreeViews"] +git-tree-sha1 = "258f3be6770fe77be8870727ba9803e236c685b8" +uuid = "f9640e96-87f6-5992-9c3b-0743c6a49ffa" +version = "1.8.1" + +[[NLSolversBase]] +deps = ["DiffResults", "Distributed", "FiniteDiff", "ForwardDiff"] +git-tree-sha1 = "7c4e66c47848562003250f28b579c584e55becc0" +uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" +version = "7.6.1" + +[[NLsolve]] +deps = ["Distances", "LineSearches", "LinearAlgebra", "NLSolversBase", "Printf", "Reexport"] +git-tree-sha1 = "ea172c86745810136d744fc67650d2e2de669c4f" +uuid = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" +version = "4.4.0" + +[[NNlib]] +deps = ["BinaryProvider", "Libdl", "LinearAlgebra", "Requires", "Statistics"] +git-tree-sha1 = "d9f196d911f55aeaff11b11f681b135980783824" +uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd" +version = "0.6.6" + +[[NaNMath]] +git-tree-sha1 = "928b8ca9b2791081dc71a51c55347c27c618760f" +uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +version = "0.3.3" + +[[NameResolution]] +deps = ["DataStructures", "PrettyPrint"] +git-tree-sha1 = "f4119274d5a410c64a1d9f546312bb6ae54d41c0" +uuid = "71a1bf82-56d0-4bbc-8a3c-48b961074391" +version = "0.1.3" + +[[OffsetArrays]] +git-tree-sha1 = "ab697473e983a7499f463b696da8e8feb1b20ffd" +uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +version = "1.1.0" + [[OpenBLAS_jll]] -deps = ["Libdl", "Pkg"] -git-tree-sha1 = "72163ef83570d258af87ed91f301c5b51a5e08e9" +deps = ["CompilerSupportLibraries_jll", "Libdl", "Pkg"] +git-tree-sha1 = "1887096f6897306a4662f7c5af936da7d5d1a062" uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" -version = "0.3.9+0" +version = "0.3.9+4" -[[OpenSpecFun_jll]] -deps = ["CompilerSupportLibraries_jll", "Libdl", "Pkg"] -git-tree-sha1 = "d51c416559217d974a1113522d5919235ae67a87" -uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" -version = "0.5.3+3" +[[Optim]] +deps = ["Compat", "FillArrays", "LineSearches", "LinearAlgebra", "NLSolversBase", "NaNMath", "Parameters", "PositiveFactorizations", "Printf", "SparseArrays", "StatsBase"] +git-tree-sha1 = "62054d469d3631960e3f472ceb8624be5b11c34d" +uuid = "429524aa-4258-5aef-a3af-852621145aeb" +version = "0.20.6" [[OrderedCollections]] -deps = ["Random", "Serialization", "Test"] -git-tree-sha1 = "c4c13474d23c60d20a67b217f1d7f22a40edf8f1" +git-tree-sha1 = "12ce190210d278e12644bcadf5b21cbdcf225cd3" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -version = "1.1.0" +version = "1.2.0" + +[[OrdinaryDiffEq]] +deps = ["Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "ExponentialUtilities", "FiniteDiff", "ForwardDiff", "GenericSVD", "LinearAlgebra", "Logging", "MacroTools", "MuladdMacro", "NLsolve", "RecursiveArrayTools", "Reexport", "SparseArrays", "SparseDiffTools", "StaticArrays", "UnPack"] +git-tree-sha1 = "89f71b92de3ab39d70bd21a2b11346db5aeb9994" +uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +version = "5.41.0" [[PDMats]] deps = ["Arpack", "LinearAlgebra", "SparseArrays", "SuiteSparse", "Test"] @@ -109,14 +638,79 @@ git-tree-sha1 = "2fc6f50ddd959e462f0a2dbc802ddf2a539c6e35" uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" version = "0.9.12" +[[ParameterizedFunctions]] +deps = ["DataStructures", "DiffEqBase", "Latexify", "LinearAlgebra", "ModelingToolkit"] +git-tree-sha1 = "86ca1fa2f37f20945a742d50ed12e314b11dfa62" +uuid = "65888b18-ceab-5e60-b2b9-181511a3b968" +version = "5.3.0" + +[[Parameters]] +deps = ["OrderedCollections", "UnPack"] +git-tree-sha1 = "38b2e970043613c187bd56a995fe2e551821eb4a" +uuid = "d96e819e-fc66-5662-9728-84c9c7592b0a" +version = "0.12.1" + +[[Parsers]] +deps = ["Dates", "Test"] +git-tree-sha1 = "eb3e09940c0d7ae01b01d9291ebad7b081c844d3" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "1.0.5" + [[Pkg]] deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Test", "UUIDs"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +[[PoissonRandom]] +deps = ["Random", "Statistics", "Test"] +git-tree-sha1 = "44d018211a56626288b5d3f8c6497d28c26dc850" +uuid = "e409e4f3-bfea-5376-8464-e040bb5c01ab" +version = "0.4.0" + +[[PooledArrays]] +deps = ["DataAPI"] +git-tree-sha1 = "b1333d4eced1826e15adbdf01a4ecaccca9d353c" +uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720" +version = "0.5.3" + +[[PositiveFactorizations]] +deps = ["LinearAlgebra", "Test"] +git-tree-sha1 = "127c47b91990c101ee3752291c4f45640eeb03d1" +uuid = "85a6dd25-e78a-55b7-8502-1745935b8125" +version = "0.2.3" + +[[PrettyPrint]] +git-tree-sha1 = "21e1f88cb73589ec39a1181f77eb444b5276151e" +uuid = "8162dcfd-2161-5ef2-ae6c-7681170c5f98" +version = "0.1.0" + [[Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" +[[ProgressLogging]] +deps = ["Logging", "SHA", "UUIDs"] +git-tree-sha1 = "59398022b661b6fd569f25de6b18fde39843196a" +uuid = "33c8b6b6-d38a-422a-b730-caa89a2f386c" +version = "0.1.3" + +[[ProgressMeter]] +deps = ["Distributed", "Printf"] +git-tree-sha1 = "3e1784c27847bba115815d4d4e668b99873985e5" +uuid = "92933f4c-e287-5a05-a399-4b506db050ca" +version = "1.3.1" + +[[PyCall]] +deps = ["Conda", "Dates", "Libdl", "LinearAlgebra", "MacroTools", "Serialization", "VersionParsing"] +git-tree-sha1 = "3a3fdb9000d35958c9ba2323ca7c4958901f115d" +uuid = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" +version = "1.91.4" + +[[PyPlot]] +deps = ["Colors", "LaTeXStrings", "PyCall", "Sockets", "Test", "VersionParsing"] +git-tree-sha1 = "67dde2482fe1a72ef62ed93f8c239f947638e5a2" +uuid = "d330b81b-6aea-500a-939a-2ce795aea3ee" +version = "2.9.0" + [[QuadGK]] deps = ["DataStructures", "LinearAlgebra"] git-tree-sha1 = "dc84e810393cfc6294248c9032a9cdacc14a3db4" @@ -131,6 +725,47 @@ uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" deps = ["Serialization"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +[[RandomNumbers]] +deps = ["Random", "Requires"] +git-tree-sha1 = "441e6fc35597524ada7f85e13df1f4e10137d16f" +uuid = "e6cf234a-135c-5ec9-84dd-332b85af5143" +version = "1.4.0" + +[[RecipesBase]] +git-tree-sha1 = "54f8ceb165a0f6d083f0d12cb4996f5367c6edbc" +uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +version = "1.0.1" + +[[RecursiveArrayTools]] +deps = ["ArrayInterface", "LinearAlgebra", "RecipesBase", "Requires", "StaticArrays", "Statistics", "ZygoteRules"] +git-tree-sha1 = "96e71928efa701fa5a6df0f88b51f05ceed70f2c" +uuid = "731186ca-8d62-57ce-b412-fbd966d074cd" +version = "2.4.4" + +[[RecursiveFactorization]] +deps = ["LinearAlgebra", "LoopVectorization"] +git-tree-sha1 = "09217cb106dd826de9960986207175b52e3035f2" +uuid = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" +version = "0.1.2" + +[[Reexport]] +deps = ["Pkg"] +git-tree-sha1 = "7b1d07f411bc8ddb7977ec7f377b97b158514fe0" +uuid = "189a3867-3050-52da-a836-e630ba90ab69" +version = "0.2.0" + +[[Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "d37400976e98018ee840e0ca4f9d20baa231dc6b" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.0.1" + +[[ResettableStacks]] +deps = ["StaticArrays"] +git-tree-sha1 = "d19e9c93de6020a96dbb2820567c78d0ab8f7248" +uuid = "ae5879a3-cd67-5da8-be7f-38c6eb64a37b" +version = "1.0.0" + [[Rmath]] deps = ["Random", "Rmath_jll"] git-tree-sha1 = "86c5647b565873641538d8f812c04e4c9dbeb370" @@ -139,16 +774,62 @@ version = "0.6.1" [[Rmath_jll]] deps = ["Libdl", "Pkg"] -git-tree-sha1 = "1660f8fefbf5ab9c67560513131d4e933012fc4b" +git-tree-sha1 = "d76185aa1f421306dec73c057aa384bad74188f0" uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" -version = "0.2.2+0" +version = "0.2.2+1" + +[[Roots]] +deps = ["Printf"] +git-tree-sha1 = "c2f7348c55d1433d1cab0159b4d2c6d27af36fc4" +uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" +version = "1.0.2" [[SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +[[SIMDPirates]] +deps = ["VectorizationBase"] +git-tree-sha1 = "74bf6ed250c21651955bdb36b2b12320374c49ae" +uuid = "21efa798-c60a-11e8-04d3-e1a92915a26a" +version = "0.8.7" + +[[SLEEFPirates]] +deps = ["Libdl", "SIMDPirates", "VectorizationBase"] +git-tree-sha1 = "3d97df9b38b3df1f118a203ac4a6c53b23265b4e" +uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" +version = "0.5.1" + +[[SafeTestsets]] +deps = ["Test"] +git-tree-sha1 = "36ebc5622c82eb9324005cc75e7e2cc51181d181" +uuid = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +version = "0.0.1" + +[[ScikitLearn]] +deps = ["Compat", "Conda", "DataFrames", "Distributed", "IterTools", "LinearAlgebra", "MacroTools", "Parameters", "Printf", "PyCall", "Random", "ScikitLearnBase", "SparseArrays", "StatsBase", "VersionParsing"] +git-tree-sha1 = "b2dbb141575879beb3ad771fb0314a22617586d3" +uuid = "3646fa90-6ef7-5e7e-9f22-8aca16db6324" +version = "0.6.2" + +[[ScikitLearnBase]] +deps = ["LinearAlgebra", "Random", "Statistics"] +git-tree-sha1 = "7877e55c1523a4b336b433da39c8e8c08d2f221f" +uuid = "6e75b9c4-186b-50bd-896f-2d2496a4843e" +version = "0.5.0" + [[Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" +[[SharedArrays]] +deps = ["Distributed", "Mmap", "Random", "Serialization"] +uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" + +[[SimpleTraits]] +deps = ["InteractiveUtils", "MacroTools"] +git-tree-sha1 = "2ee666b24ab8be6a922f9d6c11a86e1a703a7dda" +uuid = "699a6c99-e7fa-54fc-8d76-47d257e15c1d" +version = "0.9.2" + [[Sockets]] uuid = "6462fe0b-24de-5631-8697-dd941f90decc" @@ -162,11 +843,23 @@ version = "0.3.1" deps = ["LinearAlgebra", "Random"] uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +[[SparseDiffTools]] +deps = ["Adapt", "ArrayInterface", "Compat", "DataStructures", "FiniteDiff", "ForwardDiff", "LightGraphs", "LinearAlgebra", "Requires", "SparseArrays", "VertexSafeGraphs"] +git-tree-sha1 = "bfe68e0d914952932594b3c838f08463b0841037" +uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804" +version = "1.8.0" + [[SpecialFunctions]] -deps = ["OpenSpecFun_jll"] -git-tree-sha1 = "e19b98acb182567bcb7b75bb5d9eedf3a3b5ec6c" +deps = ["BinDeps", "BinaryProvider", "Libdl"] +git-tree-sha1 = "3bdd374b6fd78faf0119b8c5d538788dbf910c6e" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "0.10.0" +version = "0.8.0" + +[[StaticArrays]] +deps = ["LinearAlgebra", "Random", "Statistics"] +git-tree-sha1 = "5c06c0aeb81bef54aed4b3f446847905eb6cbda0" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "0.12.3" [[Statistics]] deps = ["LinearAlgebra", "SparseArrays"] @@ -180,21 +873,127 @@ version = "0.33.0" [[StatsFuns]] deps = ["Rmath", "SpecialFunctions"] -git-tree-sha1 = "f290ddd5fdedeadd10e961eb3f4d3340f09d030a" +git-tree-sha1 = "04a5a8e6ab87966b43f247920eab053fd5fdc925" uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" -version = "0.9.4" +version = "0.9.5" + +[[SteadyStateDiffEq]] +deps = ["DiffEqBase", "DiffEqCallbacks", "LinearAlgebra", "NLsolve", "Reexport"] +git-tree-sha1 = "75f258513b7ef8b235876f4cf146577ffd545094" +uuid = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f" +version = "1.5.1" + +[[StochasticDiffEq]] +deps = ["ArrayInterface", "DataStructures", "DiffEqBase", "DiffEqJump", "DiffEqNoiseProcess", "FillArrays", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "Logging", "MuladdMacro", "NLsolve", "OrdinaryDiffEq", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "SparseArrays", "SparseDiffTools", "StaticArrays", "UnPack"] +git-tree-sha1 = "2006e15cb3967afec91af1cb33b965eebea4f573" +uuid = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" +version = "6.23.1" [[SuiteSparse]] deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" +[[SuiteSparse_jll]] +deps = ["Libdl", "METIS_jll", "OpenBLAS_jll", "Pkg"] +git-tree-sha1 = "dad9c6f67fa143b7b1935ef3c6231d88e6dcdec2" +uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" +version = "5.4.0+8" + +[[Sundials]] +deps = ["CEnum", "DataStructures", "DiffEqBase", "Libdl", "LinearAlgebra", "Logging", "Reexport", "SparseArrays", "Sundials_jll"] +git-tree-sha1 = "707f9ed67297a25ebdf87a9b290162a8fabcb8c4" +uuid = "c3572dad-4567-51f8-b174-8c6c989267f4" +version = "4.2.3" + +[[Sundials_jll]] +deps = ["Libdl", "OpenBLAS_jll", "Pkg", "SuiteSparse_jll"] +git-tree-sha1 = "4a4ae2ebefa34779552dbe87683c70c856624ec8" +uuid = "fb77eaff-e24c-56d4-86b1-d163f2edb164" +version = "5.2.0+0" + +[[TableTraits]] +deps = ["IteratorInterfaceExtensions"] +git-tree-sha1 = "b1ad568ba658d8cbb3b892ed5380a6f3e781a81e" +uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" +version = "1.0.0" + +[[Tables]] +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"] +git-tree-sha1 = "c45dcc27331febabc20d86cb3974ef095257dcf3" +uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +version = "1.0.4" + +[[TaylorSeries]] +deps = ["InteractiveUtils", "LinearAlgebra", "Markdown", "Requires", "SparseArrays"] +git-tree-sha1 = "192cf2208fd4ffed35d675513c0d5807cfbcaae1" +uuid = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea" +version = "0.10.6" + +[[TerminalLoggers]] +deps = ["LeftChildRightSiblingTrees", "Logging", "Markdown", "Printf", "ProgressLogging", "UUIDs"] +git-tree-sha1 = "cbea752b5eef52a3e1188fb31580c3e4fa0cbc35" +uuid = "5d786b92-1e48-4d6f-9151-6b4477ca9bed" +version = "0.1.2" + [[Test]] deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +[[TreeViews]] +deps = ["Test"] +git-tree-sha1 = "8d0d7a3fe2f30d6a7f833a5f19f7c7a5b396eae6" +uuid = "a2a6695c-b41b-5b7d-aed9-dbfdeacea5d7" +version = "0.3.0" + +[[URIParser]] +deps = ["Unicode"] +git-tree-sha1 = "53a9f49546b8d2dd2e688d216421d050c9a31d0d" +uuid = "30578b45-9adc-5946-b283-645ec420af67" +version = "0.4.1" + [[UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" +[[UnPack]] +git-tree-sha1 = "e0cb9715adda456f7657e45377fd3063bf87179a" +uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" +version = "0.1.0" + [[Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[Unitful]] +deps = ["ConstructionBase", "LinearAlgebra", "Random"] +git-tree-sha1 = "3714b55de06b11b2aa788b8643d6e91f13648be5" +uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" +version = "1.2.1" + +[[VectorizationBase]] +deps = ["CpuId", "LLVM", "Libdl", "LinearAlgebra"] +git-tree-sha1 = "bcadc352d9c81b0ef9ceebe822d30128b779f56b" +uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" +version = "0.12.8" + +[[VersionParsing]] +git-tree-sha1 = "80229be1f670524750d905f8fc8148e5a8c4537f" +uuid = "81def892-9a0e-5fdd-b105-ffc91e053289" +version = "1.2.0" + +[[VertexSafeGraphs]] +deps = ["LightGraphs"] +git-tree-sha1 = "b9b450c99a3ca1cc1c6836f560d8d887bcbe356e" +uuid = "19fa3120-7c27-5ec5-8db8-b0b0aa330d6f" +version = "0.1.2" + +[[Zygote]] +deps = ["AbstractFFTs", "ArrayLayouts", "ChainRules", "FillArrays", "ForwardDiff", "Future", "IRTools", "InteractiveUtils", "LinearAlgebra", "MacroTools", "NNlib", "Random", "Requires", "Statistics", "ZygoteRules"] +git-tree-sha1 = "6d0f78976db6dbea9a36865efe068e6e2a5db6ed" +uuid = "e88e6eb3-aa80-5325-afca-941959d7151f" +version = "0.4.21" + +[[ZygoteRules]] +deps = ["MacroTools"] +git-tree-sha1 = "b3b4882cc9accf6731a08cc39543fbc6b669dca8" +uuid = "700de1a5-db45-46bc-99cf-38207098b444" +version = "0.2.0" diff --git a/Project.toml b/Project.toml index cbeb2b6b7..974dceca0 100644 --- a/Project.toml +++ b/Project.toml @@ -4,10 +4,17 @@ authors = ["Charles Kawczynski "] version = "0.1.0" [deps] +Cloudy = "9e3b23bb-e7cc-4b94-886c-65de2234ba87" +DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +GaussianProcesses = "891a1506-143c-57d2-908e-e1f8e92e6de9" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +Optim = "429524aa-4258-5aef-a3af-852621145aeb" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +ScikitLearn = "3646fa90-6ef7-5e7e-9f22-8aca16db6324" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/CalibrateEmulateSample.jl b/src/CalibrateEmulateSample.jl index 7a05b622e..266891e2b 100644 --- a/src/CalibrateEmulateSample.jl +++ b/src/CalibrateEmulateSample.jl @@ -10,14 +10,14 @@ include("EKS.jl") # No internal deps, heavy external deps include("EKI.jl") -# include("GModel.jl") -# include("GPEmulator.jl") +include("GModel.jl") +include("GPEmulator.jl") # Internal deps, light external deps include("Utilities.jl") # Internal deps, light external deps -# include("MCMC.jl") +include("MCMC.jl") # include("Histograms.jl") # include("GPR.jl") diff --git a/src/GPEmulator.jl b/src/GPEmulator.jl index 992d3489b..834e74e0f 100644 --- a/src/GPEmulator.jl +++ b/src/GPEmulator.jl @@ -49,16 +49,17 @@ models. # Fields $(DocStringExtensions.FIELDS) + """ struct GPObj{FT<:AbstractFloat, GPM} "training inputs/parameters; N_samples x N_parameters" - inputs::Array{FT, 2} + inputs::Array{FT} "training data/targets; N_samples x N_data" - data::Array{FT, 2} + data::Array{FT} "mean of input; 1 x N_parameters" - input_mean::Array{FT, 2} + input_mean::Array{FT} "square root of the inverse of the input covariance matrix; N_parameters x N_parameters" - sqrt_inv_input_cov::Array{FT, 2} + sqrt_inv_input_cov::Union{Nothing, Array{FT, 2}} "the Gaussian Process (GP) Regression model(s) that are fitted to the given input-data pairs" models::Vector "whether to fit GP models on normalized inputs ((inputs - input_mean) * sqrt_inv_input_cov)" @@ -86,8 +87,12 @@ function GPObj(inputs, data, package::GPJL; GPkernel::Union{K, KPy, Nothing}=not data = convert(Array{FT}, data) input_mean = reshape(mean(inputs, dims=1), 1, :) - sqrt_inv_input_cov = convert(Array{FT}, sqrt(inv(cov(inputs, dims=1)))) + sqrt_inv_input_cov = nothing if normalized + if ndims(inputs) == 1 + error("Cov not defined for 1d input; can't normalize") + end + sqrt_inv_input_cov = convert(Array{FT}, sqrt(inv(cov(inputs, dims=1)))) inputs = (inputs .- input_mean) * sqrt_inv_input_cov end @@ -144,8 +149,12 @@ function GPObj(inputs, data, package::SKLJL; GPkernel::Union{K, KPy, Nothing}=no data = convert(Array{FT}, data) input_mean = reshape(mean(inputs, dims=1), 1, :) - sqrt_inv_input_cov = convert(Array{FT}, sqrt(inv(cov(inputs, dims=1)))) + sqrt_inv_input_cov = nothing if normalized + if ndims(inputs) == 1 + error("Cov not defined for 1d input; can't normalize") + end + sqrt_inv_input_cov = convert(Array{FT}, sqrt(inv(cov(inputs, dims=1)))) inputs = (inputs .- input_mean) * sqrt_inv_input_cov end diff --git a/src/MCMC.jl b/src/MCMC.jl index b1099a3c8..f58038ef7 100644 --- a/src/MCMC.jl +++ b/src/MCMC.jl @@ -87,8 +87,7 @@ function MCMCObj(obs_sample::Vector{FT}, obs_covinv = inv(obs_cov) accept = [0] if algtype != "rwm" - println("only random walk metropolis 'rwm' is implemented so far") - sys.exit() + error("only random walk metropolis 'rwm' is implemented so far") end MCMCObj{FT,IT}(obs_sample, obs_cov, obs_covinv, priors, [step], burnin, param, posterior, log_posterior, iter, accept, algtype) @@ -258,9 +257,6 @@ function sample_posterior!(mcmc::MCMCObj{FT,IT}, gpobj::GPObj{FT}, max_iter::IT) where {FT,IT<:Int} - println("iteration 0; current parameters ", mcmc.param') - flush(stdout) - for mcmcit in 1:max_iter param = convert(Array{FT, 2}, mcmc.param') # test predictions param' is 1xN_params @@ -270,14 +266,6 @@ function sample_posterior!(mcmc::MCMCObj{FT,IT}, mcmc_sample!(mcmc, vec(gp_pred), vec(gp_predvar)) - if mcmcit % 1000 == 0 - acc_ratio = accept_ratio(mcmc) - # TODO: Add callbacks, remove print statements - println("iteration ", mcmcit ," of ", max_iter, - "; acceptance rate = ", acc_ratio, - ", current parameters ", param) - flush(stdout) - end end end diff --git a/src/Observations.jl b/src/Observations.jl index 3aa8840e2..cc8b63675 100644 --- a/src/Observations.jl +++ b/src/Observations.jl @@ -20,7 +20,7 @@ struct Obs{FT<:AbstractFloat} "covariance of the observational noise (assumed to be normally distributed); N_data x N_data. If not supplied, cov is set to a diagonal matrix whose non-zero elements are the sample variances" - cov::Array{FT, 2} + cov::Union{Nothing, Array{FT, 2}} "sample mean" mean::Vector{FT} "names of the data" @@ -31,29 +31,38 @@ end function Obs(samples::Vector{Vector{FT}}, data_names::Vector{String}) where {FT<:AbstractFloat} N_samples = length(samples) + # convert to N_samples x N_data to determine sample covariance if N_samples == 1 # only one sample - this requires a bit more data massaging temp1 = convert(Array, reshape(hcat(samples...)', N_samples, :)) temp = dropdims(temp1, dims=1) - samplemean = mean(temp, dims=2) + samplemean = vec(mean(temp, dims=2)) + cov = nothing else temp = convert(Array, reshape(hcat(samples...)', N_samples, :)) - samplemean = mean(temp, dims=1) + samplemean = vec(mean(temp, dims=1)) + cov = Statistics.cov(temp) end - cov = cov(temp, dims=1) - samplemean = mean(temp, dims=2) Obs(samples, cov, samplemean, data_names) end -function Obs(samples::Array{FT, 2}, +function Obs(samples::Array{FT}, data_names::Vector{String}) where {FT<:AbstractFloat} # samples is of size N_samples x N_data - N_samples = size(samples, 1) - cov = cov(samples, dims=1) - samplemean = vec(mean(samples, dims=1)) - # convert matrix of samples to a vector of vectors - samples = [samples[i, :] for i in 1:N_samples] + if ndims(samples) == 1 + # Only one sample, so there is no covariance to be computed and the + # sample mean equals the sample itself + cov = nothing + samplemean = vec(samples) + samples = vec([vec(samples)]) + else + cov = Statistics.cov(samples) + # convert matrix of samples to a vector of vectors + N_samples = size(samples, 1) + samplemean = vec(mean(samples, dims=1)) + samples = [samples[i, :] for i in 1:N_samples] + end Obs(samples, cov, samplemean, data_names) end diff --git a/src/Utilities.jl b/src/Utilities.jl index d02a0f533..a314d4a1b 100644 --- a/src/Utilities.jl +++ b/src/Utilities.jl @@ -7,7 +7,7 @@ using ..Observations using ..EKI export extract_GP_tp -export extract_obs_data +export get_obs_sample export orig2zscore export zscore2orig export RPAD, name, warn diff --git a/test/Cloudy/runtests.jl b/test/Cloudy/runtests.jl index 42daecaa4..d122704e0 100644 --- a/test/Cloudy/runtests.jl +++ b/test/Cloudy/runtests.jl @@ -10,6 +10,7 @@ using LinearAlgebra using StatsPlots using GaussianProcesses using Plots +using StatsPlots # Import Calibrate-Emulate-Sample modules using CalibrateEmulateSample.EKI @@ -203,7 +204,7 @@ u0 = vec(mean(u_tp, dims=1)) # reset parameters burnin = 1000 -max_iter = 500000 +max_iter = 100000 mcmc = MCMC.MCMCObj(yt_sample, truth.cov, priors, new_step, u0, max_iter, mcmc_alg, burnin) @@ -222,8 +223,6 @@ println(det(inv(post_cov))) println(" ") # Plot the posteriors together with the priors and the true parameter values -using StatsPlots; - true_values = [log(N0_true) log(θ_true) log(k_true)] n_params = length(true_values) diff --git a/test/EKI/runtests.jl b/test/EKI/runtests.jl new file mode 100644 index 000000000..f32e44b68 --- /dev/null +++ b/test/EKI/runtests.jl @@ -0,0 +1,64 @@ +using Distributions +using LinearAlgebra +using Random +using Test + +using CalibrateEmulateSample.EKI + +@testset "EKI" begin + + # Seed for pseudo-random number generator + rng_seed = 41 + Random.seed!(rng_seed) + + ### Define priors on the parameters u + umin = 0.0 + umax = 20.0 + priors = [Uniform(umin, umax), # prior on u1 + Uniform(umin, umax)] # prior on u2 + + ### Define forward model G + function G(u) + 3.0 .* u + end + + ### Generate (artificial) truth samples + npar = 2 # number of parameters + ut = rand(Uniform(umin, umax), npar) + param_names = ["u1", "u2"] + yt = G(ut) + n_samples = 100 + truth_samples = zeros(n_samples, length(yt)) + noise_level = 0.9 + Γy = noise_level^2 * convert(Array, Diagonal(yt)) + μ = zeros(length(yt)) + for i in 1:n_samples + truth_samples[i, :] = yt + noise_level^2 * rand(MvNormal(μ, Γy)) + end + + ### Calibrate: Ensemble Kalman Inversion + N_ens = 50 # number of ensemble members + N_iter = 5 # number of EKI iterations + initial_params = EKI.construct_initial_ensemble(N_ens, priors; + rng_seed=rng_seed) + ekiobj = EKI.EKIObj(initial_params, param_names, + vec(mean(truth_samples, dims=1)), Γy) + + @test size(initial_params) == (N_ens, npar) + @test size(ekiobj.u[end]) == (N_ens, npar) + @test ekiobj.unames == ["u1", "u2"] + @test ekiobj.g_t ≈ [37.29, 15.49] atol=1e-1 + @test ekiobj.cov ≈ [30.29 0.0; 0.0 12.29] atol=1e-1 + @test ekiobj.N_ens == N_ens + + # EKI iterations + for i in 1:N_iter + params_i = ekiobj.u[end] + g_ens = G(params_i) + EKI.update_ensemble!(ekiobj, g_ens) + end + + # EKI results: Test if ensemble has collapsed toward the true parameter values + eki_final_result = vec(mean(ekiobj.u[end], dims=1)) + @test norm(ut - eki_final_result) < 0.5 +end diff --git a/test/GPEmulator/runtests.jl b/test/GPEmulator/runtests.jl new file mode 100644 index 000000000..4abb7f238 --- /dev/null +++ b/test/GPEmulator/runtests.jl @@ -0,0 +1,46 @@ +# Import modules +using Random +using GaussianProcesses +using Test + +using CalibrateEmulateSample.GPEmulator + +@testset "GPEmulator" begin + + # Seed for pseudo-random number generator + rng_seed = 41 + Random.seed!(rng_seed) + + # Training data + n = 10 # number of training points + x = 2.0 * π * rand(n) # predictors/features + y = sin.(x) + 0.05 * randn(n) # predictands/targets + + gppackage = GPJL() + pred_type = YType() + + # Construct kernel: + # Squared exponential kernel (note that hyperparameters are on log scale) + kern = SE(0.0, 0.0) + # log standard deviation of observational noise + logObsNoise = -1.0 + white = Noise(logObsNoise) + GPkernel = kern + white + + # Fit Gaussian Process Regression model + gpobj = GPObj(x, y, gppackage; GPkernel=GPkernel, normalized=false, + prediction_type=pred_type) + new_inputs = [0.0, π/2, π, 3*π/2, 2*π] + μ, σ² = GPEmulator.predict(gpobj, new_inputs) + + @test_throws Exception GPObj(x, y, gppackage; GPkernel=GPkernel, + normalized=true, prediction_type=pred_type) + @test gpobj.inputs == x + @test gpobj.data == y + @test gpobj.input_mean[1] ≈ 3.524 atol=1e-2 + @test gpobj.sqrt_inv_input_cov == nothing + @test gpobj.prediction_type == pred_type + @test μ ≈ [0.0, 1.0, 0.0, -1.0, 0.0] atol=1.0 + @test σ² ≈ [0.859, 0.591, 0.686, 0.645, 0.647] atol=1e-2 + +end diff --git a/test/MCMC/runtests.jl b/test/MCMC/runtests.jl new file mode 100644 index 000000000..5ceabb111 --- /dev/null +++ b/test/MCMC/runtests.jl @@ -0,0 +1,79 @@ +using Random +using LinearAlgebra +using Distributions +using GaussianProcesses +using Test + +using CalibrateEmulateSample.GPEmulator +using CalibrateEmulateSample.MCMC + +@testset "MCMC" begin + + # Seed for pseudo-random number generator + rng_seed = 41 + Random.seed!(rng_seed) + + # We need a GPObj to run MCMC, so let's reconstruct the one that's tested in + # runtets.jl in test/GPEmulator/ + # Training data + n = 10 # number of training points + x = 2.0 * π * rand(n) # predictors/features + y = sin.(x) + 0.05 * randn(n) # predictands/targets + + gppackage = GPJL() + pred_type = YType() + + # Construct kernel: + # Squared exponential kernel (note that hyperparameters are on log scale) + kern = SE(0.0, 0.0) + # log standard deviation of observational noise + logObsNoise = -1.0 + white = Noise(logObsNoise) + GPkernel = kern + white + + # Fit Gaussian Process Regression model + gpobj = GPObj(x, y, gppackage; GPkernel=GPkernel, normalized=false, + prediction_type=pred_type) + + ### Define prior + umin = -1.0 + umax = 6.0 + prior = [Uniform(umin, umax)] + obs_sample = [1.0] + cov = convert(Array, Diagonal([1.0])) + + # MCMC parameters + mcmc_alg = "rwm" # random walk Metropolis + param_init = [3.0] # set initial parameter + + # First let's run a short chain to determine a good step size + burnin = 0 + step = 0.5 # first guess + max_iter = 5000 + mcmc_test = MCMCObj(obs_sample, cov, prior, step, param_init, max_iter, + mcmc_alg, burnin) + new_step = find_mcmc_step!(mcmc_test, gpobj) + + # reset parameters + burnin = 1000 + max_iter = 100_000 + + # Now begin the actual MCMC + mcmc = MCMCObj(obs_sample, cov, prior, step, param_init, max_iter, + mcmc_alg, burnin) + sample_posterior!(mcmc, gpobj, max_iter) + posterior = get_posterior(mcmc) + post_mean = mean(posterior, dims=1)[1] + + @test mcmc.obs_sample == obs_sample + @test mcmc.obs_cov == cov + @test mcmc.obs_covinv == inv(cov) + @test mcmc.burnin == burnin + @test mcmc.algtype == mcmc_alg + @test mcmc.iter[1] == max_iter+ 1 + @test size(posterior) == (max_iter - burnin + 1, length(param_init)) + @test_throws Exception MCMCObj(obs_sample, cov, prior, step, param_init, + max_iter, "gibbs", burnin) + @test post_mean ≈ π/2 atol=3e-1 + +end diff --git a/test/Observations/runtests.jl b/test/Observations/runtests.jl new file mode 100644 index 000000000..02a6daa70 --- /dev/null +++ b/test/Observations/runtests.jl @@ -0,0 +1,33 @@ +using Test +using Random +using Statistics + +using CalibrateEmulateSample.Observations + +@testset "Observations" begin + + # Generate samples as vector of vectors + n_data = 3 + n_samples = 5 + samples = [vec(i*ones(n_data)) for i in 1:n_samples] + data_names = ["d$(string(i))" for i in 1:n_data] + obs = Obs(samples, data_names) + @test obs.data_names == data_names + @test obs.mean == [3.0, 3.0, 3.0] + @test obs.cov == 2.5 * ones(3, 3) + + # Generate a single sample + sample = [1.0, 2.0, 3.0] + obs = Obs(sample, data_names) + @test obs.mean == sample + @test obs.cov == nothing + + # Generate samples as a 2d-array (each row corresponds to 1 sample) + samples = vcat([i*ones(n_data)' for i in 1:n_samples]...) + obs = Obs(samples, data_names) + @test obs.mean == [3.0, 3.0, 3.0] + @test obs.cov == 2.5 * ones(3, 3) + +end + + diff --git a/test/Utilities/runtests.jl b/test/Utilities/runtests.jl index d5602383c..6bb24b709 100644 --- a/test/Utilities/runtests.jl +++ b/test/Utilities/runtests.jl @@ -1,12 +1,49 @@ using Test +using Random +using Statistics using CalibrateEmulateSample.Utilities +using CalibrateEmulateSample.Observations @testset "Utilities" begin - @test length(name("a")) == RPAD - @test length(name("a" ^ RPAD)) == (RPAD + 1) - @test length(warn("a")) == RPAD - @test length(warn("a" ^ RPAD)) == (RPAD + 11) - @test isa(name("a"), String) - @test isa(warn("a"), String) + + rng_seed = 41 + Random.seed!(rng_seed) + + @test length(name("a")) == RPAD + @test length(name("a" ^ RPAD)) == (RPAD + 1) + @test length(warn("a")) == RPAD + @test length(warn("a" ^ RPAD)) == (RPAD + 11) + @test isa(name("a"), String) + @test isa(warn("a"), String) + + arr = vcat([i*ones(3)' for i in 1:5]...) + data_names = ["d1", "d2", "d3"] + obs = Obs(arr, data_names) + sample = get_obs_sample(obs; rng_seed=rng_seed) + @test sample == [3.0, 3.0, 3.0] + + mean_arr = dropdims(mean(arr, dims=1), dims=1) + std_arr = dropdims(std(arr, dims=1), dims=1) + @test mean_arr == [3.0, 3.0, 3.0] + @test std_arr ≈ [1.58, 1.58, 1.58] atol=1e-2 + z_arr = orig2zscore(arr, mean_arr, std_arr) + z_arr_test = [-1.265 -1.265 -1.265; + -0.632 -0.632 -0.632; + 0.0 0.0 0.0; + 0.632 0.632 0.632; + 1.265 1.265 1.265] + @test z_arr ≈ z_arr_test atol=1e-2 + orig_arr = zscore2orig(z_arr, mean_arr, std_arr) + @test orig_arr ≈ arr atol=1e-5 + + v = vec([1.0 2.0 3.0]) + mean_v = vec([0.5 1.5 2.5]) + std_v = vec([0.5 0.5 0.5]) + z_v = orig2zscore(v, mean_v, std_v) + println(z_v) + @test z_v ≈ [1.0, 1.0, 1.0] atol=1e-5 + orig_v = zscore2orig(z_v, mean_v, std_v) + @test orig_v ≈ v atol=1e-5 + end diff --git a/test/runtests.jl b/test/runtests.jl index 9d06383dc..61791d54d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,12 +4,16 @@ ENV["JULIA_LOG_LEVEL"] = "WARN" ENV["PYTHON"] = "" for submodule in [ + "EKI", + "GPEmulator", + "MCMC", + "Observations", "Utilities", - # "L96m", - # "GPR", - "EKS", - # "Histograms", - # "Cloudy", + #"L96m", + #"GPR", + #"EKS", + #"Histograms", + #"Cloudy", ] println("Starting tests for $submodule") From c3decb9d1dbd87cc7f5a7b0344fb2316de9594bd Mon Sep 17 00:00:00 2001 From: jakebolewski Date: Fri, 19 Jun 2020 14:18:40 -0600 Subject: [PATCH 2/2] Switch CI to use Github Actions --- .appveyor.yml | 47 ----------- .github/workflows/Tests.yml | 140 +++++++++++++++++++++++++++++++++ .github/workflows/dockerci.yml | 38 --------- .travis.yml | 43 ---------- Dockerfile | 6 -- Manifest.toml | 3 +- Project.toml | 1 + README.md | 9 --- bors.toml | 8 +- 9 files changed, 148 insertions(+), 147 deletions(-) delete mode 100644 .appveyor.yml create mode 100644 .github/workflows/Tests.yml delete mode 100644 .github/workflows/dockerci.yml delete mode 100644 .travis.yml delete mode 100644 Dockerfile diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index bd2fade61..000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,47 +0,0 @@ -branches: - only: - # This is where pull requests from "bors r+" are built. - - staging - # This is where pull requests from "bors try" are built. - - trying - # Enable building pull requests. - - master - -environment: - PYTHON: conda - matrix: - - julia_version: 1.3 - - julia_version: nightly - -platform: - - x86 # 32-bit - - x64 # 64-bit - -# Uncomment the following lines to allow failures on nightly julia -# (tests will run but not make your overall status red) -matrix: - allow_failures: - - julia_version: nightly - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) - -build_script: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" - -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" - -# # Uncomment to support code coverage upload. Should only be enabled for packages -# # which would have coverage gaps without running on Windows -# on_success: -# - echo "%JL_CODECOV_SCRIPT%" -# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%" diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml new file mode 100644 index 000000000..0b12ddd68 --- /dev/null +++ b/.github/workflows/Tests.yml @@ -0,0 +1,140 @@ +name: Tests + +on: + pull_request: + push: + branches: + - staging + - trying +jobs: + test-linux: + timeout-minutes: 60 + strategy: + fail-fast: true + + runs-on: ubuntu-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.4.0 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v2.2.0 + + - name: Set up Julia + uses: julia-actions/setup-julia@v1.1.6 + with: + version: 1.4 + + - name: Install Julia Project Packages + # we add this ENV varaible to force PyCall to download and use Conda rather than + # the system python (default on Linux), see the PyCall documentation + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Pkg; Pkg.instantiate()' + + - name: Install SciKitLearn Conda Package + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Conda; Conda.add("scikit-learn")' + + - name: Run Unit Tests + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Pkg; Pkg.test(coverage=true)' + + - name: Generate coverage file + run: | + julia --project=@. -e 'using Pkg; Pkg.add("Coverage"); + using Coverage; + LCOV.writefile("coverage-lcov.info", Codecov.process_folder())' + if: success() + + - name: Submit coverage + uses: codecov/codecov-action@v1.0.7 + with: + token: ${{secrets.CODECOV_TOKEN}} + if: success() + + test-macos: + timeout-minutes: 60 + strategy: + fail-fast: true + + runs-on: macos-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.4.0 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v2.2.0 + + - name: Set up Julia + uses: julia-actions/setup-julia@v1.1.6 + with: + version: 1.4 + + - name: Install Julia Project Packages + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Pkg; Pkg.instantiate()' + + - name: Install SciKitLearn Conda Package + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Conda; Conda.add("scikit-learn")' + + - name: Run Unit Tests + env: + PYTHON: "" + run: | + LD_LIBRARY_PATH=$HOME/.julia/conda/3/lib julia --project=@. -e 'using Pkg; Pkg.test()' + + test-windows: + timeout-minutes: 60 + strategy: + fail-fast: true + + runs-on: windows-latest + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.4.0 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v2.2.0 + + - name: Set up Julia + uses: julia-actions/setup-julia@v1.1.6 + with: + version: 1.4 + + - name: Install Julia Project Packages + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Pkg; Pkg.instantiate()' + + - name: Install SciKitLearn Conda Package + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Conda; Conda.add(\"scikit-learn\")' + + - name: Run Unit Tests + env: + PYTHON: "" + run: | + julia --project=@. -e 'using Pkg; Pkg.test()' diff --git a/.github/workflows/dockerci.yml b/.github/workflows/dockerci.yml deleted file mode 100644 index ba3e35b4e..000000000 --- a/.github/workflows/dockerci.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: DockerCI - -on: - push: - branches: [ master, staging, trying ] - pull_request: - branches: [ master, staging, trying ] - -jobs: - dockerci: - runs-on: ${{ matrix.os }} - strategy: - matrix: - julia-version: [1.3, 1.4] - os: [ubuntu-latest] - - steps: - - uses: actions/checkout@v2 - - name: Build and test - run: | - docker build . --file Dockerfile --tag ces:PR - docker images - docker run ces:PR - - name: "Generate coverage" - env: - JULIA_PROJECT: "@." - run: julia --project=@. -e 'using Pkg; - cd(Pkg.dir("CalibrateEmulateSample")); - Pkg.add("Coverage"); - using Coverage; - LCOV.writefile("coverage-lcov.info", Codecov.process_folder())' - if: success() - - name: "Submit coverage" - uses: codecov/codecov-action@v1.0.2 - with: - token: ${{secrets.CODECOV_TOKEN}} - if: success() - diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 534cf174e..000000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -branches: - only: - # This is where pull requests from "bors r+" are built. - - staging - # This is where pull requests from "bors try" are built. - - trying - # Enable building pull requests. - - master - -## Documentation: http://docs.travis-ci.com/user/languages/julia/ -language: julia -sudo: true -dist: xenial -os: - - linux - - osx -julia: - - 1.3 - -notifications: - email: false - -after_success: - # push coverage results to Codecov - - julia -e 'import Pkg; - cd(Pkg.dir("CalibrateEmulateSample")); - Pkg.add("Coverage"); - using Coverage; - Codecov.submit(Codecov.process_folder())' - -jobs: - include: - - stage: "Documentation" - julia: 1.3 - os: linux - script: - - export DOCUMENTER_DEBUG="true" - - julia --color=yes --project=docs/ -e 'using Pkg; - Pkg.develop(PackageSpec(path=pwd())); - Pkg.instantiate(); - Pkg.build("CalibrateEmulateSample")' - - julia --color=yes --project=docs/ docs/make.jl - after_success: skip diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 61b17ded6..000000000 --- a/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM julia:1.3 - -COPY . /CalibrateEmulateSample.jl/ - -WORKDIR /CalibrateEmulateSample.jl/ -RUN julia --project -e "using Pkg; Pkg.instantiate();" diff --git a/Manifest.toml b/Manifest.toml index 0a68fe3fb..e7eee69e8 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -481,6 +481,7 @@ uuid = "1d6d02ad-be62-4b6b-8a6d-2f90e265016e" version = "0.1.2" [[LibGit2]] +deps = ["Printf"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" [[Libdl]] @@ -657,7 +658,7 @@ uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" version = "1.0.5" [[Pkg]] -deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Test", "UUIDs"] +deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" [[PoissonRandom]] diff --git a/Project.toml b/Project.toml index 974dceca0..06c35bf68 100644 --- a/Project.toml +++ b/Project.toml @@ -5,6 +5,7 @@ version = "0.1.0" [deps] Cloudy = "9e3b23bb-e7cc-4b94-886c-65de2234ba87" +Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d" DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" diff --git a/README.md b/README.md index b9853001b..ea6d8c1af 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,6 @@ [docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg [docs-dev-url]: https://CliMA.github.io/CalibrateEmulateSample.jl/dev/ -[travis-img]: https://travis-ci.org/CliMA/CalibrateEmulateSample.jl.svg?branch=master -[travis-url]: https://travis-ci.org/CliMA/CalibrateEmulateSample.jl - -[appveyor-img]: https://ci.appveyor.com/api/projects/status/c6eykd0w94pmyjt8/branch/master?svg=true -[appveyor-url]: https://ci.appveyor.com/project/climate-machine/calibrateemulatesample-jl/branch/master - -[docker-ci-img]: https://github.com/CliMA/CalibrateEmulateSample.jl/workflows/DockerCI/badge.svg -[docker-ci-url]: https://github.com/CliMA/CalibrateEmulateSample.jl/actions - [codecov-img]: https://codecov.io/gh/CliMA/CalibrateEmulateSample.jl/branch/master/graph/badge.svg [codecov-url]: https://codecov.io/gh/CliMA/CalibrateEmulateSample.jl diff --git a/bors.toml b/bors.toml index c532236c1..9aa10a946 100644 --- a/bors.toml +++ b/bors.toml @@ -1,6 +1,8 @@ status = [ - "dockerci (1.4, ubuntu-latest)", + 'test-linux', + 'test-macos', + 'test-windows' ] delete_merged_branches = true -timeout_sec = 86400 -block_labels = [ "do-not-merge-yet" ] \ No newline at end of file +timeout_sec = 3600 +block_labels = [ "do-not-merge-yet" ]