bilby.core.utils.io.encode_astropy_unit

bilby.core.utils.io.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.