Skip to content

Commit

Permalink
Merge pull request #27 from JuliaAI/constructor
Browse files Browse the repository at this point in the history
Add `constructor` trait
  • Loading branch information
ablaom authored Jun 3, 2024
2 parents 250b9c2 + f2a602b commit 9d8e005
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "StatisticalTraits"
uuid = "64bff920-2084-43da-a3e6-9bb72801c0c9"
authors = ["Anthony D. Blaom <[email protected]>"]
version = "3.2.0"
version = "3.4.0"

[deps]
ScientificTypesBase = "30f210dd-8aff-4c5f-94ba-8e64358c1161"
Expand Down
3 changes: 3 additions & 0 deletions src/StatisticalTraits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const TRAITS = [
:supports_training_losses,
:deep_properties,
:reporting_operations,
:constructor,
]


Expand Down Expand Up @@ -172,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`
Expand All @@ -184,6 +186,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
Expand Down

0 comments on commit 9d8e005

Please sign in to comment.