diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml deleted file mode 100644 index 8a2969e0..00000000 --- a/.github/workflows/CI.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: CI -on: - pull_request: - branches: - - master - push: - branches: - - master -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - version: - - '1' - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: ${{ matrix.version }} - - uses: actions/cache@v4 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 - env: - GROUP: "CPU" - RETESTITEMS_NWORKERS: 4 - RETESTITEMS_NWORKER_THREADS: 2 - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v4 - with: - file: lcov.info - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index c240796c..6185015c 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -10,4 +10,4 @@ on: jobs: format-check: name: "Format Check" - uses: "SciML/.github/.github/workflows/format-check.yml@v1" + uses: "SciML/.github/.github/workflows/format-suggestions-on-pr.yml@v1" diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml new file mode 100644 index 00000000..8db3f061 --- /dev/null +++ b/.github/workflows/Tests.yml @@ -0,0 +1,40 @@ +name: "Tests" + +on: + pull_request: + branches: + - master + - 'release-' + paths-ignore: + - 'docs/**' + push: + branches: + - master + paths-ignore: + - 'docs/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }} + +env: + RETESTITEMS_NWORKERS: 4 + RETESTITEMS_NWORKER_THREADS: 2 + +jobs: + tests: + name: "Tests" + strategy: + fail-fast: false + matrix: + os: + - "ubuntu-latest" + - "macos-latest" + - "windows-latest" + group: + - "CPU" + uses: "SciML/.github/.github/workflows/tests.yml@v1" + with: + os: "${{ matrix.os }}" + group: "${{ matrix.group }}" + secrets: "inherit" diff --git a/src/adaptivity.jl b/src/adaptivity.jl index b1ec6da2..26bf09bc 100644 --- a/src/adaptivity.jl +++ b/src/adaptivity.jl @@ -237,7 +237,7 @@ function sum_stages!(z::AbstractArray, cache::MIRKCache, w, i::Int, dt = cache.m __maybe_matmul!(z, k_discrete[i].du[:, 1:stage], w[1:stage]) __maybe_matmul!( z, k_interp.u[i][:, 1:(s_star - stage)], w[(stage + 1):s_star], true, true) - z .= z .* dt .+ cache.y₀[i] + z .= z .* dt .+ cache.y₀.u[i] return z end diff --git a/src/default_nlsolve.jl b/src/default_nlsolve.jl index baa2b8de..bd354ab9 100644 --- a/src/default_nlsolve.jl +++ b/src/default_nlsolve.jl @@ -18,8 +18,7 @@ function __FastShortcutBVPCompatibleNLLSPolyalg( linsolve, precs, disable_geodesic = Val(true), autodiff, kwargs...), TrustRegion(; concrete_jac, linsolve, precs, autodiff, kwargs...), GaussNewton(; concrete_jac, linsolve, precs, - linesearch = LineSearchesJL(; method = BackTracking()), - autodiff, kwargs...), + linesearch = BackTracking(), autodiff, kwargs...), LevenbergMarquardt(; linsolve, precs, autodiff, kwargs...)) end return NonlinearSolvePolyAlgorithm(algs, Val(:NLLS)) @@ -32,8 +31,8 @@ function __FastShortcutBVPCompatibleNonlinearPolyalg( algs = (NewtonRaphson(; concrete_jac, linsolve, precs, autodiff),) else algs = (NewtonRaphson(; concrete_jac, linsolve, precs, autodiff), - NewtonRaphson(; concrete_jac, linsolve, precs, - linesearch = LineSearchesJL(; method = BackTracking()), autodiff), + NewtonRaphson(; + concrete_jac, linsolve, precs, linesearch = BackTracking(), autodiff), TrustRegion(; concrete_jac, linsolve, precs, autodiff)) end return NonlinearSolvePolyAlgorithm(algs, Val(:NLS)) diff --git a/src/utils.jl b/src/utils.jl index 62eba2c9..1ecacd4f 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -386,4 +386,4 @@ end @inline (f::__Fix3{F})(a, b) where {F} = f.f(a, b, f.x) -# convert every vector of vector to AbstractVectorOfArray, especially if them come from get_tmp of PreallocationTools.jl \ No newline at end of file +# convert every vector of vector to AbstractVectorOfArray, especially if them come from get_tmp of PreallocationTools.jl diff --git a/test/mirk/mirk_basic_tests.jl b/test/mirk/mirk_basic_tests.jl index cdb15a51..90c9e152 100644 --- a/test/mirk/mirk_basic_tests.jl +++ b/test/mirk/mirk_basic_tests.jl @@ -82,7 +82,7 @@ end prob = probArr[i] @testset "MIRK$order" for order in (2, 3, 4, 5, 6) sol = solve(prob, mirk_solver(Val(order)); dt = 0.2) - @test norm(diff(first.(sol.u)) .+ 0.2, Inf) + abs(sol[1][1] - 5) < affineTol + @test norm(diff(first.(sol.u)) .+ 0.2, Inf) + abs(sol.u[1][1] - 5) < affineTol end end end diff --git a/test/mirk/nlls_tests.jl b/test/mirk/nlls_tests.jl index f72ba26d..57926773 100644 --- a/test/mirk/nlls_tests.jl +++ b/test/mirk/nlls_tests.jl @@ -21,7 +21,7 @@ for solver in SOLVERS sol = solve(bvp1, solver; verbose = false, dt = 1.0) - @test norm(bc1(sol, nothing, tspan), Inf) < 1e-2 + @test norm(bc1(sol, nothing, sol.t), Inf) < 1e-2 end # IIP MP-BVP @@ -62,7 +62,7 @@ for solver in SOLVERS sol = solve(bvp3, solver; verbose = false, dt = 1.0) - @test norm(vcat(bc1a(sol[1], nothing), bc1b(sol[end], nothing)), Inf) < 1e-2 + @test norm(vcat(bc1a(sol.u[1], nothing), bc1b(sol.u[end], nothing)), Inf) < 1e-2 end # IIP TP-BVP diff --git a/test/mirk/vectorofvector_initials_tests.jl b/test/mirk/vectorofvector_initials_tests.jl index d7da6c0e..301de3ee 100644 --- a/test/mirk/vectorofvector_initials_tests.jl +++ b/test/mirk/vectorofvector_initials_tests.jl @@ -55,9 +55,9 @@ # The BVP set up # This is not really kind of Two-Point BVP we support. function bc_po!(residual, u, p, t) - residual[1] = u[:, 1][1] - u[end][1] - residual[2] = u[:, 1][2] - u[end][2] - residual[3] = u[:, 1][3] - u[end][3] + residual[1] = u[:, 1][1] - u[:, end][1] + residual[2] = u[:, 1][2] - u[:, end][2] + residual[3] = u[:, 1][3] - u[:, end][3] end #This is the part of the code that has problems diff --git a/test/misc/bigfloat_test.jl b/test/misc/bigfloat_test.jl index 53211b94..ebf95dab 100644 --- a/test/misc/bigfloat_test.jl +++ b/test/misc/bigfloat_test.jl @@ -8,8 +8,8 @@ du[2] = -9.81 * sin(θ) end function bc!(residual, u, p, t) - residual[1] = u[end ÷ 2][1] + big(pi / 2) - residual[2] = u[end][1] - big(pi / 2) + residual[1] = u[:, end ÷ 2][1] + big(pi / 2) + residual[2] = u[:, end][1] - big(pi / 2) end u0 = BigFloat.([pi / 2, pi / 2]) prob = BVProblem(simplependulum!, bc!, u0, tspan) diff --git a/test/misc/manifolds_tests.jl b/test/misc/manifolds_tests.jl index d1733ef8..42a5b253 100644 --- a/test/misc/manifolds_tests.jl +++ b/test/misc/manifolds_tests.jl @@ -58,15 +58,10 @@ return vcat(t * a1 + (1 - t) * a2, zero(a1)) end - function initial_guess_2(t) - a1, a2 = [0.5, -1.2], [-0.5, 0.3] - return vcat(t * a1 + (1 - t) * a2, zero(a1)) - end - algs = [Shooting(Tsit5()), MultipleShooting(10, Tsit5()), MIRK4(), MIRK5(), MIRK6()] - @testset "Initial Guess Functions: $(u0)" for u0 in (initial_guess_1, initial_guess_2) - bvp = BVProblem(chart_log_problem!, bc1!, u0, tspan, (M, i, a1, a2)) + @testset "Initial Guess Functions" begin + bvp = BVProblem(chart_log_problem!, bc1!, initial_guess_1, tspan, (M, i, a1, a2)) for alg in algs if alg isa Shooting || alg isa MultipleShooting diff --git a/test/misc/non_vector_input_tests.jl b/test/misc/non_vector_input_tests.jl index 875afcdd..b4a967f3 100644 --- a/test/misc/non_vector_input_tests.jl +++ b/test/misc/non_vector_input_tests.jl @@ -53,7 +53,7 @@ @testset "Single Shooting" begin for prob in probs - sol = solve(prob, Shooting(Tsit5())) + sol = solve(prob, Shooting(Tsit5(), NewtonRaphson())) @test norm(boundary(sol, prob.p, nothing), Inf) < 0.01 end end diff --git a/test/misc/type_stability_tests.jl b/test/misc/type_stability_tests.jl index 2d44b947..4e76ba81 100644 --- a/test/misc/type_stability_tests.jl +++ b/test/misc/type_stability_tests.jl @@ -7,7 +7,7 @@ du[2] = p[3] * u[1] * u[2] - p[4] * u[2] end - bc(sol, p, t) = [sol[1][1] - 1, sol[end][2] - 2] + bc(sol, p, t) = [sol[:, 1][1] - 1, sol[:, end][2] - 2] function bc!(res, sol, p, t) res[1] = sol[:, 1][1] - 1 res[2] = sol[:, end][2] - 2