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 11name = " MLJModelInterface"
22uuid = " e80e1ace-859a-464e-9ed9-23947d8ae3ea"
33authors = [" Thibaut Lienart and Anthony Blaom" ]
4- version = " 1.9.6 "
4+ version = " 1.10.0 "
55
66[deps ]
77Random = " 9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -19,7 +19,7 @@ OrderedCollections = "1"
1919Random = " <0.0.1, 1"
2020ScientificTypes = " 3"
2121ScientificTypesBase = " 3"
22- StatisticalTraits = " 3.2 "
22+ StatisticalTraits = " 3.3 "
2323Tables = " 1"
2424Test = " <0.0.1, 1"
2525julia = " 1.6"
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ const MODEL_TRAITS = [
3333 :reports_feature_importances ,
3434 :deep_properties ,
3535 :reporting_operations ,
36+ :constructor ,
3637]
3738
3839const ABSTRACT_MODEL_SUBTYPES = [
Original file line number Diff line number Diff line change @@ -13,10 +13,18 @@ const DeterministicDetector = Union{
1313
1414const StatTraits = StatisticalTraits
1515
16+ # note that if F is a constructor, like `TunedModel`, then `docstring(F)` already falls
17+ # back to the function's document string.
1618function 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
1826 if occursin (" No documentation found" , docstring)
19- docstring = synthesize_docstring (M )
27+ docstring = synthesize_docstring (C )
2028 end
2129 return docstring
2230end
You can’t perform that action at this time.
0 commit comments