DifferentialAttribute

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

Bases: astropy.coordinates.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:
default : object

Default value for the attribute if not provided

allowed_classes : tuple, optional

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

secondary_attribute : str

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(self, value) Checks that the input is a differential object and is one of the allowed class types.

Methods Documentation

convert_input(self, value)[source]

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

Parameters:
value : object

Input value.

Returns:
out, converted : correctly-typed object, boolean

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.