encode_astropy_unit¶ encode_astropy_unit(obj)[source]¶ Encode an astropy unit object to a dictionary. Adds the key __astropy_unit__ to the dictionary to indicate that the object is a unit object. Added in version 2.5.0.