File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed 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