Skip to content

Commit c5fbcd9

Browse files
committed
Update combat and padded_axis tests
1 parent 4dc9ee1 commit c5fbcd9

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AxisIndices"
22
uuid = "f52c9ee2-1b1c-4fd8-8546-6350938c7f11"
33
authors = ["Tokazama <[email protected]>"]
4-
version = "0.7.1"
4+
version = "0.7.2"
55

66
[deps]
77
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

docs/src/acknowledgments.md

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

src/padded_axis.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,13 @@ function print_axis(io::IO, axis::PaddedAxis)
311311
print(io, parent(axis))
312312
if first_pad(axis) === last_pad(axis)
313313
print(io, "; sym_pad=")
314-
print(io, first_pad(axis))
314+
print(io, Int(first_pad(axis)))
315315
print(io, ")")
316316
else
317317
print(io, "; first_pad=")
318-
print(io, first_pad(axis))
318+
print(io, Int(first_pad(axis)))
319319
print(io, ", last_pad=")
320-
print(io, last_pad(axis))
320+
print(io, Int(last_pad(axis)))
321321
print(io, ")")
322322
end
323323
end

test/padded_axis.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
@test AxisArray(x, replicate_pad(first_pad=3, last_pad=3)) == [:a, :a, :a, :a, :b, :c, :d, :e, :e, :e, :e]
66
@test AxisArray(x, symmetric_pad(first_pad=3, last_pad=3)) == [:d, :c, :b, :a, :b, :c, :d, :e, :d, :c, :b]
77
@test AxisArray(x, reflect_pad(first_pad=3, last_pad=3)) == [:c, :b, :a, :a, :b, :c, :d, :e, :e, :d, :c]
8-
@test AxisArray(1:2, zero_pad(sym_pad=2)) == [0, 0, 1, 2, 0, 0]
98
@test AxisArray(1:2, one_pad(sym_pad=2)) == [1, 1, 1, 2, 1, 1]
9+
@test AxisArray(1:2, zero_pad(sym_pad=2)) == [0, 0, 1, 2, 0, 0]
1010

1111
x = reshape(1:6, 3, 2)
1212
ax = @inferred(AxisArray(x, replicate_pad(sym_pad=2), replicate_pad(sym_pad=2)))
@@ -18,6 +18,16 @@
1818
@test axes(cax, 1) isa OffsetAxis
1919
@test @inferred(IndexStyle(ax)) isa IndexCartesian
2020

21+
axis = zero_pad(SimpleAxis(ArrayInterface.StaticInt(2)); sym_pad=ArrayInterface.StaticInt(2))
22+
@test ArrayInterface.known_first(axis) === -1
23+
@test ArrayInterface.known_last(axis) === 4
24+
@test ArrayInterface.known_length(axis) === 6
25+
26+
axis = zero_pad(1:2, sym_pad=2)
27+
@test ArrayInterface.known_first(axis) === nothing
28+
@test ArrayInterface.known_last(axis) === nothing
29+
@test ArrayInterface.known_length(axis) === nothing
30+
2131
axis = eachindex(AxisArray(3:4, one_pad(sym_pad=2)))
2232
x = map(identity, axis)
2333
@test x == axis

0 commit comments

Comments
 (0)