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, anyBaseDifferential
subclass instance is valid.- Parameters:
- default
object
Default value for the attribute if not provided
- allowed_classes
python:tuple
, optional A list of allowed differential classes for this attribute to have.
- secondary_attribute
python:str
Name of a secondary instance attribute which supplies the value if
default is None
and no value was supplied during initialization.
- default
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:
- value
object
Input value.
- value
- Returns:
- out, convertedcorrectly-typed
object
, bool Tuple consisting of the correctly-typed object and a boolean which indicates if conversion was actually performed.
- out, convertedcorrectly-typed
- Raises:
ValueError
If the input is not valid for this attribute.