57
57
@test (Select (:a ) == Select (" a" ) ==
58
58
Select ((:a ,)) == Select ((" a" ,)) ==
59
59
Select ([:a ]) == Select ([" a" ]))
60
+
61
+ # reapply test
62
+ T = Select (:b , :c , :d )
63
+ n1, c1 = apply (T, t)
64
+ n2 = reapply (T, t, c1)
65
+ @test n1 == n2
60
66
end
61
67
62
68
@testset " Reject" begin
117
123
@test (Reject (:a ) == Reject (" a" ) ==
118
124
Reject ((:a ,)) == Reject ((" a" ,)) ==
119
125
Reject ([:a ]) == Reject ([" a" ]))
126
+
127
+ # reapply test
128
+ T = Reject (:b , :c , :d )
129
+ n1, c1 = apply (T, t)
130
+ n2 = reapply (T, t, c1)
131
+ @test n1 == n2
120
132
end
121
133
122
134
@testset " Identity" begin
360
372
n, c = apply (T, t)
361
373
tₒ = revert (T, n, c)
362
374
@test Tables. matrix (t) ≈ Tables. matrix (tₒ)
375
+
376
+ # reapply with Sequential transform
377
+ t = Table (x= rand (1000 ))
378
+ T = ZScore () → Quantile ()
379
+ n1, c1 = apply (T, t)
380
+ n2 = reapply (T, t, c1)
381
+ @test n1 == n2
363
382
end
364
383
365
384
@testset " Parallel" begin
394
413
n₁ = P₁ (t)
395
414
n₂ = P₂ (t)
396
415
@test Tables. matrix (n₁) ≈ Tables. matrix (n₂)
416
+
417
+ # reapply with Parallel transform
418
+ t = Table (x= rand (1000 ))
419
+ T = ZScore () ⊔ Quantile ()
420
+ n1, c1 = apply (T, t)
421
+ n2 = reapply (T, t, c1)
422
+ @test n1 == n2
397
423
end
398
424
399
425
@testset " Miscellaneous" begin
406
432
@test isapprox (std (n. x), 1.0 , atol= 1e-8 )
407
433
@test isapprox (mean (r. x), mean (t. x), atol= 1e-8 )
408
434
@test isapprox (std (r. x), std (t. x), atol= 1e-8 )
409
-
410
- # reapply with Sequential transform
411
- t = Table (x= rand (1000 ))
412
- T = ZScore () → Quantile ()
413
- n1, c1 = apply (T, t)
414
- n2 = reapply (T, t, c1)
415
- @test n1 == n2
416
-
417
- # reapply with Parallel transform
418
- t = Table (x= rand (1000 ))
419
- T = ZScore () ⊔ Quantile ()
420
- n1, c1 = apply (T, t)
421
- n2 = reapply (T, t, c1)
422
- @test n1 == n2
423
435
end
424
436
end
0 commit comments