@@ -178,8 +178,7 @@ def _parse_summary(self):
178
178
summary = self ._doc .read_to_next_empty_line ()
179
179
summary_str = " " .join ([s .strip () for s in summary ]).strip ()
180
180
compiled = re .compile (r'^([\w., ]+=)?\s*[\w\.]+\(.*\)$' )
181
- if compiled .match (summary_str ):
182
- if not self ._is_at_section (): continue
181
+ if compiled .match (summary_str ) and not self ._is_at_section (): continue
183
182
break
184
183
185
184
if summary is not None : self ['Summary' ] = summary
@@ -222,42 +221,9 @@ def _obj(self):
222
221
return None
223
222
224
223
def _error_location (self , msg , error = True ):
225
- if self ._obj is not None :
226
- # Make UserWarning more descriptive via object introspection.
227
- # Skip if introspection fails
228
- name = getattr (self ._obj , '__name__' , None )
229
- if name is None :
230
- name = getattr (getattr (self ._obj , '__class__' , None ), '__name__' , None )
231
- if name is not None : msg += f" in the docstring of { name } "
232
224
if error : raise ValueError (msg )
233
225
else : warn (msg )
234
226
235
- # string conversion routines
236
-
237
- def _str_header (self , name , symbol = '-' ): return [name , len (name )* symbol ]
238
- def _str_indent (self , doc , indent = 4 ): return [' ' * indent + line for line in doc ]
239
-
240
- def _str_summary (self ):
241
- if self ['Summary' ]: return self ['Summary' ] + ['' ]
242
- return []
243
-
244
- def _str_extended_summary (self ):
245
- if self ['Extended' ]: return self ['Extended' ] + ['' ]
246
- return []
247
-
248
- def _str_param_list (self , name ):
249
- out = []
250
- if self [name ]:
251
- out += self ._str_header (name )
252
- for param in self [name ]:
253
- parts = []
254
- if param .name : parts .append (param .name )
255
- if param .type : parts .append (param .type )
256
- out += [' : ' .join (parts )]
257
- if param .desc and '' .join (param .desc ).strip (): out += self ._str_indent (param .desc )
258
- out += ['' ]
259
- return out
260
-
261
227
262
228
def dedent_lines (lines , split = True ):
263
229
"""Deindent a list of lines maximally"""
0 commit comments