Skip to content

Commit 2434549

Browse files
authored
Merge pull request #20 from JuliaAI/notraits
make `info` method a stub and modify it's docstring
2 parents e445bbc + e4d4e7e commit 2434549

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version = "2.1.0"
77
ScientificTypesBase = "30f210dd-8aff-4c5f-94ba-8e64358c1161"
88

99
[compat]
10-
ScientificTypesBase = "^1, 2"
10+
ScientificTypesBase = "1, 2, 3"
1111
julia = "^1"
1212

1313
[extras]

src/StatisticalTraits.jl

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,12 @@ end
211211
"""
212212
info(X)
213213
214-
Return a named-tuple of trait values for `X`, keyed on a list of
215-
traits that are meaninful for the object.
214+
Return a named-tuple of trait values for `X`, keyed on the names of
215+
traits that are meaningful for the object.
216216
217217
*Note on overloading.* This method can be overloaded directly, as in
218-
`info(X::SomeAbstractType) = ...` or, using `info(X,
219-
::Val{:some_trait}) = ...` where `:some_trait` is a key of
220-
`ScientificTypesBase.TRAIT_FUNCTION_GIVEN_NAME` (such as `:is_measure`
221-
with value `is_measure`).
222-
218+
`info(X::SomeAbstractType) = ...`.
223219
"""
224-
info(X) = info(X, Val(ScientificTypesBase.trait(X)))
225-
info(X, ::Val{:other}) = NamedTuple()
220+
function info end
226221

227-
end # module
222+
end #module

test/runtests.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,3 @@ const NONCONSTANT = [:docstring,
9999
Main.eval(ex)
100100
end
101101
end
102-
103-
104-
## INFO STUB
105-
106-
@test StatisticalTraits.info(42) == NamedTuple()

0 commit comments

Comments
 (0)