Skip to content

Commit edff0d9

Browse files
authored
Move out forwardrecurrence/clenshaw (#249)
* Move out forwardrecurrence/clenshaw * move tests * use RecurrenceRelationships.jl * Create downstream.yml * Update FastTransforms.jl * Update FastTransforms.jl * disable macos tests * Update ci.yml * Update ci.yml * RecurrenceRelationships v0.1
1 parent b493372 commit edff0d9

File tree

8 files changed

+93
-375
lines changed

8 files changed

+93
-375
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
version:
13-
- '1.7'
13+
- 'lts'
1414
- '1'
1515
os:
1616
- ubuntu-latest
17-
- macOS-latest
17+
# - macOS-latest
1818
arch:
1919
- x86
2020
- x64
2121
exclude:
2222
- os: macOS-latest
2323
arch: x86
2424
steps:
25-
- uses: actions/checkout@v3
26-
- uses: julia-actions/setup-julia@v1
25+
- uses: actions/checkout@v4
26+
- uses: julia-actions/setup-julia@v2
2727
with:
2828
version: ${{ matrix.version }}
2929
arch: ${{ matrix.arch }}
@@ -41,6 +41,7 @@ jobs:
4141
- uses: julia-actions/julia-buildpkg@latest
4242
- uses: julia-actions/julia-runtest@latest
4343
- uses: julia-actions/julia-processcoverage@v1
44-
- uses: codecov/codecov-action@v3
44+
- uses: codecov/codecov-action@v4
4545
with:
46+
token: ${{ secrets.CODECOV_TOKEN }}
4647
file: lcov.info

.github/workflows/downstream.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: IntegrationTest
2+
on:
3+
push:
4+
branches: [master]
5+
tags: [v*]
6+
paths-ignore:
7+
- 'LICENSE'
8+
- 'README.md'
9+
- '.github/workflows/TagBot.yml'
10+
pull_request:
11+
paths-ignore:
12+
- 'LICENSE'
13+
- 'README.md'
14+
- '.github/workflows/TagBot.yml'
15+
16+
concurrency:
17+
group: build-${{ github.event.pull_request.number || github.ref }}-${{ github.workflow }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
pre_job:
22+
# continue-on-error: true # Uncomment once integration is finished
23+
runs-on: ubuntu-latest
24+
# Map a step output to a job output
25+
outputs:
26+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
27+
steps:
28+
- id: skip_check
29+
uses: fkirc/skip-duplicate-actions@v5
30+
test:
31+
needs: pre_job
32+
if: needs.pre_job.outputs.should_skip != 'true'
33+
name: ${{ matrix.package.group }}/${{ matrix.package.repo }}/${{ matrix.julia-version }}
34+
runs-on: ${{ matrix.os }}
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
julia-version: ['1']
39+
os: [ubuntu-latest]
40+
package:
41+
- {repo: ClassicalOrthogonalPolynomials.jl, group: JuliaApproximation}
42+
- {repo: MultivariateOrthogonalPolynomials.jl, group: JuliaApproximation}
43+
- {repo: ApproxFun.jl, group: JuliaApproximation}
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: julia-actions/setup-julia@v2
48+
with:
49+
version: ${{ matrix.julia-version }}
50+
arch: x64
51+
- uses: julia-actions/julia-buildpkg@latest
52+
- name: Clone Downstream
53+
uses: actions/checkout@v4
54+
with:
55+
repository: ${{ matrix.package.group }}/${{ matrix.package.repo }}
56+
path: downstream
57+
- name: Load this and run the downstream tests
58+
shell: julia --color=yes --project=downstream {0}
59+
run: |
60+
using Pkg
61+
try
62+
# force it to use this PR's version of the package
63+
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
64+
Pkg.update()
65+
Pkg.test(; coverage = true) # resolver may fail with test time deps
66+
catch err
67+
err isa Pkg.Resolve.ResolverError || rethrow()
68+
# If we can't resolve that means this is incompatible by SemVer and this is fine
69+
# It means we marked this as a breaking change, so we don't need to worry about
70+
# Mistakenly introducing a breaking change, as we have intentionally made one
71+
@info "Not compatible with this release. No problem." exception=err
72+
exit(0) # Exit immediately, as a success
73+
end
74+
- uses: julia-actions/julia-processcoverage@v1
75+
- uses: codecov/codecov-action@v4
76+
with:
77+
token: ${{ secrets.CODECOV_TOKEN }}
78+
files: lcov.info

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
1212
GenericFFT = "a8297547-1b15-4a5a-a998-a2ac5f1cef28"
1313
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
1414
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
15+
RecurrenceRelationships = "807425ed-42ea-44d6-a357-6771516d7b2c"
1516
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1617
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
1718
ToeplitzMatrices = "c751599d-da0a-543b-9d20-d0a503d91d24"
@@ -24,12 +25,12 @@ FastGaussQuadrature = "0.4, 0.5, 1"
2425
FastTransforms_jll = "0.6.2"
2526
FillArrays = "0.9, 0.10, 0.11, 0.12, 0.13, 1"
2627
GenericFFT = "0.1"
28+
RecurrenceRelationships = "0.1"
2729
Reexport = "0.2, 1.0"
2830
SpecialFunctions = "0.10, 1, 2"
2931
ToeplitzMatrices = "0.7.1, 0.8"
3032
julia = "1.7"
3133

32-
3334
[extras]
3435
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
3536
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/FastTransforms.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module FastTransforms
22

33
using BandedMatrices, FastGaussQuadrature, FillArrays, LinearAlgebra,
4-
Reexport, SpecialFunctions, ToeplitzMatrices
4+
Reexport, SpecialFunctions, ToeplitzMatrices, RecurrenceRelationships
55

66
@reexport using AbstractFFTs
77
@reexport using FFTW
@@ -32,6 +32,12 @@ import LinearAlgebra: mul!, lmul!, ldiv!, cholesky
3232

3333
import GenericFFT: interlace # imported in downstream packages
3434

35+
import RecurrenceRelationships: clenshaw!, check_clenshaw_recurrences
36+
37+
const _forwardrecurrence! = RecurrenceRelationships.forwardrecurrence!
38+
const _clenshaw_next = RecurrenceRelationships.clenshaw_next
39+
const _forwardrecurrence_next = RecurrenceRelationships.forwardrecurrence_next
40+
3541
export leg2cheb, cheb2leg, ultra2ultra, jac2jac,
3642
lag2lag, jac2ultra, ultra2jac, jac2cheb,
3743
cheb2jac, ultra2cheb, cheb2ultra, associatedjac2jac,
@@ -53,7 +59,6 @@ export plan_leg2cheb, plan_cheb2leg, plan_ultra2ultra, plan_jac2jac,
5359
plan_tet2cheb, plan_tet_synthesis, plan_tet_analysis,
5460
plan_spinsph2fourier, plan_spinsph_synthesis, plan_spinsph_analysis
5561

56-
include("clenshaw.jl")
5762

5863
include("libfasttransforms.jl")
5964
include("elliptic.jl")

src/clenshaw.jl

Lines changed: 0 additions & 221 deletions
This file was deleted.

src/libfasttransforms.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ function horner!(c::StridedVector{Float32}, x::Vector{Float32}, f::Vector{Float3
6161
f
6262
end
6363

64-
function check_clenshaw_recurrences(N, A, B, C)
65-
if length(A) < N || length(B) < N || length(C) < N+1
66-
throw(ArgumentError("A, B must contain at least $N entries and C must contain at least $(N+1) entrie"))
67-
end
68-
end
69-
7064
function check_clenshaw_points(x, ϕ₀, f)
7165
length(x) == length(ϕ₀) == length(f) || throw(ArgumentError("Dimensions must match"))
7266
end

0 commit comments

Comments
 (0)