Skip to content

Commit f8a2495

Browse files
adrhillclaude
andauthored
ci: standardize linting, import hygiene, and CI workflows (#20)
- Move the Aqua.jl and JET.jl checks into a self-contained `test/linting.jl` (JET runs on Julia v1.12+ only). - Add ExplicitImports.jl import-hygiene checks and drop the unused `Configurations` dependency. - Add a package-scoped `Aqua.test_ambiguities` check alongside `Aqua.test_all(…; ambiguities = false)`. - Standardize the GitHub Actions workflow: pin actions to their latest majors, restrict the Julia matrix to `1` and `lts`, and drop the `os`/`arch` matrix (single `ubuntu-latest` runner). - Add a pre-commit config (Runic, typos, whitespace/EOF hygiene) and apply the resulting fixes. --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 691d439 commit f8a2495

16 files changed

Lines changed: 94 additions & 50 deletions

.github/workflows/CI.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,31 @@ jobs:
2424
version:
2525
- 'lts'
2626
- '1'
27-
- 'pre'
2827
steps:
29-
- uses: actions/checkout@v5
30-
- uses: julia-actions/setup-julia@v2
28+
- uses: actions/checkout@v7
29+
- uses: julia-actions/setup-julia@v3
3130
with:
3231
version: ${{ matrix.version }}
33-
arch: x64
34-
- uses: julia-actions/cache@v2
32+
- uses: julia-actions/cache@v3
3533
- uses: julia-actions/julia-buildpkg@v1
3634
- uses: julia-actions/julia-runtest@v1
3735
- uses: julia-actions/julia-processcoverage@v1
38-
- uses: codecov/codecov-action@v5
36+
- uses: codecov/codecov-action@v7
3937
with:
4038
files: lcov.info
41-
39+
4240
docs:
4341
name: Documentation
4442
runs-on: ubuntu-latest
4543
permissions:
4644
contents: write
4745
statuses: write
4846
steps:
49-
- uses: actions/checkout@v5
50-
- uses: julia-actions/setup-julia@v2
47+
- uses: actions/checkout@v7
48+
- uses: julia-actions/setup-julia@v3
5149
with:
5250
version: '1'
53-
- uses: julia-actions/cache@v2
51+
- uses: julia-actions/cache@v3
5452
- name: Configure doc environment
5553
run: |
5654
julia --project=docs/ --color=yes -e '
@@ -72,11 +70,11 @@ jobs:
7270
name: Runic formatting
7371
runs-on: ubuntu-latest
7472
steps:
75-
- uses: actions/checkout@v4
76-
# - uses: julia-actions/setup-julia@v2
73+
- uses: actions/checkout@v7
74+
# - uses: julia-actions/setup-julia@v3
7775
# with:
7876
# version: '1'
79-
# - uses: julia-actions/cache@v2
77+
# - uses: julia-actions/cache@v3
8078
- uses: fredrikekre/runic-action@v1
8179
with:
82-
version: '1'
80+
version: '1'

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Manifest.toml
55
/test/Manifest.toml
66
/docs/Manifest.toml
77
/docs/build/
8-
settings.json
8+
settings.json

.pre-commit-config.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,26 @@ repos:
22
- repo: https://github.com/fredrikekre/runic-pre-commit
33
rev: v1.0.0
44
hooks:
5-
- id: runic
5+
- id: runic
6+
7+
- repo: https://github.com/crate-ci/typos
8+
rev: v1.48.0
9+
hooks:
10+
- id: typos
11+
# report and fail (no --write-changes, so no in-place edits);
12+
# --force-exclude makes staged files honor _typos.toml excludes
13+
args: [--force-exclude]
14+
15+
- repo: https://github.com/pre-commit/pre-commit-hooks
16+
rev: v6.0.0
17+
hooks:
18+
- id: trailing-whitespace
19+
# ReferenceTests golden files: trailing space and the missing
20+
# final newline are significant output, never "fix" them
21+
exclude: ^test/references/
22+
- id: end-of-file-fixer
23+
exclude: ^test/references/
24+
- id: check-merge-conflict
25+
- id: check-added-large-files
26+
- id: check-toml
27+
- id: check-yaml

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Version `v2.1.0`
44
* ![Feature][badge-feature] Support overlays over batches of images ([#17])
5-
* ![Maintenance][badge-maintenance] Test type inferrence with JET.jl ([#19])
5+
* ![Maintenance][badge-maintenance] Test type inference with JET.jl ([#19])
66
* ![Maintenance][badge-maintenance] Format with Runic
77

88
## Version `v2.0.1`
@@ -24,7 +24,7 @@
2424

2525
## Version `v1.2.0`
2626
* ![Feature][badge-feature] Add heatmap overlays ([#5][pr-5])
27-
* ![Feature][badge-feature] Add color channel reduction presets `:sumabs` and `:abssum` ([#6][pr-6])
27+
* ![Feature][badge-feature] Add color channel reduction presets `:sumabs` and `:abssum` ([#6][pr-6])
2828

2929
## Version `v1.1.0`
3030
* ![Feature][badge-feature] Access color schemes through their symbols ([#3][pr-3])
@@ -66,4 +66,4 @@
6666
[badge-security]: https://img.shields.io/badge/security-black.svg
6767
[badge-experimental]: https://img.shields.io/badge/experimental-lightgrey.svg
6868
[badge-maintenance]: https://img.shields.io/badge/maintenance-gray.svg
69-
[badge-docs]: https://img.shields.io/badge/docs-orange.svg
69+
[badge-docs]: https://img.shields.io/badge/docs-orange.svg

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ version = "2.1.0-DEV"
55

66
[deps]
77
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
8-
Configurations = "5218b696-f38b-4ac9-8b61-a12ec717816d"
98
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
109
ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795"
1110
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
@@ -14,7 +13,6 @@ XAIBase = "9b48221d-a747-4c1b-9860-46a1d8ba24a7"
1413

1514
[compat]
1615
ColorSchemes = "3"
17-
Configurations = "0.17"
1816
ImageCore = "0.9, 0.10"
1917
ImageTransformations = "0.10"
2018
Interpolations = "0.15, 0.16"

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ To install this package and its dependencies, open the Julia REPL and run
2525
## Related packages
2626
* [TextHeatmaps.jl](https://github.com/Julia-XAI/TextHeatmaps.jl):
2727
Sibling package for visualization of sentiment analysis and input space attributions of NLP models.
28-
* [Julia-XAI](https://github.com/Julia-XAI):
28+
* [Julia-XAI](https://github.com/Julia-XAI):
2929
VisionHeatmaps.jl was designed to visualize explanations from the Julia-XAI ecosystem
30-
and provides methods for the interface defined by [XAIBase.jl](https://github.com/Julia-XAI/XAIBase.jl).
30+
and provides methods for the interface defined by [XAIBase.jl](https://github.com/Julia-XAI/XAIBase.jl).
31+
32+
## Acknowledgements
33+
34+
Adrian Hill gratefully acknowledges funding from the German Federal Ministry of Education and Research under the grant BIFOLD26B.

docs/src/example.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ asset_dir = HTTP.URI("https://raw.githubusercontent.com/Julia-XAI/VisionHeatmaps
1010
img = load(joinpath(asset_dir, "img1.png")) # load image file
1111
```
1212

13-
You might use an input space attribution method
13+
You might use an input space attribution method
1414
(for example from [ExplainableAI.jl](https://github.com/Julia-XAI/ExplainableAI.jl))
1515
to determine which parts of the input contributed most to the "saxophone" class.
1616

@@ -43,9 +43,9 @@ heatmap(x) |> only
4343
```
4444

4545
## Custom heatmapping pipelines
46-
46+
4747
VisionHeatmaps internally applies a sequence of image transformations in what we call a [`Pipeline`](@ref).
48-
The default pipeline corresponds to:
48+
The default pipeline corresponds to:
4949
```@example 1
5050
pipe = NormReduction() |> ExtremaColormap() |> FlipImage()
5151
```
@@ -124,8 +124,8 @@ heatmap(x, pipe) |> only
124124
pipe = NormReduction() |> ExtremaColormap(:viridis) |> FlipImage()
125125
heatmap(x, pipe) |> only
126126
```
127-
128-
We strongly suggest to only use sequential color schemes with `ExtremaColormap`
127+
128+
We strongly suggest to only use sequential color schemes with `ExtremaColormap`
129129
and divergent color schemes with `CenteredColormap`.
130130

131131
!!! tip "ColorSchemes.jl catalogue"
@@ -147,7 +147,7 @@ heatmap(x, img, pipe) |> only
147147
Let's assume we computed an input space attribution `batch` for the following images.
148148

149149
```@example 1
150-
imgs = [load(joinpath(asset_dir, f)) for f in ("img1.png", "img2.png", "img3.png", "img4.png", "img5.png")] # load image files
150+
imgs = [load(joinpath(asset_dir, f)) for f in ("img1.png", "img2.png", "img3.png", "img4.png", "img5.png")] # load image files
151151
```
152152

153153
Once again, we assume that `batch` is in WHCN format:

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ AbsSumReduction
3131
### Manipulating array dimensions
3232
```@docs
3333
FlipImage
34-
PermuteDims
34+
PermuteDims
3535
DropDims
3636
```
3737

src/VisionHeatmaps.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ using ImageTransformations: imresize
66
using Interpolations: Lanczos
77
using ImageCore
88
using XAIBase: Explanation, AbstractXAIMethod, analyze
9-
using Configurations: @option
109

1110
const AbstractImage{T <: Union{Number, Colorant}} = AbstractArray{T, 2}
1211
const AbstractImageBatch{T <: Union{Number, Colorant}} = AbstractArray{T, 3}

src/heatmap.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ heatmap(x) = heatmap(x, DEFAULT_PIPELINE)
3737
"""
3838
heatmap(expl::Explanation)
3939
heatmap(expl::Explanation, pipeline)
40-
heatmap(expl::Explanation, image)
40+
heatmap(expl::Explanation, image)
4141
heatmap(expl::Explanation, image, pipeline)
4242
4343
Visualize `Explanation` from XAIBase as a vision heatmap.

0 commit comments

Comments
 (0)