File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
1
name = " MLJModelInterface"
2
2
uuid = " e80e1ace-859a-464e-9ed9-23947d8ae3ea"
3
3
authors = [" Thibaut Lienart and Anthony Blaom" ]
4
- version = " 1.9.6 "
4
+ version = " 1.10.0 "
5
5
6
6
[deps ]
7
7
Random = " 9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -19,7 +19,7 @@ OrderedCollections = "1"
19
19
Random = " <0.0.1, 1"
20
20
ScientificTypes = " 3"
21
21
ScientificTypesBase = " 3"
22
- StatisticalTraits = " 3.2 "
22
+ StatisticalTraits = " 3.3 "
23
23
Tables = " 1"
24
24
Test = " <0.0.1, 1"
25
25
julia = " 1.6"
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ const MODEL_TRAITS = [
33
33
:reports_feature_importances ,
34
34
:deep_properties ,
35
35
:reporting_operations ,
36
+ :constructor ,
36
37
]
37
38
38
39
const ABSTRACT_MODEL_SUBTYPES = [
Original file line number Diff line number Diff line change @@ -13,10 +13,18 @@ const DeterministicDetector = Union{
13
13
14
14
const StatTraits = StatisticalTraits
15
15
16
+ # note that if F is a constructor, like `TunedModel`, then `docstring(F)` already falls
17
+ # back to the function's document string.
16
18
function StatTraits. docstring (M:: Type{<:Model} )
17
- docstring = Base. Docs. doc (M) |> string
19
+ constructor = StatTraits. constructor (M)
20
+ # At time of writing, `constructor` is a new trait only overloaded for model wrappers
21
+ # that have multiple types associated with the same constructor (e.g., `TunedModel` is
22
+ # a constructor that can return objects of either `ProbabilisticTunedModel` or
23
+ # `DeterministicTunedModel` type. However, we want these bound to the same docstring.
24
+ C = isnothing (constructor) ? M : constructor
25
+ docstring = Base. Docs. doc (C) |> string
18
26
if occursin (" No documentation found" , docstring)
19
- docstring = synthesize_docstring (M )
27
+ docstring = synthesize_docstring (C )
20
28
end
21
29
return docstring
22
30
end
You can’t perform that action at this time.
0 commit comments