astropy 5.0

ParametersBackRef
deprecated_attribute(name, since, message=None, alternative=None, pending=False, warning_type=<class 'astropy.utils.exceptions.AstropyDeprecationWarning'>)

Parameters

name : str

The name of the deprecated attribute.

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 may be used for the name of the attribute, and alternative may be used in the deprecation message to insert the name of an alternative to the deprecated function.

alternative : str, optional

An alternative attribute that the user may use in place of the deprecated attribute. The deprecation warning will tell the user about this alternative if provided.

pending : bool, optional

If True, uses a AstropyPendingDeprecationWarning instead of warning_type .

warning_type : Warning

Warning to be issued. Default is ~astropy.utils.exceptions.AstropyDeprecationWarning .

Used to mark a public attribute as deprecated. This creates a property that will warn when the given attribute name is accessed. To prevent the warning (i.e. for internal code), use the private name for the attribute by prepending an underscore (i.e. self._name ).

Examples

class MyClass:

# Mark the old_name as deprecated old_name = misc.deprecated_attribute('old_name', '0.1')

def method(self):

self._old_name = 42

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

astropy.utils.decorators.deprecated

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /astropy/utils/decorators.py#209
type: <class 'function'>
Commit: