Skip to content

Commit

Permalink
Merge pull request #28 from JuliaAI/dev
Browse files Browse the repository at this point in the history
For a 3.3 release
  • Loading branch information
ablaom authored Jun 3, 2024
2 parents 5f18013 + 978ad65 commit 5d72ad4
Show file tree
Hide file tree
Showing 3 changed files with 5 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.3.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(Constructor::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
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ end
@testset "docstring" begin
@test docstring(Foo(1,'x')) == "Foo"
@test docstring(Fruit.RedApple(4)) == "Main.Fruit.RedApple{Int64}"
@test docstring(sin) == Base.Docs.doc(sin) |> string
end

@testset "hyperparameter_ranges" begin
Expand Down

0 comments on commit 5d72ad4

Please sign in to comment.