What’s New in Astropy 5.2?

Overview

Astropy 5.2 is a major release that adds significant new functionality since the 5.1 release.

In particular, this release includes:

Quantity data types

The default dtype argument for Quantity has been changed, so that one can now explicitly give dtype=None to get the same behaviour as numpy. Without an explicit argument, any integer values are still upcast to floating point, since that makes more sense for physical quantities.

Updates to astropy.cosmology

A new comparison function has been added – astropy.cosmology.cosmology_equal() – that mirrors its numpy counterparts but allows for the arguments to be converted to a Cosmology and to compare flat cosmologies with their non-flat equivalents.

>>> from astropy.cosmology import cosmology_equal
>>> from astropy.cosmology import FlatLambdaCDM, LambdaCDM
>>> cosmo1 = FlatLambdaCDM(70, 0.3)
>>> cosmo2 = LambdaCDM(70, 0.3, 0.7)
>>> cosmology_equal(cosmo1.to_format("mapping"), cosmo2,
...                 format=("mapping", None), allow_equivalent=True)
True

Full change log

To see a detailed list of all changes in version v5.2, including changes in API, please see the Full Changelog.

Renamed/removed functionality