Astropy UnitsΒΆ
Astropy units are the way that component dimensions are specified. If you look at the definition for almost any component, some of the arguments must be in certain units. For example, the position of a Flat Component must be in units of length. You can specify any units you want (1e-19 parsec, why not?) as long as they are in units of length.
Once a quantity with units is passed to the Component, they are immediately converted to default units (usually millimeters and radians, though there are some exceptions. Look for the default arguments, as these almost always have the default units attached.)
While they are stored by the component, they still have their units attached. But as soon as they are passed to a deeper function, only the value is passed. For example, there is no reference to units in any function in the Rays.py file. You can see this by looking at the rays.x parameter, for example. An array will be returned with no units attached, so it is up to the user to recognize that they are in the default units (millimeters).
One notable parameter is the wavelength of a Rays object. Looking at rays.wave will show that the default units are nanometers. However, when a wavelength is attached to a Source object, it can be in units of energy or length. If, for example, an energy of 1 eV was passed as the wavelength, it would be automatically converted to the wavelength (in nm) that a photon would need to have an energy of 1 eV.