From 4ec4c17fca683b6c8abbe149a0009057fed6aa93 Mon Sep 17 00:00:00 2001 From: ExpandingMan Date: Mon, 21 Feb 2022 10:27:43 -0500 Subject: [PATCH 1/3] fix method duplication --- src/traits.jl | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/traits.jl b/src/traits.jl index 289425c..c51b88a 100644 --- a/src/traits.jl +++ b/src/traits.jl @@ -12,21 +12,23 @@ MLJBase.package_url(::Type{<:EitherIteratedModel}) = MLJBase.package_license(::Type{<:EitherIteratedModel}) = "MIT" # inherited traits: -for T in [:DeterministicIteratedModel, :ProbabilisticIteratedModel] - for trait in [:supports_weights, - :supports_class_weights, - :is_pure_julia, - :input_scitype, - :output_scitype, - :target_scitype] +for trait in [:supports_weights, + :supports_class_weights, + :is_pure_julia, + :input_scitype, + :output_scitype, + :target_scitype] + quote + # needed because traits are not always deducable from + # the type (eg, `target_scitype` and `Pipeline` models): + MLJBase.$trait(imodel::EitherIteratedModel) = $trait(imodel.model) + end |> eval + for T in [:DeterministicIteratedModel, :ProbabilisticIteratedModel] quote # try to get trait at level of types ("failure" here just # means falling back to `Unknown`): MLJBase.$trait(::Type{<:$T{M}}) where M = MLJBase.$trait(M) - - # needed because traits are not always deducable from - # the type (eg, `target_scitype` and `Pipeline` models): - MLJBase.$trait(imodel::EitherIteratedModel) = $trait(imodel.model) end |> eval end end + From 4b112fd9151fe6e677469777e9203bd552e2c378 Mon Sep 17 00:00:00 2001 From: ExpandingMan Date: Mon, 21 Feb 2022 10:32:26 -0500 Subject: [PATCH 2/3] remove extraneous extra line --- src/traits.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/traits.jl b/src/traits.jl index c51b88a..28db5c6 100644 --- a/src/traits.jl +++ b/src/traits.jl @@ -31,4 +31,3 @@ for trait in [:supports_weights, end |> eval end end - From 7d063f9c6eb1c8a8956426bf522c0c1d5839aab3 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Tue, 22 Feb 2022 08:00:14 +1300 Subject: [PATCH 3/3] bump 0.4.5 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 218074b..2e38c8e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MLJIteration" uuid = "614be32b-d00c-4edb-bd02-1eb411ab5e55" authors = ["Anthony D. Blaom "] -version = "0.4.4" +version = "0.4.5" [deps] IterationControl = "b3c1a2ee-3fec-4384-bf48-272ea71de57c"