diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ff336f6..e54caf7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,7 +19,7 @@ jobs: - '1' - '1.6' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index b166528..7b4b9ab 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -12,7 +12,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@latest with: version: '1' diff --git a/.github/workflows/Downstream.yml b/.github/workflows/Downstream.yml index 02de231..3f304f9 100644 --- a/.github/workflows/Downstream.yml +++ b/.github/workflows/Downstream.yml @@ -19,14 +19,14 @@ jobs: package: - {user: SciML, repo: OrdinaryDiffEq.jl, group: InterfaceII} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.julia-version }} arch: x64 - uses: julia-actions/julia-buildpkg@latest - name: Clone Downstream - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ matrix.package.user }}/${{ matrix.package.repo }} path: downstream diff --git a/Project.toml b/Project.toml index 2450001..93b0120 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "FiniteDiff" uuid = "6a86dc24-6348-571c-b903-95158fe2bd41" -version = "2.21.1" +version = "2.22.0" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" diff --git a/src/epsilons.jl b/src/epsilons.jl index 6be8c8c..5e62c72 100644 --- a/src/epsilons.jl +++ b/src/epsilons.jl @@ -22,7 +22,7 @@ end return eps(T) end -default_relstep(v::Type, T) = default_relstep(v(), T) +default_relstep(::Type{V}, T) where V = default_relstep(V(), T) @inline function default_relstep(::Val{fdtype}, ::Type{T}) where {fdtype,T<:Number} if fdtype==:forward return sqrt(eps(real(T))) diff --git a/src/jacobians.jl b/src/jacobians.jl index be916cc..70509d6 100644 --- a/src/jacobians.jl +++ b/src/jacobians.jl @@ -194,7 +194,7 @@ function finite_difference_jacobian( x_save = ArrayInterface.allowed_getindex(vecx, i) epsilon = compute_epsilon(Val(:forward), x_save, relstep, absstep, dir) _vecx1 = setindex(vecx, x_save+epsilon, i) - _x1 = reshape(_vecx1, axes(x)) + _x1 = ArrayInterface.restructure(x,_vecx1) vecfx1 = _vec(f(_x1)) dx = (vecfx1-vecfx) / epsilon return dx