DifferentialAttribute#

class astropy.coordinates.DifferentialAttribute(default=None, allowed_classes=None, secondary_attribute='')[source]#

Bases: Attribute

A frame attribute which is a differential instance.

The optional allowed_classes argument allows specifying a restricted set of valid differential classes to check the input against. Otherwise, any BaseDifferential subclass instance is valid.

Parameters:
defaultobject

Default value for the attribute if not provided

allowed_classestuple, optional

A list of allowed differential classes for this attribute to have.

secondary_attributestr

Name of a secondary instance attribute which supplies the value if default is None and no value was supplied during initialization.

Methods Summary

convert_input(value)

Checks that the input is a differential object and is one of the allowed class types.

Methods Documentation

convert_input(value)[source]#

Checks that the input is a differential object and is one of the allowed class types.

Parameters:
valueobject

Input value.

Returns:
out, convertedcorrectly-typed object, bool

Tuple consisting of the correctly-typed object and a boolean which indicates if conversion was actually performed.

Raises:
ValueError

If the input is not valid for this attribute.