From 600d780012a14e6725c1f9393021ce9bf1c3ea96 Mon Sep 17 00:00:00 2001 From: Nathanael Bosch Date: Sat, 23 Dec 2023 10:16:17 +0100 Subject: [PATCH 1/4] 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 From 929b8f88b1e51b0eabfb84186d2be681b199af32 Mon Sep 17 00:00:00 2001 From: Nathanael Bosch Date: Sat, 23 Dec 2023 10:23:32 +0100 Subject: [PATCH 2/4] Does this change anythign? --- test/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Project.toml b/test/Project.toml index 4e3fffc..ace6bd3 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,4 +1,5 @@ [deps] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +ChaoticDynamicalSystemLibrary = "55704126-756f-498a-a54f-434b72ecbddd" ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" From cc177e40243f06258d8ab088a918005de6e17b6b Mon Sep 17 00:00:00 2001 From: Nathanael Bosch Date: Sat, 23 Dec 2023 10:26:16 +0100 Subject: [PATCH 3/4] Add Test to tests --- test/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Project.toml b/test/Project.toml index ace6bd3..76e2f66 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -3,3 +3,4 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" ChaoticDynamicalSystemLibrary = "55704126-756f-498a-a54f-434b72ecbddd" ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" From 088b3828e3cde7ea17095d378f037b6212f7c51c Mon Sep 17 00:00:00 2001 From: Nathanael Bosch Date: Sat, 23 Dec 2023 10:30:01 +0100 Subject: [PATCH 4/4] Only test JET for Julia>1.6 --- test/runtests.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 8ac52b6..82846fc 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -12,7 +12,9 @@ using Aqua, JET ) end - @testset "Code linting (JET.jl)" begin - JET.test_package(ChaoticDynamicalSystemLibrary; target_defined_modules = true) + if VERSION >= v"1.7" + @testset "Code linting (JET.jl)" begin + JET.test_package(ChaoticDynamicalSystemLibrary; target_defined_modules = true) + end end end