Skip to content

Commit

Permalink
Comment out tests of nonexisting fields
Browse files Browse the repository at this point in the history
  • Loading branch information
barucden committed Dec 27, 2021
1 parent fac9447 commit 3016d86
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
26 changes: 13 additions & 13 deletions test/tst_augment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ops = (Resize(2,2),Rotate90()) # forces affine
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === rect
#@test parent(parent(wv)).itp.coefs === rect
@test round.(Float64.(wv); digits=1) == round.(Float64.(rotl90(imresize(rect,2,2))); digits=1)
end

Expand Down Expand Up @@ -117,7 +117,7 @@ ops = (Rotate180(),Crop(5:200,200:500),Rotate90(1),Crop(1:250, 1:150))
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === camera
#@test parent(parent(wv)).itp.coefs === camera
#@test_reference "reference/rot_crop_either_crop.txt" wv
# img = @inferred augment(camera, ops) # TODO: update1.0
img = augment(camera, ops)
Expand Down Expand Up @@ -156,7 +156,7 @@ ops = (Rotate180(),Crop(5:200,200:500),Rotate90(),Crop(50:300, 50:195),Resize(25
@test eltype(wv) <: eltype(camera)
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === camera
#@test parent(parent(wv)).itp.coefs === camera
#@test_reference "reference/rot_crop_rot_crop_resize.txt" wv
# img = @inferred Augmentor.augment(camera, ops) # TODO: update1.0
img = Augmentor.augment(camera, ops)
Expand All @@ -176,7 +176,7 @@ ops = (Rotate(45),CropNative(1:512,1:512))
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === camera
#@test parent(parent(wv)).itp.coefs === camera
@test_reference "reference/rot45_crop.txt" wv
img = @inferred augment(camera, ops)
@test img == parent(copy(wv))
Expand All @@ -191,7 +191,7 @@ ops = (Rotate(45),CropSize(512,512))
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === camera
#@test parent(parent(wv)).itp.coefs === camera
@test_reference "reference/rot45_crop.txt" wv
img = @inferred augment(camera, ops)
@test img == parent(copy(wv))
Expand All @@ -206,7 +206,7 @@ ops = (Rotate(-45),CropSize(256,256))
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === camera
#@test parent(parent(wv)).itp.coefs === camera
@test_reference "reference/rotr45_cropsize.txt" wv
img = @inferred augment(camera, ops)
@test img == parent(copy(wv))
Expand All @@ -219,7 +219,7 @@ ops = (Scale(.1,.2),NoOp())
@testset "$(str_showcompact(ops))" begin
wv = @inferred Augmentor._augment(camera, ops)
@test typeof(wv) <: InvWarpedView
@test parent(wv).itp.coefs === camera
#@test parent(wv).itp.coefs === camera
@test_reference "reference/scale_noop.txt" wv
img = @inferred augment(camera, ops)
@test img == parent(copy(wv))
Expand All @@ -234,7 +234,7 @@ ops = (Scale(.1,.2),CropRatio())
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === camera
#@test parent(parent(wv)).itp.coefs === camera
@test_reference "reference/scale_cropratio.txt" collect(wv)
img = @inferred augment(camera, ops)
@test img == parent(copy(wv))
Expand All @@ -247,7 +247,7 @@ ops = (ShearX(45),NoOp())
@testset "$(str_showcompact(ops))" begin
wv = @inferred Augmentor._augment(camera, ops)
@test typeof(wv) <: InvWarpedView
@test parent(wv).itp.coefs === camera
#@test parent(wv).itp.coefs === camera
@test_reference "reference/shearx_noop.txt" wv
img = @inferred augment(camera, ops)
@test img == parent(copy(wv))
Expand All @@ -262,7 +262,7 @@ ops = (ShearY(45),CropNative(1:512,1:512))
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === camera
#@test parent(parent(wv)).itp.coefs === camera
@test_reference "reference/sheary_crop.txt" wv
img = @inferred augment(camera, ops)
@test img == parent(copy(wv))
Expand All @@ -277,7 +277,7 @@ ops = (Crop(101:200,201:350),Scale(.2,.4))
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === camera
#@test parent(parent(wv)).itp.coefs === camera
#@test_reference "reference/crop_scale.txt" wv
img = @inferred augment(camera, ops)
@test img == parent(copy(wv))
Expand All @@ -292,7 +292,7 @@ ops = (Crop(101:200,201:350),Zoom(1.3))
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === camera
#@test parent(parent(wv)).itp.coefs === camera
@test_reference "reference/crop_zoom.txt" wv
img = @inferred augment(camera, ops)
@test img == parent(copy(wv))
Expand All @@ -307,7 +307,7 @@ ops = (Rotate(45),Zoom(2))
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === camera
#@test parent(parent(wv)).itp.coefs === camera
@test_reference "reference/rot45_zoom.txt" wv
wv2 = Augmentor._augment(camera, (ops..., NoOp()))
@test_reference "reference/rot45_zoom.txt" wv2
Expand Down
18 changes: 9 additions & 9 deletions test/tst_operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
wv = @inferred Augmentor.prepareaffine(rect)
@test typeof(wv) <: InvWarpedView
@test typeof(parent(wv)) <: Interpolations.Extrapolation
@test parent(wv).itp.coefs === rect
#@test parent(wv).itp.coefs === rect
@test @inferred(Augmentor.prepareaffine(wv)) === wv
@test @inferred(Augmentor.prepareaffine(parent(wv))) === wv
v = view(wv, 1:2, 2:3)
Expand Down Expand Up @@ -142,9 +142,9 @@ ops = (Crop(1:2,2:3), Either((Rotate90(), Rotate270()), (1,0)))
@testset "$(str_showcompact(ops))" begin
wv = @inferred Augmentor.unroll_applyaffine(ops, square)
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
#@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === square
#@test parent(parent(wv)).itp.coefs === square
@test parent(copy(wv)) == rotl90(view(square, 1:2, 2:3))
wv2 = @inferred Augmentor.unroll_applylazy(ops, Augmentor.prepareaffine(square))
@test wv2 == wv
Expand All @@ -158,9 +158,9 @@ ops = (Rotate180(), CropNative(1:2,2:3))
@testset "$(str_showcompact(ops))" begin
wv = @inferred Augmentor.unroll_applyaffine(ops, square)
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
#@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === square
#@test parent(parent(wv)).itp.coefs === square
@test wv == view(rot180(square), IdentityRange(1:2), IdentityRange(2:3))
wv2 = @inferred Augmentor.unroll_applylazy(ops, Augmentor.prepareaffine(square))
@test wv2 == wv
Expand All @@ -182,9 +182,9 @@ ops = (Rotate180(), CropSize(2,2))
@testset "$(str_showcompact(ops))" begin
wv = @inferred Augmentor.unroll_applyaffine(ops, square)
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
#@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === square
#@test parent(parent(wv)).itp.coefs === square
@test_broken wv == view(rot180(square), IdentityRange(1:2), IdentityRange(2:3))
wv2 = @inferred Augmentor.unroll_applylazy(ops, Augmentor.prepareaffine(square))
@test wv2 == wv
Expand All @@ -198,9 +198,9 @@ ops = (Either((Rotate90(),Rotate270()),(1,0)), Crop(20:30,100:150), Either((Rota
@testset "$(str_showcompact(ops))" begin
wv = @inferred Augmentor.unroll_applyaffine(ops, camera)
@test typeof(wv) <: SubArray
@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
#@test typeof(wv.indices) <: Tuple{Vararg{IdentityRange}}
@test typeof(parent(wv)) <: InvWarpedView
@test parent(parent(wv)).itp.coefs === camera
#@test parent(parent(wv)).itp.coefs === camera
@test parent(copy(wv)) == rotr90(view(rotl90(camera), 20:30, 100:150))
v = @inferred Augmentor.unroll_applylazy(ops, camera)
@test v === view(camera, 100:1:150, 483:1:493)
Expand Down

0 comments on commit 3016d86

Please sign in to comment.