Skip to content

Commit

Permalink
Merge pull request #52 from JuliaAI/dev
Browse files Browse the repository at this point in the history
For a 0.4.5 release
  • Loading branch information
ablaom authored Feb 21, 2022
2 parents 0b33079 + 7d063f9 commit 874f3a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MLJIteration"
uuid = "614be32b-d00c-4edb-bd02-1eb411ab5e55"
authors = ["Anthony D. Blaom <[email protected]>"]
version = "0.4.4"
version = "0.4.5"

[deps]
IterationControl = "b3c1a2ee-3fec-4384-bf48-272ea71de57c"
Expand Down
23 changes: 12 additions & 11 deletions src/traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@ 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

0 comments on commit 874f3a4

Please sign in to comment.