From 600d780012a14e6725c1f9393021ce9bf1c3ea96 Mon Sep 17 00:00:00 2001 From: Nathanael Bosch Date: Sat, 23 Dec 2023 10:16:17 +0100 Subject: [PATCH] Add Aqua and JET to the tests --- Project.toml | 6 ++++++ src/chaotic_attractors.jl | 5 ++++- test/Project.toml | 4 ++++ test/runtests.jl | 12 ++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test/Project.toml diff --git a/Project.toml b/Project.toml index 3ea0e34..321b943 100644 --- a/Project.toml +++ b/Project.toml @@ -12,6 +12,12 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" [compat] julia = "1.6" +ComponentArrays = "0.15" +JSON = "0.21" +LinearAlgebra = "1" +Markdown = "1" +SciMLBase = "1,2" +Test = "1" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/chaotic_attractors.jl b/src/chaotic_attractors.jl index d90e5c9..d4a2739 100644 --- a/src/chaotic_attractors.jl +++ b/src/chaotic_attractors.jl @@ -3730,6 +3730,9 @@ class BeerRNN(DynSys): """ @doc make_docstring(BeerRNN) BeerRNN function BeerRNN() + function sig(x) + return 1.0 / (1.0 + exp(-x)) + end function rhs(du, u, p, t) w, theta, tau = p du .= (-u + w * sig.(u + theta)) / tau @@ -3738,7 +3741,7 @@ function BeerRNN() p = dict_to_componentarray(ATTRACTOR_DATA["BeerRNN"]["parameters"]) tspan = (0.0, 1.0) f = ODEFunction(rhs) - prob = ODEProblem(f,u0,tspan,p) + prob = ODEProblem(f, u0, tspan, p,) return prob end diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..4e3fffc --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,4 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" diff --git a/test/runtests.jl b/test/runtests.jl index 447a6dc..8ac52b6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,18 @@ using ChaoticDynamicalSystemLibrary using Test +using Aqua, JET @testset "ChaoticDynamicalSystemLibrary.jl" begin # Write your tests here. + + @testset "Code quality (Aqua.jl)" begin + Aqua.test_all( + ChaoticDynamicalSystemLibrary; + ambiguities=(imported=false), + ) + end + + @testset "Code linting (JET.jl)" begin + JET.test_package(ChaoticDynamicalSystemLibrary; target_defined_modules = true) + end end