Skip to content

Commit

Permalink
Merge pull request #1 from nathanaelbosch/testutils
Browse files Browse the repository at this point in the history
Add Aqua and JET to the tests
  • Loading branch information
nathanaelbosch authored Dec 23, 2023
2 parents d8ba02f + 088b382 commit 95ee05b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion src/chaotic_attractors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
6 changes: 6 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[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"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
14 changes: 14 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
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

if VERSION >= v"1.7"
@testset "Code linting (JET.jl)" begin
JET.test_package(ChaoticDynamicalSystemLibrary; target_defined_modules = true)
end
end
end

0 comments on commit 95ee05b

Please sign in to comment.