Skip to content

Commit

Permalink
Typos (#405)
Browse files Browse the repository at this point in the history
* bump SymPy

* adjust p.toml

* readjust

* add spell check to CI

* format adjustments

* fix typos
  • Loading branch information
jverzani authored Nov 7, 2023
1 parent 65ffb4d commit 1c5df7b
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 22 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Spell Check

on: [pull_request]

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
5 changes: 3 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ SymPyPythonCall = "bc8888f7-b21e-4b7c-a06a-5d9c9496438c"
ChainRulesCore = "1"
CommonSolve = "0.1, 0.2"
ForwardDiff = "0.10"
SymPy = "1"
SymPyPythonCall = "0.1,1"
SymPy = "1,2"
SymPyPythonCall = "0.1, 0.2, 1"
Setfield = "0.7, 0.8, 1"
Printf = "1"
julia = "1.0"


Expand Down
2 changes: 1 addition & 1 deletion docs/src/roots.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ julia> above = accumulate((x,y) -> nextfloat(x), 1:10, init=1/3);
julia> below = accumulate((x,y) -> prevfloat(x), 1:10, init=1/3);
julia> ns = sort([below...,1/3, above...]); # floating point numbers aroudn 1/3
julia> ns = sort([below...,1/3, above...]); # floating point numbers around 1/3
julia> maximum(abs.(f.(ns) - f1.(ns))) < 1e-14
true
Expand Down
2 changes: 1 addition & 1 deletion src/Bracketing/alefeld_potra_shi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Originally by John Travers.
"""
const AlefeldPotraShi = A2425{2}

# Algorith 5.7 is parameterized by K
# Algorithm 5.7 is parameterized by K
# 4.1 -> K=1; 4.2 -> K=2
struct A57{K} <: AbstractAlefeldPotraShi end
fncalls_per_step(::A57{K}) where {K} = K - 1
Expand Down
4 changes: 2 additions & 2 deletions src/Bracketing/bisection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ function solve!(
val, stopped = :not_converged, false
ctr = 1
log_step(l, M, state; init=true)
T,S = TS(state)
T, S = TS(state)
while !stopped
a::T, b::T = state.xn0, state.xn1
a::T, b::T = state.xn0, state.xn1
fa::S, fb::S = state.fxn0, state.fxn1

## assess_convergence
Expand Down
2 changes: 1 addition & 1 deletion src/Derivative/lith.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function evalf(F::Callable_Function{S,T,𝑭,P}, x) where {N,S<:Val{N},T<:Val{tr
end

#specializations for N = 1,2,3,4,5,6
## lmm(::Roots.LithBoonkkampIJzerman{1, D}) is defined up unitl D = 6, so specialize those
## lmm(::Roots.LithBoonkkampIJzerman{1, D}) is defined up until D = 6, so specialize those

function evalf(F::Callable_Function{S,T,𝑭,P}, x) where {S<:Val{1},T<:Val{false},𝑭,P}
F(x)
Expand Down
2 changes: 1 addition & 1 deletion src/DerivativeFree/esser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ step when `|fx|` is considered too large.
Esser, H. Computing (1975) 14: 367. DOI: [10.1007/BF02253547](https://doi.org/10.1007/BF02253547)
Eine stets quadratisch konvergente Modifikation des Steffensen-Verfahrens
Eine stets quadratisch konvergente Modification des Steffensen-Verfahrens
## Examples
Expand Down
3 changes: 1 addition & 2 deletions src/alternative_interfaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ derivatives, respectively.
Keyword arguments are passed to `find_zero` using the `Roots.Halley()` method.
"""
=#
halley(f, fp, fpp, x0; kwargs...) = find_zero((f, fp, fpp), x0, Halley(); kwargs...)
Expand Down Expand Up @@ -253,7 +252,7 @@ end
Searches for all zeros of `f` within an interval `(a,b)`. Assume neither `a` or `b` is a zero.
Compatability interface for [`find_zeros`](@ref).
Compatibility interface for [`find_zeros`](@ref).
"""
function fzeros(f, a::Number, b::Number; kwargs...)
find_zeros(FnWrapper(f), float(a), float(b); kwargs...)
Expand Down
3 changes: 1 addition & 2 deletions src/simple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,12 @@ end
"""
Roots.a42(f, ab; atol=nothing, rtol=nothing, λ=0.7, μ = 0.5)
Direct implemenation of Alefeld, Potra, and Shi's Algorithm 4.2. See also [`A42()`](@ref).
Direct implementation of Alefeld, Potra, and Shi's Algorithm 4.2. See also [`A42()`](@ref).
* `f`: function to find zero of. (If `f` is 4-times continuously differentiable, convergence to a simple root will be like ``(2 + 7^{1/2})^{1/3} = 1.6686...``
* `ab`: a *bracketing interval
* `atol`, `rtol`: optional tolerances. These are `0` and `eps` respectively by default.
Not exported
"""
=#
Expand Down
2 changes: 1 addition & 1 deletion src/state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct UnivariateZeroState{T,S} <: AbstractUnivariateZeroState{T,S}
fxn0::S
end

TS(::AbstractUnivariateZeroState{T,S}) where {T,S} = T,S
TS(::AbstractUnivariateZeroState{T,S}) where {T,S} = T, S

# simple helper to set main properties of a state object
function _set(state, xf1)
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ include("./test_composable.jl")
VERSION >= v"1.6.0" && include("./test_allocations.jl")
VERSION >= v"1.9.0" && include("./test_extensions.jl")


#include("./runbenchmarks.jl")
#include("./test_derivative_free_interactive.jl")

Expand Down
12 changes: 6 additions & 6 deletions test/test_extensions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,26 @@ end
using ForwardDiff
@testset "ForwardDiff" begin
f = (x, p) -> x^2 - p
Z = ZeroProblem(f, (0, 1000))
Z = ZeroProblem(f, (0, 1000))
F = p -> solve(Z, Roots.Bisection(), p)
for p (3,5,7,11)
for p (3, 5, 7, 11)
@test F(p) sqrt(p)
@test ForwardDiff.derivative(F, p) 1 / (2sqrt(p))
end

# Hessian is *broken*
f = (x, p) -> x^2 - sum(p.^2)
f = (x, p) -> x^2 - sum(p .^ 2)
Z = ZeroProblem(f, (0, 1000))
F = p -> solve(Z, Roots.Bisection(), p)
Z = ZeroProblem(f, (0, 1000))
F = p -> solve(Z, Roots.Bisection(), p)
F = p -> solve(Z, Roots.Bisection(), p)
hess(f, p) = ForwardDiff.jacobian(p -> ForwardDiff.gradient(F, p), p)
for p ([1,2], [1,3], [1,4])
@test F(p) sqrt(sum(p.^2))
@test F(p) sqrt(sum(p .^ 2))
@test_throws DimensionMismatch ForwardDiff.hessian(F, p)
a, b = p
n = sqrt(a^2 + b^2)^3
@test hess(F, p) [b^2 -a*b; -a*b a^2]/n
@test hess(F, p) [b^2 -a*b; -a*b a^2] / n
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/test_find_zero.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct Order3_Test <: Roots.AbstractSecantMethod end
h(x) = x < 2000 ? -1000 : -1000 + 0.1 * (x - 2000)
a, b, xᵅ = 0, 20_000, 12_000
for M bracketing_meths
@test find_zero(h, (a,b), M) xᵅ
@test find_zero(h, (a, b), M) xᵅ
end

end
Expand Down Expand Up @@ -486,7 +486,7 @@ struct _SampleCallableObject end
end
end

@testset "function evalutions" begin
@testset "function evaluations" begin
function wrapper(f)
cnt = 0
x -> begin
Expand Down

2 comments on commit 1c5df7b

@jverzani
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/94920

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.0.21 -m "<description of version>" 1c5df7bf374d71cdceea24ee43a4c6fbf97fc1ed
git push origin v2.0.21

Please sign in to comment.