From 5b2abe52aa623bed255bc38e59b560ebaea65264 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Thu, 30 May 2024 13:36:25 +1200 Subject: [PATCH 1/4] add constructor trait --- src/StatisticalTraits.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/StatisticalTraits.jl b/src/StatisticalTraits.jl index f6df0e7..72a39a2 100644 --- a/src/StatisticalTraits.jl +++ b/src/StatisticalTraits.jl @@ -42,6 +42,7 @@ const TRAITS = [ :supports_training_losses, :deep_properties, :reporting_operations, + :constructor, ] @@ -184,6 +185,7 @@ iteration_parameter(::Type) = nothing supports_training_losses(::Type) = false deep_properties(::Type) = () reporting_operations(::Type) = () +constructor(::Type) = nothing # Returns a tuple, with one entry per field of `T` (the type of some # statistical model, for example). Each entry is `nothing` or defines From a5331b4fdb394aae2a11c0428088cebbd56a5a9c Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Thu, 30 May 2024 13:36:54 +1200 Subject: [PATCH 2/4] bump 3.3.0 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 5f05d50..51650b2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StatisticalTraits" uuid = "64bff920-2084-43da-a3e6-9bb72801c0c9" authors = ["Anthony D. Blaom "] -version = "3.2.0" +version = "3.3.0" [deps] ScientificTypesBase = "30f210dd-8aff-4c5f-94ba-8e64358c1161" From f0d0685ef074d3ba7938fcb24d25fd826cc8e7e9 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 31 May 2024 09:08:34 +1200 Subject: [PATCH 3/4] bump 3.4 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 51650b2..afebf49 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StatisticalTraits" uuid = "64bff920-2084-43da-a3e6-9bb72801c0c9" authors = ["Anthony D. Blaom "] -version = "3.3.0" +version = "3.4.0" [deps] ScientificTypesBase = "30f210dd-8aff-4c5f-94ba-8e64358c1161" From f2a602b85c8524c7cddfcc55e892ea3c4538aaa4 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Mon, 3 Jun 2024 16:04:43 +1200 Subject: [PATCH 4/4] add fallback for `docstring(::Function)` --- src/StatisticalTraits.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/StatisticalTraits.jl b/src/StatisticalTraits.jl index 72a39a2..2f0676d 100644 --- a/src/StatisticalTraits.jl +++ b/src/StatisticalTraits.jl @@ -173,6 +173,7 @@ abstract_type(::Type) = Any is_wrapper(::Type) = false # or `true` supports_online(::Type) = false # or `true` docstring(M::Type) = string(M) # some `String` +docstring(Contructor::Function) = Base.Docs.doc(Constructor) |> string is_supervised(::Type) = false # or `true` human_name(M::Type) = snakecase(name(M), delim=' ') # `name` defined below orientation(::Type) = :loss # or `:score`, `:other`