pvlib._deprecation.deprecated#
- pvlib._deprecation.deprecated(since, message='', name='', alternative='', pending=False, addendum='', removal='')[source]#
Decorator to mark a function or a class as deprecated.
- 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
%(name)s
may be used for the name of the object, and%(alternative)s
may be used in the deprecation message to insert the name of an alternative to the deprecated object.name (str, optional) –
The name of the deprecated object; if not provided the name is automatically determined from the passed in object, 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 API that the user may use in place of the deprecated API. The deprecation warning will tell the user about this alternative if provided.
pending (bool, optional) – If True, uses a PendingDeprecationWarning instead of a DeprecationWarning. Cannot be used together with removal.
removal (str, optional) – The expected removal version. With the default (an empty string), a removal version is automatically computed from since. Set to other Falsy values to not schedule a removal date. Cannot be used together with pending.
addendum (str, optional) – Additional text appended directly to the final message.
Examples
Basic example:
>>> @deprecated('1.4.0') >>> def the_function_to_deprecate(): >>> pass