Skip to content

Commit dae1839

Browse files
authored
Making docstring of UnivFinite exportable (#9)
1 parent 2252f8d commit dae1839

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJModelInterface"
22
uuid = "e80e1ace-859a-464e-9ed9-23947d8ae3ea"
33
authors = ["Thibaut Lienart and Anthony Blaom"]
4-
version = "0.1.2"
4+
version = "0.1.3"
55

66
[deps]
77
ScientificTypes = "321657f4-b219-11e9-178b-2701a2544e81"

src/data_utils.jl

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -264,25 +264,28 @@ _squeeze(v) = first(v)
264264
# ------------------------------------------------------------------------
265265
# UnivariateFinite
266266

267-
"""
268-
UnivariateFinite(classes, p)
267+
const UNIVARIATE_FINITE_DOCSTRING =
268+
"""
269+
UnivariateFinite(classes, p)
269270
270-
A discrete univariate distribution whose finite support is the elements of the
271-
vector `classes`, and whose corresponding probabilities are elements of the
272-
vector `p`, which must sum to one $REQUIRE.. Here `classes` must have type
273-
`AbstractVector{<:CategoricalElement}` where
271+
A discrete univariate distribution whose finite support is the elements of
272+
the vector `classes`, and whose corresponding probabilities are elements of
273+
the vector `p`, which must sum to one $REQUIRE. Here `classes` must have
274+
type `AbstractVector{<:CategoricalElement}` where
274275
275-
CategoricalElement = Union{CategoricalValue,CategoricalString}
276+
CategoricalElement = Union{CategoricalValue,CategoricalString}
276277
277-
and all classes are assumed to share the same categorical pool.
278+
and all classes are assumed to share the same categorical pool.
278279
279-
UnivariateFinite(prob_given_class)
280+
UnivariateFinite(prob_given_class)
280281
281-
A discrete univariate distribution whose finite support is the set of keys of
282-
the provided dictionary, `prob_given_class` $REQUIRE.. The dictionary keys must
283-
be of type `CategoricalElement` (see above) and the dictionary values specify
284-
the corresponding probabilities.
285-
"""
282+
A discrete univariate distribution whose finite support is the set of keys
283+
of the provided dictionary, `prob_given_class` $REQUIRE. The dictionary
284+
keys must be of type `CategoricalElement` (see above) and the dictionary
285+
values specify the corresponding probabilities.
286+
"""
287+
288+
"""$UNIVARIATE_FINITE_DOCSTRING"""
286289
UnivariateFinite(d::AbstractDict) = UnivariateFinite(get_interface_mode(), d)
287290
UnivariateFinite(c::AbstractVector, p) =
288291
UnivariateFinite(get_interface_mode(), c, p)

0 commit comments

Comments
 (0)