@@ -79,10 +79,10 @@ def _str_returns(self, name='Returns'):
79
79
out += ['' ]
80
80
return out
81
81
82
- def _process_param (self , param , desc , autosum ):
82
+ def _process_param (self , param , desc , fake_autosummary ):
83
83
"""Determine how to display a parameter
84
84
85
- Emulates autosummary behavior if autosum is not None.
85
+ Emulates autosummary behavior if fake_autosummary
86
86
87
87
Parameters
88
88
----------
@@ -91,12 +91,9 @@ def _process_param(self, param, desc, autosum):
91
91
desc : list of str
92
92
The parameter description as given in the docstring. This is
93
93
ignored when autosummary logic applies.
94
- autosum : list or None
95
- If a list , autosummary-style behaviour will apply for params
94
+ fake_autosummary : bool
95
+ If True , autosummary-style behaviour will apply for params
96
96
that are attributes of the class and have a docstring.
97
- Names for autosummary generation will be appended to this list.
98
-
99
- If None, autosummary is disabled.
100
97
101
98
Returns
102
99
-------
@@ -119,7 +116,7 @@ def _process_param(self, param, desc, autosum):
119
116
param = param .strip ()
120
117
display_param = '**%s**' % param
121
118
122
- if autosum is None :
119
+ if not fake_autosummary :
123
120
return display_param , desc
124
121
125
122
param_obj = getattr (self ._obj , param , None )
@@ -141,7 +138,6 @@ def _process_param(self, param, desc, autosum):
141
138
link_prefix = ''
142
139
143
140
# Referenced object has a docstring
144
- autosum .append (" %s%s" % (autosum_prefix , param ))
145
141
display_param = ':obj:`%s <%s%s>`' % (param ,
146
142
link_prefix ,
147
143
param )
@@ -181,15 +177,11 @@ def _str_param_list(self, name, fake_autosummary=False):
181
177
"""
182
178
out = []
183
179
if self [name ]:
184
- if fake_autosummary :
185
- autosum = []
186
- else :
187
- autosum = None
188
-
189
180
out += self ._str_field_list (name )
190
181
out += ['' ]
191
182
for param , param_type , desc in self [name ]:
192
- display_param , desc = self ._process_param (param , desc , autosum )
183
+ display_param , desc = self ._process_param (param , desc ,
184
+ fake_autosummary )
193
185
194
186
if param_type :
195
187
out += self ._str_indent (['%s : %s' % (display_param ,
@@ -201,14 +193,6 @@ def _str_param_list(self, name, fake_autosummary=False):
201
193
out += self ._str_indent (desc , 8 )
202
194
out += ['' ]
203
195
204
- if fake_autosummary and autosum :
205
- if self .class_members_toctree :
206
- autosum .insert (0 , ' :toctree:' )
207
- autosum .insert (0 , '.. autosummary::' )
208
- out += ['..' , ' HACK to make autogen generate docs:' ]
209
- out += self ._str_indent (autosum , 4 )
210
- out += ['' ]
211
-
212
196
return out
213
197
214
198
@property
0 commit comments