def test_decorator(): with suppress_warnings() as sup: sup.filter(category=DeprecationWarning) # with unindentation of parameters decorator = doccer.filldoc(doc_dict, True) @decorator def func(): """ Docstring %(strtest3)s """ assert_equal( func.__doc__, """ Docstring Another test with some indent """) # without unindentation of parameters decorator = doccer.filldoc(doc_dict, False) @decorator def func(): """ Docstring %(strtest3)s """ assert_equal( func.__doc__, """ Docstring Another test with some indent """)
_extra_arguments_doc = ("""extra_arguments : sequence, optional Sequence of extra positional arguments to pass to passed function.""") _extra_keywords_doc = ("""extra_keywords : dict, optional dict of extra keyword arguments to pass to passed function.""") _prefilter_doc = ("""prefilter : bool, optional Determines if the input array is prefiltered with `spline_filter` before interpolation. The default is True, which will create a temporary `float64` array of filtered values if `order > 1`. If setting this to False, the output will be slightly blurred if `order > 1`, unless the input is prefiltered, i.e. it is the result of calling `spline_filter` on the original input.""") docdict = { 'input': _input_doc, 'axis': _axis_doc, 'output': _output_doc, 'size_foot': _size_foot_doc, 'mode_interp_constant': _mode_interp_constant_doc, 'mode_interp_mirror': _mode_interp_mirror_doc, 'mode_reflect': _mode_reflect_doc, 'mode_multiple': _mode_multiple_doc, 'cval': _cval_doc, 'origin': _origin_doc, 'origin_multiple': _origin_multiple_doc, 'extra_arguments': _extra_arguments_doc, 'extra_keywords': _extra_keywords_doc, 'prefilter': _prefilter_doc } docfiller = doccer.filldoc(docdict)
import itertools import numpy import warnings from scipy._lib import doccer from . import _nd_image from . import _ni_support from ._ni_docstrings import docdict # Change the default 'reflect' to 'constant' via modifying a copy of docdict docdict_copy = docdict.copy() del docdict docdict_copy['mode'] = docdict_copy['mode'].replace("Default is 'reflect'", "Default is 'constant'") docfiller = doccer.filldoc(docdict_copy) __all__ = [ 'spline_filter1d', 'spline_filter', 'geometric_transform', 'map_coordinates', 'affine_transform', 'shift', 'zoom', 'rotate' ] @docfiller def spline_filter1d(input, order=3, axis=-1, output=numpy.float64, mode='mirror'): """ Calculate a one-dimensional spline filter along the given axis.
import math import numpy import warnings from . import _ni_support from . import _nd_image from ._ni_docstrings import docdict from scipy._lib import doccer # Change the default 'reflect' to 'constant' via modifying a copy of docdict docdict_copy = docdict.copy() del docdict docdict_copy['mode'] = docdict_copy['mode'].replace("Default is 'reflect'", "Default is 'constant'") docfiller = doccer.filldoc(docdict_copy) __all__ = ['spline_filter1d', 'spline_filter', 'geometric_transform', 'map_coordinates', 'affine_transform', 'shift', 'zoom', 'rotate'] @docfiller def spline_filter1d(input, order=3, axis=-1, output=numpy.float64, mode='mirror'): """ Calculate a one-dimensional spline filter along the given axis. The lines of the array along the given axis are filtered by a spline filter. The order of the spline must be >= 2 and <= 5. Parameters
"""extra_arguments : sequence, optional Sequence of extra positional arguments to pass to passed function.""") _extra_keywords_doc = ( """extra_keywords : dict, optional dict of extra keyword arguments to pass to passed function.""") _prefilter_doc = ( """prefilter : bool, optional Determines if the input array is prefiltered with `spline_filter` before interpolation. The default is True, which will create a temporary `float64` array of filtered values if `order > 1`. If setting this to False, the output will be slightly blurred if `order > 1`, unless the input is prefiltered, i.e. it is the result of calling `spline_filter` on the original input.""") docdict = { 'input': _input_doc, 'axis': _axis_doc, 'output': _output_doc, 'size_foot': _size_foot_doc, 'mode': _mode_doc, 'mode_multiple': _mode_multiple_doc, 'cval': _cval_doc, 'origin': _origin_doc, 'origin_multiple': _origin_multiple_doc, 'extra_arguments': _extra_arguments_doc, 'extra_keywords': _extra_keywords_doc, 'prefilter': _prefilter_doc } docfiller = doccer.filldoc(docdict)