From 18354b00d1796af86f760943476471d4afe67f56 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 1 Dec 2024 06:57:11 -0500 Subject: [PATCH] Format .jl files [skip ci] (#440) Co-authored-by: jverzani <421708+jverzani@users.noreply.github.com> --- src/Bracketing/alefeld_potra_shi.jl | 1 - src/Bracketing/itp.jl | 2 -- src/convergence.jl | 8 +++++--- test/test_composable.jl | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Bracketing/alefeld_potra_shi.jl b/src/Bracketing/alefeld_potra_shi.jl index 0e5f49c..ffc1d6b 100644 --- a/src/Bracketing/alefeld_potra_shi.jl +++ b/src/Bracketing/alefeld_potra_shi.jl @@ -96,7 +96,6 @@ function init_options( Roots.FExactOptions(δₐ, δᵣ, maxiters, strict) end - # fn calls w/in calculateΔ # 1 is default, but this should be adjusted for different methods fncalls_per_step(::AbstractAlefeldPotraShi) = 1 diff --git a/src/Bracketing/itp.jl b/src/Bracketing/itp.jl index 550e9e6..4cadce7 100644 --- a/src/Bracketing/itp.jl +++ b/src/Bracketing/itp.jl @@ -72,7 +72,6 @@ function init_options( state::AbstractUnivariateZeroState{T,S}; kwargs..., ) where {T,S} - d = kwargs defs = default_tolerances(M, T, S) δₐ = get(d, :xatol, get(d, :xabstol, defs[1])) @@ -85,7 +84,6 @@ function init_options( return UnivariateZeroOptions(δₐ, δᵣ, ϵₐ, ϵᵣ, maxiters, strict) end - function update_state(M::ITP, F, o::ITPState{T,S,R}, options, l=NullTracks()) where {T,S,R} a, b = o.xn0, o.xn1 fa, fb = o.fxn0, o.fxn1 diff --git a/src/convergence.jl b/src/convergence.jl index b267555..28a3f94 100644 --- a/src/convergence.jl +++ b/src/convergence.jl @@ -49,7 +49,11 @@ function init_options(M, T=Float64, S=Float64; kwargs...) maxiters = get(d, :maxiters, get(d, :maxevals, get(d, :maxsteps, defs[5]))) strict = get(d, :strict, defs[6]) - iszero(δₐ) && iszero(δᵣ) && iszero(ϵₐ) && iszero(ϵᵣ) && return ExactOptions(maxiters, strict) + iszero(δₐ) && + iszero(δᵣ) && + iszero(ϵₐ) && + iszero(ϵᵣ) && + return ExactOptions(maxiters, strict) iszero(δₐ) && iszero(δᵣ) && return XExactOptions(ϵₐ, ϵᵣ, maxiters, strict) iszero(ϵₐ) && iszero(ϵᵣ) && return FExactOptions(δₐ, δᵣ, maxiters, strict) @@ -61,7 +65,6 @@ function init_options( state::AbstractUnivariateZeroState{T,S}; kwargs..., ) where {T,S} - d = kwargs defs = default_tolerances(M, T, S) δₐ = get(d, :xatol, get(d, :xabstol, defs[1])) @@ -74,7 +77,6 @@ function init_options( return UnivariateZeroOptions(δₐ, δᵣ, ϵₐ, ϵᵣ, maxiters, strict) end - ## -------------------------------------------------- """ diff --git a/test/test_composable.jl b/test/test_composable.jl index 3aca6bc..854c08c 100644 --- a/test/test_composable.jl +++ b/test/test_composable.jl @@ -24,7 +24,7 @@ using ForwardDiff @testset "find zero(s) with Unitful" begin s = u"s" m = u"m" - g = (9 + 8//10) * m / s^2 + g = (9 + 8 // 10) * m / s^2 v0 = 10m / s y0 = 16m y(t) = -g * t^2 + v0 * t + y0 @@ -47,7 +47,7 @@ using ForwardDiff xzs1 = find_zeros(x -> cos(x / 1u"m"), -1.6u"m", 2u"m") @test length(xzs1) == 2 && maximum(xzs1) ≈ 1.5707963267948966 * u"m" - FX = ZeroProblem(y, (0f0s, 2f0s)) + FX = ZeroProblem(y, (0.0f0s, 2.0f0s)) prob = Roots.init(FX, Roots.AlefeldPotraShi()) @test Roots.is_small_Δx(prob.M, prob.state, prob.options) isa Bool # does not throw end