We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3014085 commit ae9cf92Copy full SHA for ae9cf92
fooof/core/modutils.py
@@ -297,3 +297,26 @@ def wrapper(func):
297
return func
298
299
return wrapper
300
+
301
302
+def replace_docstring_sections(replacements):
303
+ """Decorator to drop in docstring sections
304
305
+ Parameters
306
+ ----------
307
+ replacements : str or list of str
308
+ Section(s) to drop into the decorated function's docstring.
309
+ """
310
311
+ def wrapper(func):
312
313
+ docstring = func.__doc__
314
315
+ for replacement in [replacements] if isinstance(replacements, str) else replacements:
316
+ docstring = docs_add_section(docstring, replacement)
317
318
+ func.__doc__ = docstring
319
320
+ return func
321
322
+ return wrapper
0 commit comments