Skip to content

Commit 5d72ad4

Browse files
authored
Merge pull request #28 from JuliaAI/dev
For a 3.3 release
2 parents 5f18013 + 978ad65 commit 5d72ad4

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-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.3.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(Constructor::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

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ end
4646
@testset "docstring" begin
4747
@test docstring(Foo(1,'x')) == "Foo"
4848
@test docstring(Fruit.RedApple(4)) == "Main.Fruit.RedApple{Int64}"
49+
@test docstring(sin) == Base.Docs.doc(sin) |> string
4950
end
5051

5152
@testset "hyperparameter_ranges" begin

0 commit comments

Comments
 (0)