Skip to content

Commit

Permalink
Merge pull request #21 from JuliaAI/dev
Browse files Browse the repository at this point in the history
For a 3.0.0 release
  • Loading branch information
ablaom authored Dec 21, 2021
2 parents d93bb1a + b3e4064 commit 8014091
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "StatisticalTraits"
uuid = "64bff920-2084-43da-a3e6-9bb72801c0c9"
authors = ["Anthony D. Blaom <[email protected]>"]
version = "2.1.0"
version = "3.0.0"

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

[compat]
ScientificTypesBase = "^1, 2"
ScientificTypesBase = "1, 2, 3"
julia = "^1"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ prediction_type(::Type) = :unknown # also :probablistic, :deterministic, :interv
```

Here `Unknown` is a type defined in the light-weight package
[ScientificTypes.jl](https://github.com/JuliaAI/ScientificTypes.jl),
[ScientificTypesBase.jl](https://github.com/JuliaAI/ScientificTypesBase.jl),
the only dependency of StatsTraits.jl.

Refer to [source code](src/StatisticalTraits.jl) for a complete list.
Expand Down
15 changes: 5 additions & 10 deletions src/StatisticalTraits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,12 @@ end
"""
info(X)
Return a named-tuple of trait values for `X`, keyed on a list of
traits that are meaninful for the object.
Return a named-tuple of trait values for `X`, keyed on the names of
traits that are meaningful for the object.
*Note on overloading.* This method can be overloaded directly, as in
`info(X::SomeAbstractType) = ...` or, using `info(X,
::Val{:some_trait}) = ...` where `:some_trait` is a key of
`ScientificTypesBase.TRAIT_FUNCTION_GIVEN_NAME` (such as `:is_measure`
with value `is_measure`).
`info(X::SomeAbstractType) = ...`.
"""
info(X) = info(X, Val(ScientificTypesBase.trait(X)))
info(X, ::Val{:other}) = NamedTuple()
function info end

end # module
end #module
5 changes: 0 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,3 @@ const NONCONSTANT = [:docstring,
Main.eval(ex)
end
end


## INFO STUB

@test StatisticalTraits.info(42) == NamedTuple()

0 comments on commit 8014091

Please sign in to comment.