Skip to content

Commit

Permalink
address some julia 1.8 type param warnings; partially address #835
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed Oct 17, 2022
1 parent 46bea18 commit e99e479
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 1 addition & 6 deletions src/measures/finite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -530,12 +530,7 @@ for M in (:MulticlassTruePositiveRate, :MulticlassTrueNegativeRate,
average::T
return_type::Type{U}
end
# @ablaom says next line looks redundant:
$M(average::T, return_type::Type{U}) where {T, U} =
$M(average, return_type)
$M(; average=macro_avg,
return_type=LittleDict) where T<:MulticlassAvg where
U<:Union{Vector, LittleDict} = $M(average, return_type)
$M(; average=macro_avg, return_type=LittleDict) = $M(average, return_type)
end
eval(ex)
end
Expand Down
9 changes: 4 additions & 5 deletions src/measures/probabilistic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@ end
# Missing values not supported, but allow `Missing` in eltype, because
# `skipinvalid(yhat, y)` does not tighten the type. See doc string above.

call(::AUC, ŷ::ArrMissing{UnivariateFinite{S,V,R,P}}, y) where {S,V,R,P} =
call(::AUC, ŷ::ArrMissing{UnivariateFinite{S,V,R,P}}, y) where {S,V,R,P<:Real} =
_auc(P, ŷ, y)

# corner case of UnivariateFinite's of mixed type
call(::AUC, ŷ::ArrMissing{UnivariateFinite}, y) where {S,V,R,P} =
_auc(Float64, ŷ, y)

# corner case of UnivariateFinite's of mixed type; next line could be removed after
# resolution of https://github.com/JuliaAI/CategoricalDistributions.jl/issues/37
call(::AUC, ŷ::ArrMissing{UnivariateFinite}, y) = _auc(Float64, ŷ, y)


# ========================================================
Expand Down

0 comments on commit e99e479

Please sign in to comment.