astropy/astropy — pull request #1419 by mhvk (2014-07-08 12:59:22+00:00)
Title: Cannot create Angle objects with decimal.Decimal

Angle constructors should be able to take `decimal.Decimal` objects.

from astropy.coordinates import Angle
import astropy.units as u
from decimal import Decimal

d = Decimal(12.34)

a = Angle(d, unit=u.degree)
print a.hms

This fails with:

ERROR: ValueError: Value not scalar compatible or convertable into a float or integer array [astropy.units.core]

It is, of course, pretty easily convertible into a float. Also, the word “convertable” is misspelled in the error above.