diff --git a/Project.toml b/Project.toml index 29a1045..44ce204 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StatisticalMeasuresBase" uuid = "c062fc1d-0d66-479b-b6ac-8b44719de4cc" authors = ["Anthony D. Blaom "] -version = "0.1.4" +version = "0.1.5" [deps] CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" diff --git a/src/api.jl b/src/api.jl index addac07..c2afa73 100644 --- a/src/api.jl +++ b/src/api.jl @@ -1,7 +1,3 @@ -#todo note `check` is called `_check` in MLJBase, but not public -#todo the way class_weights are specified is breaking! -#todo change `w` -> `weights` - """ measurements(measure, ŷ, y[, weights, class_weights::AbstractDict]) diff --git a/src/tools.jl b/src/tools.jl index 028d37e..1bd67d9 100644 --- a/src/tools.jl +++ b/src/tools.jl @@ -11,10 +11,8 @@ Then `typename(x)` returns `:Machine`. """ function typename(x) M = typeof(x) - if isdefined(M, :name) - return M.name.name - elseif isdefined(M, :body) - return typename(M.body) + if M isa DataType || M isa UnionAll + return nameof(M) else return Symbol(string(M)) end diff --git a/test/tools.jl b/test/tools.jl index f4105c0..ae21359 100644 --- a/test/tools.jl +++ b/test/tools.jl @@ -1,7 +1,8 @@ -module Fruit using StatisticalMeasuresBase import StatisticalMeasuresBase as API +module Fruit + struct RedApple{T} x::T end