Skip to content

Commit 39b51aa

Browse files
authored
Standardize yml and LazyGrids compat v1 (#84)
* Standardize docs * Standardize yml * Compat LazyGrids v1 * Fix size * Compat for ImageGeoms !? * Compat ImageGeoms for docs/ too !?
1 parent 33181fe commit 39b51aa

File tree

9 files changed

+55
-22
lines changed

9 files changed

+55
-22
lines changed

.github/workflows/CompatHelper.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,23 @@ on:
44
schedule:
55
- cron: 0 0 * * 0 # weekly
66
workflow_dispatch:
7-
7+
permissions:
8+
contents: write
9+
pull-requests: write
810
jobs:
911
CompatHelper:
1012
runs-on: ubuntu-latest
1113
steps:
14+
- name: Check if Julia is already available in the PATH
15+
id: julia_in_path
16+
run: which julia
17+
continue-on-error: true
18+
- name: Install Julia, but only if it is not already available in the PATH
19+
uses: julia-actions/setup-julia@latest
20+
with:
21+
version: '1'
22+
# arch: ${{ runner.arch }}
23+
if: steps.julia_in_path.outcome != 'success'
1224
- name: "Add the General registry via Git"
1325
run: |
1426
import Pkg
@@ -31,3 +43,6 @@ jobs:
3143
env:
3244
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3345
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
46+
47+
# based on:
48+
# https://github.com/JuliaRegistries/CompatHelper.jl

.github/workflows/SpellCheck.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Spell Check
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
typos-check:
7+
name: Spell Check with Typos
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Actions Repository
11+
uses: actions/checkout@v4
12+
- name: Check spelling
13+
uses: crate-ci/typos@master

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
99
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
1010

1111
[compat]
12-
LazyGrids = "0.5"
12+
LazyGrids = "0.5, 1"
1313
SpecialFunctions = "1.8, 2"
1414
julia = "1.10"

docs/Project.toml

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1111
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
1212

1313
[compat]
14+
ImageGeoms = "0.10"

docs/lit/examples/01-overview.jl

+10-10
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ pic1 = phantom(x, y, [ellipse1])
149149

150150
marker = :star
151151
p0 = jim(x, y, pic0, "Original ellipse";
152-
xlabel="x", ylabel="y", prompt=:false)
152+
xlabel="x", ylabel="y", size=(700,300), prompt=:false)
153153
x0,y0 = 7,0
154154
scatter!([x0], [y0], color=:blue; marker)
155155
point1 = [cos(ϕ1) -sin(ϕ1); sin(ϕ1) cos(ϕ1)] * [x0; y0] # rotate point
156156
x1,y1 = point1[1], point1[2]
157157
p1 = jim(x, y, pic1, "Rotated by ϕ = $ϕ1s";
158-
xlabel="x", ylabel="y", prompt=:false)
158+
xlabel="x", ylabel="y", size=(700,300), prompt=:false)
159159
scatter!([x1], [y1], color=:blue; marker)
160160
jim(p0, p1)
161161

@@ -221,15 +221,15 @@ pic1 = phantom(x, y, z, [ellipsoid1])
221221

222222
p0z = jim(x, y, pic0,
223223
"Original ellipsoid:\n(x,y) slice";
224-
xlabel="x", ylabel="y", prompt=:false)
224+
xlabel="x", ylabel="y", size=(700,300), prompt=:false)
225225
x0,y0 = 7,0
226226
scatter!([x0], [y0], color=:blue; marker)
227227
Rz(ϕ) = [cos(ϕ) -sin(ϕ) 0; sin(ϕ) cos(ϕ) 0; 0 0 1]
228228
point1 = Rz(ϕ1) * [x0; y0; 0] # rotate point
229229
x1,y1 = point1[1], point1[2]
230230
p1z = jim(x, y, pic1,
231231
"Rotated about z\nby ϕ = $ϕ1s\n(z out of 'board')";
232-
xlabel="x", ylabel="y", prompt=:false)
232+
xlabel="x", ylabel="y", size=(700,350), prompt=:false)
233233
scatter!([x1], [y1], color=:blue; marker)
234234
jim(p0z, p1z)
235235

@@ -285,15 +285,15 @@ pic1 = phantom(x, y, z, [ellipsoid1]); pic1 = selectdim(pic1, 2, 1)
285285

286286
p0y = jim(x, z, pic0,
287287
"Original ellipsoid:\n (x,z) slice";
288-
xlabel="x", ylabel="z", prompt=false)
288+
xlabel="x", ylabel="z", size=(700,350), prompt=false)
289289
x0,z0 = 7,0
290290
scatter!([x0], [z0], color=:green; marker)
291291
Ry(θ) = [cos(θ) 0 sin(θ); 0 1 0; -sin(θ) 0 cos(θ)]
292292
point1 = Ry(θ1) * [x0; 0; z0] # rotate point
293293
x1,z1 = point1[1], point1[3]
294294
p1y = jim(x, z, pic1,
295295
"Rotated about y\nby θ = $θ1s\n(y into 'board')";
296-
xlabel="x", ylabel="z", prompt=false)
296+
xlabel="x", ylabel="z", size=(700,350), prompt=false)
297297
scatter!([x1], [z1], color=:green; marker)
298298
jim(p0y, p1y)
299299

@@ -347,15 +347,15 @@ pic1 = phantom(x, y, z, [ellipsoid1]); pic1 = selectdim(pic1, 1, 1)
347347

348348
p0x = jim(y, z, pic0,
349349
"Original ellipsoid:\n (y,z) slice)";
350-
xlabel="y", ylabel="z", prompt=false)
350+
xlabel="y", ylabel="z", size=(700,350), prompt=false)
351351
y0,z0 = 3,0
352352
scatter!([y0], [z0], color=:red; marker)
353353
Rx(ψ) = [1 0 0 ; 0 cos(ψ) -sin(ψ); 0 sin(ψ) cos(ψ)]
354354
point1 = Rx(ψ1) * [0; y0; z0] # rotate point
355355
y1,z1 = point1[2], point1[3]
356356
p1x = jim(y, z, pic1,
357357
"Rotated about x\nby ψ = $ψ1s\n(x out of 'board')";
358-
xlabel="y", ylabel="z", prompt=false)
358+
xlabel="y", ylabel="z", size=(700,350), prompt=false)
359359
scatter!([y1], [z1], color=:red; marker)
360360
jim(p0x, p1x)
361361

@@ -441,10 +441,10 @@ pic1 = phantom(x, y, z, [ellipsoid1])
441441

442442
p0a = jim(mid3(pic0),
443443
"Original ellipsoid\n(central slices)";
444-
xlabel="x", ylabel="y", prompt=:false)
444+
xlabel="x", ylabel="y", size=(700,320), prompt=:false)
445445
p1a = jim(mid3(pic1),
446446
"Rotated\nϕ = $ϕ1s, θ = $θ1s, ψ = $ψ1s";
447-
xlabel="x", ylabel="y", prompt=:false)
447+
xlabel="x", ylabel="y", size=(700,320), prompt=:false)
448448
jim(p0a, p1a)
449449

450450

docs/make.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ execute = isempty(ARGS) || ARGS[1] == "run"
22

33
org, reps = :JuliaImageRecon, :ImagePhantoms
44
eval(:(using $reps))
5-
using Documenter
6-
using Literate
5+
import Documenter
6+
import Literate
77

88
# https://juliadocs.github.io/Documenter.jl/stable/man/syntax/#@example-block
99
ENV["GKSwstype"] = "100"
@@ -23,7 +23,7 @@ binder_root_url =
2323

2424

2525
repo = eval(:($reps))
26-
DocMeta.setdocmeta!(repo, :DocTestSetup, :(using $reps); recursive=true)
26+
Documenter.DocMeta.setdocmeta!(repo, :DocTestSetup, :(using $reps); recursive=true)
2727

2828
# preprocessing
2929
inc1 = "include(\"../../../inc/reproduce.jl\")"
@@ -77,7 +77,7 @@ format = Documenter.HTML(;
7777
assets = ["assets/custom.css"],
7878
)
7979

80-
makedocs(;
80+
Documenter.makedocs(;
8181
modules = [repo],
8282
authors = "Jeff Fessler and contributors",
8383
sitename = "$repo.jl",
@@ -90,7 +90,7 @@ makedocs(;
9090
)
9191

9292
if isci
93-
deploydocs(;
93+
Documenter.deploydocs(;
9494
repo = "github.com/$base",
9595
devbranch = "main",
9696
devurl = "dev",

test/Project.toml

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
88
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
99

1010
[compat]
11+
ImageGeoms = "0.10"

test/helper.jl

+6-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ end
1010
=#
1111

1212

13-
# fft cannot handle units so this is a work-around
14-
function myfft(x::AbstractArray{<:Number})
15-
u = oneunit(eltype(x))
16-
return fftshift(fft(ifftshift(x) / u)) * u
13+
if !@isdefined myfft
14+
# fft cannot handle units so this is a work-around
15+
function myfft(x::AbstractArray{<:Number})
16+
u = oneunit(eltype(x))
17+
return fftshift(fft(ifftshift(x) / u)) * u
18+
end
1719
end

test/shape2.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ using ImageGeoms: ImageGeom, axesf
1313
using FFTW: fft, fftshift, ifftshift
1414
using Test: @test, @testset, @inferred
1515

16+
include("helper.jl") # myfft
1617

1718
@testset "circle-square" begin # special constructors
1819
args = [(1, 5.0f0), (1, 2, 3., 5.0f0), ((1, 2), 3., 5.0f0)]
@@ -178,7 +179,7 @@ end
178179

179180
@testset "spectrum" begin
180181
(M,N) = (2^10,2^10+5) # odd
181-
ig = ImageGeom( dims=(M,N), deltas=(0.02m, 0.025m), offsets=:dsp)
182+
ig = ImageGeom(; dims=(M,N), deltas=(0.02m, 0.025m), offsets=:dsp)
182183
ob = shape((2m, -3m), swidth, π/6, 1.0f0)
183184
zscale = 1 / (ob.value * IP.area(ob)) # normalize spectra by area
184185

0 commit comments

Comments
 (0)