-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
docstrings.jl
108 lines (89 loc) · 2.44 KB
/
docstrings.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
"""
docstrings.jl
# Description
A collection of common docstrings and docstring templates for the package.
"""
# -----------------------------------------------------------------------------
# DOCSTRING TEMPLATES
# -----------------------------------------------------------------------------
# Constants template
@template CONSTANTS =
"""
$(FUNCTIONNAME)
# Description
$(DOCSTRING)
"""
# Types template
@template TYPES =
"""
$(TYPEDEF)
# Summary
$(DOCSTRING)
# Fields
$(TYPEDFIELDS)
"""
# Template for functions, macros, and methods (i.e., constructors)
@template (FUNCTIONS, METHODS, MACROS) =
"""
$(TYPEDSIGNATURES)
# Summary
$(DOCSTRING)
# Method List / Definition Locations
$(METHODLIST)
"""
# -----------------------------------------------------------------------------
# COMMON DOCUMENTATION CONSTANTS
# -----------------------------------------------------------------------------
"""
Docstring prefix denoting that the constant is used as a common docstring element for other docstrings.
"""
const _COMMON_DOC = "Common docstring:"
"""
$(_COMMON_DOC) shared options docstring, inserted at the end of `opts_<...>` structs.
"""
const _OPTS_DOCSTRING = """
These options are a [`Parameters.jl`](https://github.com/mauro3/Parameters.jl) struct, taking custom options keyword arguments.
Each field has a default value listed below.
"""
"""
$(_COMMON_DOC) shared argument docstring for ART module arguments.
"""
const _ARG_ART = """
- `art::ARTModule`: the ARTModule module.
"""
"""
$(_COMMON_DOC) shared argument docstring for the input sample of features.
"""
const _ARG_X = """
- `x::RealVector`: the sample vector to use.
"""
"""
$(_COMMON_DOC) shared argument docstring for the weight vector.
"""
const _ARG_W = """
- `W::RealVector`: the weight vector to use.
"""
"""
$(_COMMON_DOC) shared argument docstring for the index of the weight column.
"""
const _ARG_INDEX = """
- `index::Integer`: the index of the weight column to use.
"""
"""
$(_COMMON_DOC) shared arguments string for methods using an ART module, sample 'x', and weight vector 'W'.
"""
const _ARG_ART_X_W = """
# Arguments
$(_ARG_ART)
$(_ARG_X)
$(_ARG_W)
"""
"""
$(_COMMON_DOC) shared arguments string for functions updating a column in a matrix.
"""
const _ARGS_MATRIX_REPLACE = """
# Arguments
- `mat::RealMatrix`: the matrix to update with a replaced column vector.
- `vec::RealVector`: the vector to put in the matrix at the column index.
- `index::Integer`: the column index to put the vector.
"""