deprecated#
- sunpy.util.deprecated(since, message='', name='', alternative='', obj_type=None, warning_type=<class 'sunpy.util.exceptions.SunpyDeprecationWarning'>)[source]#
Used to mark a function or class as deprecated.
To mark an attribute as deprecated, use deprecated_attribute.
- Parameters:
since (str) – The release at which this API became deprecated. This is required.
message (str, optional) – Override the default deprecation message. The format specifier
func
may be used for the name of the function, andalternative
may be used in the deprecation message to insert the name of an alternative to the deprecated function.obj_type
may be used to insert a friendly name for the type of object being deprecated.name (str, optional) – The name of the deprecated function or class; if not provided the name is automatically determined from the passed in function or class, though this is useful in the case of renamed functions, where the new function is just assigned to the name of the deprecated function. For example:
def new_function(): ... oldFunction = new_function
alternative (str, optional) – An alternative function or class name that the user may use in place of the deprecated object. The deprecation warning will tell the user about this alternative if provided.
obj_type (str, optional) – The type of this object, if the automatically determined one needs to be overridden.
warning_type (Warning) – Warning to be issued. Default is
SunpyDeprecationWarning
.