Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update tests workflow to use centralized reusable workflow and auto-suggest formatting changes on PRs #204

Merged
merged 30 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1169671
ci: update tests workflow to use centralised reusable workflow
thazhemadam Jul 31, 2024
4e36895
ci(format-check): automatically comment formatting suggestions on PRs
thazhemadam Jul 31, 2024
46061c5
Update nlls_tests.jl
ChrisRackauckas Jul 31, 2024
8a251a9
Update nlls_tests.jl
ChrisRackauckas Jul 31, 2024
b9e23f3
Revert "Update nlls_tests.jl"
ChrisRackauckas Aug 8, 2024
9b65488
a bunch of depwarn fixes
ChrisRackauckas Aug 8, 2024
a8fb531
Use another indexing method
ErikQQY Aug 8, 2024
a746c1f
bc doesn’t use RAT
ErikQQY Aug 8, 2024
7abc1ab
Use the new indexing in tests bc
ErikQQY Aug 8, 2024
a8d1a73
Fix indexing error
ErikQQY Aug 9, 2024
9187cee
Fix more indexing errors
ErikQQY Aug 9, 2024
d1a2646
Fix more indexing errors
ErikQQY Aug 9, 2024
68fabad
Fix indexing in eval_bc_residual
ErikQQY Aug 9, 2024
e3536a2
Revert some fixes
ErikQQY Aug 9, 2024
439ed20
Merge branch 'master' into at/use-reusable-workflows
ChrisRackauckas Aug 16, 2024
73f2f10
Fix non-standard usage of bc in tests
ErikQQY Aug 16, 2024
c9c5877
Fix the right usage of bc
ErikQQY Aug 16, 2024
f9d7d33
Fix initial guess in manifold test
ErikQQY Aug 16, 2024
293ae46
Update src/default_nlsolve.jl
ChrisRackauckas Aug 16, 2024
603a4d5
Use correct bc in manifold tests
ErikQQY Aug 16, 2024
4999c92
Fix deprecated LineSeach binding
ErikQQY Aug 17, 2024
23902ec
Update src/default_nlsolve.jl
ChrisRackauckas Aug 17, 2024
43f24ff
Update src/default_nlsolve.jl
ChrisRackauckas Aug 17, 2024
8cc7ad4
Update src/default_nlsolve.jl
ChrisRackauckas Aug 17, 2024
a8735b0
Update src/default_nlsolve.jl
ChrisRackauckas Aug 17, 2024
30da842
Update default_nlsolve.jl
ChrisRackauckas Aug 17, 2024
dfe835f
Update src/default_nlsolve.jl
ChrisRackauckas Aug 17, 2024
1303c6b
Remove Aqua test_ambiguities
ErikQQY Aug 17, 2024
9f89f00
Merge branch 'master' into at/use-reusable-workflows
ErikQQY Aug 17, 2024
ba4a3a5
Use the correct bc in bigfloat test case
ErikQQY Aug 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions .github/workflows/CI.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
40 changes: 40 additions & 0 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion src/adaptivity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/default_nlsolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
# convert every vector of vector to AbstractVectorOfArray, especially if them come from get_tmp of PreallocationTools.jl
2 changes: 1 addition & 1 deletion test/mirk/mirk_basic_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/mirk/nlls_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/mirk/vectorofvector_initials_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/misc/bigfloat_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 2 additions & 7 deletions test/misc/manifolds_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/misc/non_vector_input_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/misc/type_stability_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading