encode_astropy_cosmology¶ encode_astropy_cosmology(obj)[source]¶ Encode an astropy cosmology object to a dictionary. Adds the key __cosmology__ to the dictionary to indicate that the object is a cosmology object. Changed in version 2.5.0: Now uses the to_format("mapping") method to encode the cosmology object.