Skip to content

Commit 1f7ac52

Browse files
authored
Extend compat for MLJModelInterface and update tests to reflect MLJBase changes (#88)
* Update compatibility MLJModelInterface = "^0.3,^0.4"; bump to 0.5.2 * update test to reflect migration of info_dict from MLJBase
1 parent 2c83267 commit 1f7ac52

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJLinearModels"
22
uuid = "6ee0df7b-362f-4a72-a706-9e79364fb692"
33
authors = ["Thibaut Lienart <[email protected]>"]
4-
version = "0.5.1"
4+
version = "0.5.2"
55

66
[deps]
77
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
@@ -16,8 +16,8 @@ Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
1616
DocStringExtensions = "^0.8"
1717
IterativeSolvers = "^0.8"
1818
LinearMaps = "^2.6"
19-
MLJModelInterface = "^0.3"
20-
Optim = "0.20,0.21,1,1.1"
19+
MLJModelInterface = "^0.3,^0.4"
20+
Optim = "0.20,0.21,1"
2121
Parameters = "^0.12"
2222
julia = "^1"
2323

test/interface/meta.jl

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
1+
import MLJBase: package_name, package_url, package_license,
2+
is_wrapper, is_pure_julia, input_scitype, target_scitype,
3+
supports_weights, docstring, load_path
4+
15
@testset "meta-pkg" begin
6+
@show methods(package_name)
27
rr = RidgeRegressor()
3-
d = MLJBase.info_dict(rr)
4-
@test d[:package_name] == "MLJLinearModels"
5-
@test d[:package_url] == "https://github.com/alan-turing-institute/MLJLinearModels.jl"
6-
@test d[:package_license] == "MIT"
7-
@test d[:is_pure_julia] == true
8-
@test d[:is_wrapper] == false
8+
@test package_name(rr) == "MLJLinearModels"
9+
@test package_url(rr) ==
10+
"https://github.com/alan-turing-institute/MLJLinearModels.jl"
11+
@test package_license(rr) == "MIT"
12+
@test is_pure_julia(rr) == true
13+
@test is_wrapper(rr) == false
914
end
1015

1116
@testset "meta-reg" begin
1217
lr = LinearRegressor()
13-
d = MLJBase.info_dict(lr)
14-
@test d[:input_scitype] == MLJBase.Table(MLJBase.Continuous)
15-
@test d[:target_scitype] == AbstractVector{MLJBase.Continuous}
16-
@test d[:supports_weights] == false
17-
@test !isempty(d[:docstring])
18-
@test d[:load_path] == "MLJLinearModels.LinearRegressor"
18+
@test input_scitype(lr) == MLJBase.Table(MLJBase.Continuous)
19+
@test target_scitype(lr) == AbstractVector{MLJBase.Continuous}
20+
@test supports_weights(lr) == false
21+
@test !isempty(docstring(lr))
22+
@test load_path(lr) == "MLJLinearModels.LinearRegressor"
1923
end
2024

2125
@testset "meta-clf" begin
2226
lr = LogisticClassifier()
23-
d = MLJBase.info_dict(lr)
24-
@test d[:input_scitype] == MLJBase.Table(MLJBase.Continuous)
25-
@test d[:target_scitype] == AbstractVector{<:MLJBase.Finite}
26-
@test d[:supports_weights] == false
27-
@test !isempty(d[:docstring])
28-
@test d[:load_path] == "MLJLinearModels.LogisticClassifier"
27+
@test input_scitype(lr) == MLJBase.Table(MLJBase.Continuous)
28+
@test target_scitype(lr) == AbstractVector{<:MLJBase.Finite}
29+
@test supports_weights(lr) == false
30+
@test !isempty(docstring(lr))
31+
@test load_path(lr) == "MLJLinearModels.LogisticClassifier"
2932
end

0 commit comments

Comments
 (0)