Skip to content

Commit 0585883

Browse files
authored
Remove two uses of fixorder in evaluate methods for recursive Taylor1 (#360)
* Remove two uses of `fixorder` in `evaluate` methods, involving recursive Taylor1 * Updates in github actions (ci and docs) * Fix error in ci * Add evaluation tests * Bump patch version
1 parent 466845e commit 0585883

File tree

5 files changed

+29
-14
lines changed

5 files changed

+29
-14
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,21 @@ on:
1313
tags: '*'
1414

1515
jobs:
16+
pre_job:
17+
runs-on: ubuntu-latest
18+
# Map a step output to a job output
19+
outputs:
20+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
21+
steps:
22+
- id: skip_check
23+
uses: fkirc/skip-duplicate-actions@v5
24+
with:
25+
concurrent_skipping: 'same_content_newer'
1626
test:
1727
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-threads }} thread(s) - ${{ github.event_name }}
28+
needs: pre_job
29+
if: needs.pre_job.outputs.should_skip != 'true'
1830
runs-on: ${{ matrix.os }}
19-
if: "!contains(github.event.head_commit.message, 'skip ci')"
2031
env:
2132
JULIA_NUM_THREADS: ${{ matrix.julia-threads }}
2233
strategy:
@@ -38,13 +49,13 @@ jobs:
3849
julia-threads: '2'
3950

4051
steps:
41-
- uses: actions/checkout@v3
52+
- uses: actions/checkout@v4
4253
- name: "Set up Julia"
43-
uses: julia-actions/setup-julia@v1
54+
uses: julia-actions/setup-julia@v2
4455
with:
4556
version: ${{ matrix.julia-version }}
4657
arch: ${{ matrix.julia-arch }}
47-
- uses: actions/cache@v3
58+
- uses: actions/cache@v4
4859
env:
4960
cache-name: cache-artifacts
5061
with:

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414
build:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1818
- uses: julia-actions/setup-julia@latest
1919
with:
2020
version: '1'
2121
- name: Install dependencies
22-
run: julia --project=docs/ -e 'using Pkg;
22+
run: julia --project=docs/ -e 'using Pkg;
2323
Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
2424
- name: Build and deploy
2525
env:

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TaylorSeries"
22
uuid = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"
33
repo = "https://github.com/JuliaDiff/TaylorSeries.jl.git"
4-
version = "0.17.7"
4+
version = "0.17.8"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/evaluate.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,13 @@ function evaluate(a::Taylor1{T}, x::Taylor1{T}) where {T<:Number}
6767
end
6868

6969
function evaluate(a::Taylor1{Taylor1{T}}, x::Taylor1{T}) where {T<:NumberNotSeriesN}
70-
if a.order != x.order
71-
a, x = fixorder(a, x)
72-
end
7370
@inbounds suma = a[end]*zero(x)
7471
aux = zero(suma)
7572
_horner!(suma, a, x, aux)
7673
return suma
7774
end
7875

7976
function evaluate(a::Taylor1{T}, x::Taylor1{Taylor1{T}}) where {T<:NumberNotSeriesN}
80-
if a.order != x.order
81-
a, x = fixorder(a, x)
82-
end
8377
@inbounds suma = a[end]*zero(x)
8478
aux = zero(suma)
8579
_horner!(suma, a, x, aux)
@@ -472,7 +466,12 @@ function evaluate!(x::AbstractArray{Taylor1{T}}, δt::S,
472466
x0 .= evaluate.( x, δt )
473467
return nothing
474468
end
475-
469+
# function evaluate!(x::AbstractArray{Taylor1{Taylor1{T}}}, δt::Taylor1{T},
470+
# x0::AbstractArray{Taylor1{T}}) where {T<:Number}
471+
# x0 .= evaluate.( x, Ref(δt) )
472+
# # x0 .= evaluate.( x, δt )
473+
# return nothing
474+
# end
476475

477476
## In place evaluation of multivariable arrays
478477
function evaluate!(x::AbstractArray{TaylorN{T}}, δx::Array{T,1},

test/mixtures.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,4 +569,9 @@ end
569569
@test get_order(tti[0]) == get_order(ti)-1
570570
@test isapprox(abs2(exp(im*to)), one(to))
571571
@test isapprox(abs(exp(im*to)), one(to))
572+
to = Taylor1([1/(1+ti), one(ti)], 9)
573+
@test to(1.0) == 1 + 1/(1+ti)
574+
@test cos(to)(0.0) == cos(to[0])
575+
@test to(ti) == to[0] + ti
576+
@test evaluate(to*ti, ti) == to[0]*ti + ti^2
572577
end

0 commit comments

Comments
 (0)