Skip to content

Commit 864d2b4

Browse files
authored
Merge pull request #26 from JuliaAI/test-updates
Maintenance on tests
2 parents d2996c5 + 64ba9ce commit 864d2b4

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
version:
20-
- '1.4'
20+
- '1.6'
2121
- '1'
2222
os:
2323
- ubuntu-latest

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJParticleSwarmOptimization"
22
uuid = "17a086e9-ed03-4f30-ab88-8b63f0f6126c"
33
authors = ["Long Nguyen <[email protected]> and contributors"]
4-
version = "0.1.2"
4+
version = "0.1.3"
55

66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
@@ -12,6 +12,6 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1212

1313
[compat]
1414
Distributions = "0.25"
15-
MLJBase = "0.18, 0.19, 0.20"
15+
MLJBase = "0.18, 0.19, 0.20, 0.21"
1616
MLJTuning = "0.6, 0.7"
17-
julia = "1.4"
17+
julia = "1.6"

test/parameters.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,13 @@
9393
state = PSO.initialize(rng, ranges, n)
9494
PSO.retrieve!(rng, state)
9595
params = state.parameters
96-
@test params[1] == ["a", "a", "c"]
97-
@test params[2] [553, 250, 375]
98-
@test params[3] [3.9372495283243105, 3.6569395920512977, 3.6354556967115146]
99-
@test params[4] [-0.8067647f0, 0.4209916f0, 0.6736019f0]
96+
@test params[1] isa AbstractVector{<:AbstractString}
97+
@test params[2] isa AbstractVector{<:Integer}
98+
@test params[3] isa AbstractVector{<:AbstractFloat}
99+
@test params[4] isa AbstractVector{<:AbstractFloat}
100+
@test length(params[4]) == 3
101+
@test all(params) do p
102+
length(p) == n
103+
end
100104
end
101105
end

test/strategies/adaptive.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ for acceleration in modes
8989

9090
tree = EvoTreeRegressor(rng=rng)
9191
r1 = range(tree, :max_depth; values=[3:7;])
92-
r2 = range(tree, :η; lower=-2, upper=0, scale=exp10)
92+
r2 = range(tree, :eta; lower=-2, upper=0, scale=exp10)
9393

9494
baseline_self_tuning_tree = TunedModel(
9595
model=tree,

test/strategies/basic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ for acceleration in (CPU1(), CPUProcesses(), CPUThreads())
2525

2626
tree = EvoTreeRegressor(rng=rng)
2727
r1 = range(tree, :max_depth; values=[3:7;])
28-
r2 = range(tree, :η; lower=-2, upper=0, scale=exp10)
28+
r2 = range(tree, :eta; lower=-2, upper=0, scale=exp10)
2929

3030
baseline_self_tuning_tree = TunedModel(
3131
model=tree,

test/update.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343

4444
@testset "Update personal best" begin
4545
@test state.pbest == measurements
46-
@test state.pbest_X [0.35710007620140427 0.37056803307520936 0.2723318907233864 2.7429797605672808 3.9372495283243105 -0.8067647083847199;
46+
# https://github.com/JuliaAI/MLJParticleSwarmOptimization.jl/issues/27
47+
@test_broken state.pbest_X [0.35710007620140427 0.37056803307520936 0.2723318907233864 2.7429797605672808 3.9372495283243105 -0.8067647083847199;
4748
0.471258004384426 0.3400938657534834 0.18864812986209056 2.3976392099947 3.6569395920512977 0.420991611378423 ;
4849
0.09661447846912713 0.19630556211862715 0.7070799594122457 2.5742724788985445 3.6354556967115146 0.6736019046580138]
4950
end
@@ -52,4 +53,5 @@
5253
@test all(state.gbest .== 0.1)
5354
@test all(state.gbest_X .== state.pbest_X[2, :]')
5455
end
55-
end
56+
end
57+

0 commit comments

Comments
 (0)