Skip to content

Commit ad5ef4e

Browse files
authored
Support Interpolations v0.16 (#173)
* Support Interpolations v0.16 * Give CompatHelper explicit permissions * Add dependabot Keep actions up to date * Update docs.yml * Fix autorange.jl doctests * Change jldoctest blocks to julia blocks I don't see output that the jldoctest block is supposed to test against, so maybe these should just be julia blocks? * Fix jldoctests in warp.jl * Fix doctest in warp.jl Axes expression was wrong * Update UnitTest.yml actions
1 parent 3be40ea commit ad5ef4e

File tree

8 files changed

+54
-62
lines changed

8 files changed

+54
-62
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/CompatHelper.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
- cron: '00 00 * * *'
66
workflow_dispatch:
77

8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
812
jobs:
913
CompatHelper:
1014
runs-on: ${{ matrix.os }}

.github/workflows/UnitTest.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,18 @@ jobs:
2727

2828

2929
steps:
30-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v4
3131
- name: "Set up Julia"
32-
uses: julia-actions/setup-julia@v1
32+
uses: julia-actions/setup-julia@v2
3333
with:
3434
version: ${{ matrix.julia-version }}
3535
arch: ${{ matrix.arch }}
36-
37-
- name: Cache artifacts
38-
uses: actions/cache@v1
39-
env:
40-
cache-name: cache-artifacts
41-
with:
42-
path: ~/.julia/artifacts
43-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
44-
restore-keys: |
45-
${{ runner.os }}-test-${{ env.cache-name }}-
46-
${{ runner.os }}-test-
47-
${{ runner.os }}-
36+
- uses: julia-actions/cache@v2
37+
- uses: julia-actions/julia-buildpkg@v1
4838
- name: "Unit Test"
49-
uses: julia-actions/julia-runtest@master
39+
uses: julia-actions/julia-runtest@v1
5040

5141
- uses: julia-actions/julia-processcoverage@v1
52-
- uses: codecov/codecov-action@v1
42+
- uses: codecov/codecov-action@v5
5343
with:
5444
file: lcov.info

.github/workflows/docs.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,11 @@ jobs:
1818
julia-version: [1]
1919
os: [ubuntu-latest]
2020
steps:
21-
- uses: actions/checkout@v2
22-
- uses: julia-actions/setup-julia@latest
21+
- uses: actions/checkout@v4
22+
- uses: julia-actions/setup-julia@v2
2323
with:
2424
version: ${{ matrix.julia-version }}
25-
- name: Cache artifacts
26-
uses: actions/cache@v1
27-
env:
28-
cache-name: cache-artifacts
29-
with:
30-
path: ~/.julia/artifacts
31-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
32-
restore-keys: |
33-
${{ runner.os }}-test-${{ env.cache-name }}-
34-
${{ runner.os }}-test-
35-
${{ runner.os }}-
25+
- uses: julia-actions/cache@v2
3626
- name: Install dependencies
3727
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
3828
- name: Build and deploy

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ AxisAlgorithms = "0.3, 1.0"
1717
CoordinateTransformations = "0.5, 0.6"
1818
ImageBase = "0.1.1"
1919
ImageCore = "0.9, 0.10"
20-
Interpolations = "0.13.4, 0.14, 0.15"
20+
Interpolations = "0.13.4, 0.14, 0.15, 0.16"
2121
OffsetArrays = "0.10, 0.11, 1.0.1"
2222
Rotations = "0.12, 0.13, 1.0"
2323
StaticArrays = "0.10, 0.11, 0.12, 1.0"

src/ImageTransformations.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ There are in-place version of many of the functions, e.g., `imresize!` etc.
1414
1515
Resize example:
1616
17-
```jldoctest
17+
```julia
1818
using ImageTransformations, TestImages
1919
2020
img = testimage("mandrill")
@@ -25,7 +25,7 @@ img_medium = imresize(img_small, size(img_small).*2)
2525
2626
Warping example:
2727
28-
```jldoctest
28+
```julia
2929
using ImageTransformations, TestImages, CoordinateTransformations, Rotations
3030
3131
img = testimage("camera");

src/autorange.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ preserves all information from `A` after applying `tform`.
99
For transformation that preserves the array size, `autorange` is equivalent to `axes(A)`.
1010
1111
```jldoctest; setup=:(using ImageTransformations: autorange; using CoordinateTransformations, Rotations, ImageTransformations)
12-
A = rand(5, 5)
13-
tform = IdentityTransformation()
14-
autorange(A, tform) == axes(A)
12+
julia> A = rand(5, 5);
1513
16-
# output
14+
julia> tform = IdentityTransformation();
15+
16+
julia> autorange(A, tform) == axes(A)
1717
true
1818
```
1919
2020
The diffrence shows up when `tform` enlarges the input array `A`. In the following example, we need
2121
at least `(0:6, 0:6)` as the range indices to get all data of `A`:
2222
2323
```jldoctest; setup=:(using ImageTransformations: autorange; using CoordinateTransformations, Rotations, ImageTransformations)
24-
A = rand(5, 5)
25-
tform = recenter(RotMatrix(pi/8), center(A))
26-
autorange(A, tform)
24+
julia> A = rand(5, 5);
25+
26+
julia> tform = recenter(RotMatrix(pi/8), center(A));
2727
28-
# output
28+
julia> autorange(A, tform)
2929
(0:6, 0:6)
3030
```
3131

src/warp.jl

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,19 @@ Also, `fillvalue` can be extrapolation schemes: `Flat()`, `Periodic()` and `Refl
9393
way to understand these schemes is perhaps try it with small example:
9494
9595
```jldoctest
96-
using ImageTransformations, TestImages, Interpolations
97-
using OffsetArrays: IdOffsetRange
96+
julia> using ImageTransformations, TestImages, Interpolations
9897
99-
img = testimage("lighthouse")
98+
julia> using OffsetArrays: IdOffsetRange
10099
101-
imgr = imrotate(img, π/4; fillvalue=Flat()) # zero extrapolation slope
102-
imgr = imrotate(img, π/4; fillvalue=Periodic()) # periodic boundary
103-
imgr = imrotate(img, π/4; fillvalue=Reflect()) # mirror boundary
100+
julia> img = testimage("lighthouse");
104101
105-
axes(imgr)
102+
julia> imgr = imrotate(img, π/4; fillvalue=Flat()); # zero extrapolation slope
106103
107-
# output
104+
julia> imgr = imrotate(img, π/4; fillvalue=Periodic()); # periodic boundary
108105
106+
julia> imgr = imrotate(img, π/4; fillvalue=Reflect()); # mirror boundary
107+
108+
julia> axes(imgr)
109109
(IdOffsetRange(values=-196:709, indices=-196:709), IdOffsetRange(values=-68:837, indices=-68:837))
110110
```
111111
@@ -116,16 +116,15 @@ axes(imgr)
116116
pixels in `img`.
117117
118118
```jldoctest
119-
using ImageTransformations, TestImages, Interpolations
119+
julia> using ImageTransformations, TestImages, Interpolations
120+
121+
julia> img = testimage("lighthouse");
120122
121-
img = testimage("lighthouse")
122-
imgr = imrotate(img, π/4)
123-
imgr_cropped = imrotate(img, π/4, axes(img))
123+
julia> imgr = imrotate(img, π/4);
124124
125-
# No need to manually calculate the offsets
126-
imgr[axes(img)...] == imgr_cropped
125+
julia> imgr_cropped = imrotate(img, π/4, axes(img));
127126
128-
# output
127+
julia> imgr[axes(img)...] == imgr_cropped # No need to manually calculate the offsets
129128
true
130129
```
131130
@@ -142,17 +141,20 @@ true
142141
Rotate around the center of `img`:
143142
144143
```jldoctest
145-
using ImageTransformations, CoordinateTransformations, Rotations, TestImages, OffsetArrays
146-
using OffsetArrays: IdOffsetRange
147-
img = testimage("lighthouse") # axes (1:512, 1:768)
144+
julia> using ImageTransformations, CoordinateTransformations, Rotations, TestImages, OffsetArrays
145+
146+
julia> using OffsetArrays: IdOffsetRange
147+
148+
julia> img = testimage("lighthouse");
148149
149-
tfm = recenter(RotMatrix(-pi/4), center(img))
150-
imgw = warp(img, tfm)
150+
julia> axes(img)
151+
(Base.OneTo(512), Base.OneTo(768))
151152
152-
axes(imgw)
153+
julia> tfm = recenter(RotMatrix(-pi/4), center(img));
153154
154-
# output
155+
julia> imgw = warp(img, tfm);
155156
157+
julia> axes(imgw)
156158
(IdOffsetRange(values=-196:709, indices=-196:709), IdOffsetRange(values=-68:837, indices=-68:837))
157159
```
158160

0 commit comments

Comments
 (0)