diff --git a/Project.toml b/Project.toml index aa49b14..28205bd 100644 --- a/Project.toml +++ b/Project.toml @@ -14,6 +14,7 @@ RandomNumbers = "e6cf234a-135c-5ec9-84dd-332b85af5143" DiffEqBase = "6.133.1, 7" DiffEqNoiseProcess = "5.13.0" Distributions = "0.25.100" +Markdown = "1" RandomNumbers = "1.5.3" SafeTestsets = "0.1, 1" SciMLTesting = "1" diff --git a/test/qa/Project.toml b/test/qa/Project.toml index 02d5f0b..f3d7758 100644 --- a/test/qa/Project.toml +++ b/test/qa/Project.toml @@ -1,7 +1,7 @@ [deps] AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a" +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" DiffEqFinancial = "5a0ffddc-d203-54b0-88ba-2c03c0fc2e67" -ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" SciMLTesting = "09d9d899-5365-40a9-917a-5f67fddea283" @@ -12,10 +12,10 @@ DiffEqFinancial = {path = "../.."} [compat] AllocCheck = "0.2" +Aqua = "0.8" DiffEqFinancial = "2.10.0" -ExplicitImports = "1.14" JET = "0.9, 0.10, 0.11" SafeTestsets = "0.1, 1" -SciMLTesting = "1" +SciMLTesting = "1.6" Test = "1.10" julia = "1.10" diff --git a/test/qa/explicit_imports.jl b/test/qa/explicit_imports.jl deleted file mode 100644 index 929846a..0000000 --- a/test/qa/explicit_imports.jl +++ /dev/null @@ -1,8 +0,0 @@ -using ExplicitImports -using DiffEqFinancial -using Test - -@testset "ExplicitImports" begin - @test check_no_implicit_imports(DiffEqFinancial) === nothing - @test check_no_stale_explicit_imports(DiffEqFinancial) === nothing -end diff --git a/test/qa/jet_tests.jl b/test/qa/jet_tests.jl deleted file mode 100644 index 68327ec..0000000 --- a/test/qa/jet_tests.jl +++ /dev/null @@ -1,87 +0,0 @@ -using DiffEqFinancial -using JET -using Test - -@testset "JET static analysis" begin - # Test that key problem constructors are type-stable using @test_opt - # target_modules filters to only report issues from DiffEqFinancial itself, - # ignoring upstream SciMLBase/DiffEqBase issues - - @testset "HestonProblem type stability" begin - @test_opt target_modules = (DiffEqFinancial,) HestonProblem( - 1.0, 1.0, 0.25, 1.0, 1.0, [1.0, 0.5], (0.0, 1.0) - ) - end - - @testset "BlackScholesProblem type stability" begin - @test_opt target_modules = (DiffEqFinancial,) BlackScholesProblem( - t -> t^2, (t, u) -> 1.0, 0.25, 0.5, (0.0, 1.0) - ) - end - - @testset "GeneralizedBlackScholesProblem type stability" begin - @test_opt target_modules = (DiffEqFinancial,) GeneralizedBlackScholesProblem( - t -> 0.05, t -> 0.01, (t, u) -> 1.0, 0.2, 0.5, (0.0, 1.0) - ) - end - - @testset "GeometricBrownianMotionProblem type stability" begin - @test_opt target_modules = (DiffEqFinancial,) GeometricBrownianMotionProblem( - 0.03, 0.2, 100.0, (0.0, 1.0) - ) - end - - @testset "OrnsteinUhlenbeckProblem type stability" begin - @test_opt target_modules = (DiffEqFinancial,) OrnsteinUhlenbeckProblem( - 0.1, 0.5, 0.2, 1.0, (0.0, 1.0) - ) - end - - @testset "ExtendedOrnsteinUhlenbeckProblem type stability" begin - @test_opt target_modules = (DiffEqFinancial,) ExtendedOrnsteinUhlenbeckProblem( - 0.1, t -> 0.5 + 0.1 * t, 0.2, 1.0, (0.0, 1.0) - ) - end - - @testset "MfStateProblem type stability" begin - @test_opt target_modules = (DiffEqFinancial,) MfStateProblem( - 0.1, t -> 0.2 * (1.0 + 0.1 * t), 0.0, (0.0, 1.0) - ) - end - - @testset "CIRProblem type stability" begin - @test_opt target_modules = (DiffEqFinancial,) CIRProblem( - 0.1, 0.5, 0.2, 0.4, (0.0, 1.0) - ) - end - - @testset "CIRNoise type stability" begin - @test_opt target_modules = (DiffEqFinancial,) CIRNoise( - 0.1, 0.5, 0.2, 0.0, 0.4 - ) - end - - @testset "Analytical functions type stability" begin - @test_opt target_modules = (DiffEqFinancial,) gbm_mean(0.05, 100.0, 1.0) - @test_opt target_modules = (DiffEqFinancial,) gbm_variance(0.05, 0.2, 100.0, 1.0) - @test_opt target_modules = (DiffEqFinancial,) gbm_std(0.05, 0.2, 100.0, 1.0) - @test_opt target_modules = (DiffEqFinancial,) ou_mean(0.5, 1.0, 0.5, 2.0) - @test_opt target_modules = (DiffEqFinancial,) ou_variance(0.5, 0.3, 2.0) - @test_opt target_modules = (DiffEqFinancial,) ou_std(0.5, 0.3, 2.0) - @test_opt target_modules = (DiffEqFinancial,) ou_stationary_mean(1.0) - @test_opt target_modules = (DiffEqFinancial,) ou_stationary_variance(0.5, 0.3) - @test_opt target_modules = (DiffEqFinancial,) cir_mean(0.5, 0.04, 0.03, 2.0) - @test_opt target_modules = (DiffEqFinancial,) cir_variance(0.5, 0.04, 0.1, 0.03, 2.0) - @test_opt target_modules = (DiffEqFinancial,) cir_std(0.5, 0.04, 0.1, 0.03, 2.0) - @test_opt target_modules = (DiffEqFinancial,) cir_stationary_mean(0.04) - @test_opt target_modules = (DiffEqFinancial,) cir_stationary_variance(0.5, 0.04, 0.1) - @test_opt target_modules = (DiffEqFinancial,) bs_log_mean(0.05, 0.2, 4.6, 1.0) - @test_opt target_modules = (DiffEqFinancial,) bs_log_variance(0.2, 1.0) - @test_opt target_modules = (DiffEqFinancial,) bs_log_std(0.2, 1.0) - @test_opt target_modules = (DiffEqFinancial,) heston_mean(0.05, 100.0, 1.0) - @test_opt target_modules = (DiffEqFinancial,) heston_variance_mean(2.0, 0.04, 0.04, 1.0) - @test_opt target_modules = (DiffEqFinancial,) heston_variance_variance( - 2.0, 0.04, 0.3, 0.04, 1.0 - ) - end -end diff --git a/test/qa/qa.jl b/test/qa/qa.jl new file mode 100644 index 0000000..309980f --- /dev/null +++ b/test/qa/qa.jl @@ -0,0 +1,15 @@ +using SciMLTesting, DiffEqFinancial, Test +using JET + +run_qa( + DiffEqFinancial; + explicit_imports = true, + aqua_kwargs = (; deps_compat = (; check_extras = false)), + ei_kwargs = (; + # `AbstractSDEProblem` is owned by SciMLBase and reexported (non-public) by + # DiffEqBase; it is not public in SciMLBase either, so neither the owner nor + # the public import can be satisfied by re-pointing the import. + all_explicit_imports_via_owners = (; ignore = (:AbstractSDEProblem,)), # SciMLBase + all_explicit_imports_are_public = (; ignore = (:AbstractSDEProblem,)), # SciMLBase + ), +)