Skip to content

Commit 9d8e005

Browse files
authored
Merge pull request #27 from JuliaAI/constructor
Add `constructor` trait
2 parents 250b9c2 + f2a602b commit 9d8e005

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "StatisticalTraits"
22
uuid = "64bff920-2084-43da-a3e6-9bb72801c0c9"
33
authors = ["Anthony D. Blaom <[email protected]>"]
4-
version = "3.2.0"
4+
version = "3.4.0"
55

66
[deps]
77
ScientificTypesBase = "30f210dd-8aff-4c5f-94ba-8e64358c1161"

src/StatisticalTraits.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const TRAITS = [
4242
:supports_training_losses,
4343
:deep_properties,
4444
:reporting_operations,
45+
:constructor,
4546
]
4647

4748

@@ -172,6 +173,7 @@ abstract_type(::Type) = Any
172173
is_wrapper(::Type) = false # or `true`
173174
supports_online(::Type) = false # or `true`
174175
docstring(M::Type) = string(M) # some `String`
176+
docstring(Contructor::Function) = Base.Docs.doc(Constructor) |> string
175177
is_supervised(::Type) = false # or `true`
176178
human_name(M::Type) = snakecase(name(M), delim=' ') # `name` defined below
177179
orientation(::Type) = :loss # or `:score`, `:other`
@@ -184,6 +186,7 @@ iteration_parameter(::Type) = nothing
184186
supports_training_losses(::Type) = false
185187
deep_properties(::Type) = ()
186188
reporting_operations(::Type) = ()
189+
constructor(::Type) = nothing
187190

188191
# Returns a tuple, with one entry per field of `T` (the type of some
189192
# statistical model, for example). Each entry is `nothing` or defines

0 commit comments

Comments
 (0)