Skip to main content
`Ctrl`+`K`

# DifferentialAttribute

class astropy.coordinates.DifferentialAttribute(default=None, allowed_classes=None, secondary_attribute='', **kwargs)

  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:
    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.

    doc `python:str`

      Description of the frame attribute for help and documentation

  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)

    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`, 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.