astropy v4.1 Release Notes

Release Date: 2020-10-21 // over 3 years ago
  • ๐Ÿ†• New Features

    astropy.config ^

    • โž• Add new function generate_config to generate the configuration file and include it in the documentation. [#10148]

    • ConfigNamespace.__iter__ and ConfigNamespace.keys now yield ConfigItem names defined within it. Similarly, items and values would yield like a Python dictionary would. [#10139]

    astropy.constants

    astropy.convolution

    astropy.coordinates

    • โž• Added a new SpectralCoord class that can be used to define spectral coordinates and transform them between different velocity frames. [#10185]

    • ๐Ÿ“œ Angle parsing now supports cardinal direction in the cases where angles are initialized as string instances. eg "17ยฐ53'27"W".[#9859]

    • ๐Ÿ‘ Allow in-place modification of array-valued Frame and SkyCoord objects. This provides limited support for updating coordinate data values from another coordinate object of the same class and equivalent frame attributes. [#9857]

    • โž• Added a robust equality operator for comparing SkyCoord, frame, and representation objects. A comparison like sc1 == sc2 will now return a boolean or boolean array where the objects are strictly equal in all relevant frame attributes and coordinate representation values. [#10154]

    • โž• Added the True Equator Mean Equinox (TEME) frame. [#10149]

    • โœ… The Galactocentric frame will now use the "latest" parameter definitions by default. This currently corresponds to the values defined in v4.0, but will change with future releases. [#10238]

    • The SkyCoord.from_name() and Sesame name resolving functionality now is able to cache results locally and will do so by default. [#9162]

    • ๐Ÿ‘ Allow in-place modification of array-valued Representation and Differential objects, including of representations with attached differentials. [#10210]

    astropy.cosmology

    astropy.extern ^

    astropy.io.ascii ^

    • Functional Units can now be processed in CDS-tables. [#9971]

    • ๐Ÿ‘ Allow reading in ASCII tables which have duplicate column names. [#9939]

    • Fixed failure of ASCII fast_reader to handle names, include_names, exclude_names arguments for RDB formatted tables. Homogenised checks and exceptions for invalid names arguments. Improved performance when parsing "wide" tables with many columns. [#10306]

    • โž• Added type validation of key arguments in calls to io.ascii.read() and io.ascii.write() functions. [#10005]

    astropy.io.misc ^

    • โž• Added serialization of parameter constraints fixed and bounds. [#10082]

    • Added 'functional_models.py' and 'physical_models.py' to asdf/tags/transform, with to allow serialization of all functional and physical models. [#10028, #10293]

    • ๐Ÿ›  Fix ASDF serialization of circular model inverses, and remove explicit calls to asdf.yamlutil functions that became unnecessary in asdf 2.6.0. [#10189, #10384]

    astropy.io.fits ^

    • โž• Added support for writing Dask arrays to disk efficiently for ImageHDU and PrimaryHDU. [#9742]

    • โž• Add HDU name and ver to FITSDiff report where appropriate [#10197]

    astropy.io.registry

    astropy.io.votable

    • ๐Ÿ†• New exceptions.conf.max_warnings configuration item to control the number of times a type of warning appears before being suppressed. [#10152]

    astropy.modeling ^

    • โž• Added Plummer1D model to functional_models. [#9896]

    • โž• Added UnitsMapping model and Model.coerce_units to support units on otherwise unitless models. [#9936]

    • โž• Added domain and window attributes to repr and str. Fixed bug with _format_repr in core.py. [#9941]

    • Polynomial attributes domain and window are now tuples of size 2 and are validated. repr and print show only their non-default values. [#10145]

    • โž• Added replace_submodel() method to CompoundModel to modify an existing instance. [#10176]

    • Delay construction of CompoundModel inverse until property is accessed, to support ASDF deserialization of circular inverses in component models. [#10384]

    astropy.nddata ^

    • โž• Added support in the bitmask module for using mnemonic bit flag names when specifying the bit flags to be used or ignored when converting a bit field to a boolean. [#10095, #10208]

    • Added reshape_as_blocks function to reshape a data array into blocks, which is useful to efficiently apply functions on block subsets of the data instead of using loops. The reshaped array is a view of the input data array. [#10214]

    • โž• Added a cache keyword option to allow caching for CCDData.read if filename is a URL. [#10265]

    astropy.samp ^

    astropy.stats ^

    astropy.table ^

    • โž• Added ability to specify a custom matching function for table joins. In particular this makes it possible to do cross-match table joins on SkyCoord, Quantity, or standard columns, where column entries within a specified distance are considered to be matched. [#10169]

    • โž• Added units and descriptions keyword arguments to the Table object initialization and Table.read() methods. This allows directly setting the unit and description for the table columns at the time of creating or reading the table. [#9671]

    • ๐Ÿ‘‰ Make table Row work as mappings, by adding .keys() and .values() methods. With this **row becomes possible, as does, more simply, turning a Row into a dictionary with dict(row). [#9712]

    • โž• Added two new Table methods .items() and .values(), which return respectively tbl.columns.items() (iterator over name, column tuples) and tbl.columns.values() (list of columns) for a Table object tbl. [#9780]

    • โž• Added new Table method .round(), which rounds numeric columns to the specified number of decimals. [#9862]

    • Updated to_pandas() and from_pandas() to use and support Pandas nullable integer data type for masked integer data. [#9541]

    • The HDF5 writer, write_table_hdf5(), now allows passing through additional keyword arguments to the h5py.Group.create_dataset(). [#9602]

    • โž• Added capability to add custom table attributes to a Table subclass. These attributes are persistent and can be set during table creation. [#10097]

    • โž• Added support for SkyCoord mixin columns in dstack, vstack and insert_row functions. [#9857]

    • โž• Added support for coordinate Representation and Differential mixin columns. [#10210]

    โœ… astropy.tests ^

    astropy.time ^

    • โž• Added a new time format unix_tai which is essentially Unix time but with leap seconds included. More precisely, this is the number of seconds since 1970-01-01 00:00:08 TAI and corresponds to the CLOCK_TAI clock available on some linux platforms. [#10081]

    astropy.timeseries

    astropy.uncertainty

    astropy.units ^

    • โž• Added torr pressure unit. [#9787]

    • โž• Added the equal_nan keyword argument to isclose and allclose, and updated the docstrings. [#9849]

    • โž• Added Rankine temperature unit. [#9916]

    • โž• Added integrated flux unit conversion to spectral_density equivalency. [#10015]

    • ๐Ÿ”„ Changed pixel_scale equivalency to allow scales defined in any unit. [#10123]

    • The quantity_input decorator now optionally allows passing through numeric values or numpy arrays with numeric dtypes to arguments where dimensionless_unscaled is an allowed unit. [#10232]

    astropy.utils ^

    • โž• Added a new MetaAttribute class to support easily adding custom attributes to a subclass of classes like Table or NDData that have a meta attribute. [#10097]

    astropy.visualization

    • โž• Added invalid keyword to SqrtStretch, LogStretch, PowerStretch, and ImageNormalize classes and the simple_norm function. This keyword is used to replace generated NaN values. [#10182]

    astropy.wcs ^

    • WCS objects with a spectral axis will now return SpectralCoord objects when calling pixel_to_world instead of Quantity, and can now take either Quantity or SpectralCoord as input to pixel_to_world. [#10185]

    • ๐Ÿ‘ Implemented support for the -TAB algorithm (WCS Paper III). [#9641]

    • Added an _as_mpl_axes method to the HightLevelWCSWrapper class. [#10138]

    API Changes

    astropy.config ^

    astropy.constants

    astropy.convolution

    astropy.coordinates

    • The equality operator for comparing SkyCoord, frame, and representation objects was changed. A comparison like sc1 == sc2 was previously equivalent to sc1 is sc2. It will now return a boolean or boolean array where the objects are strictly equal in all relevant frame attributes and coordinate representation values. If the objects have different frame attributes or representation types then an exception will be raised. [#10154]

    • SkyCoord.radial_velocity_correction now allows you to pass an obstime directly when the SkyCoord also has an obstime set. In this situation, the position of the SkyCoord has space motion applied to correct to the passed obstime. This allows mm/s radial velocity precision for objects with large space motion. [#10094]

    • For consistency with other astropy classes, coordinate Representations and Differentials can now be initialized with an instance of their own class if that instance is passed in as the first argument. [#10210]

    astropy.cosmology

    astropy.extern ^

    astropy.io.ascii ^

    • ๐Ÿ”„ Changed the behavior when reading a table where both the names argument is provided (to specify the output column names) and the converters argument is provided (to specify column conversion functions). Previously the converters dict names referred to the input table column names, but now they refer to the output table column names. [#9739]

    astropy.io.misc ^

    astropy.io.fits ^

    astropy.io.registry

    astropy.io.votable

    astropy.modeling ^

    astropy.nddata ^

    astropy.samp ^

    astropy.stats ^

    astropy.table ^

    • ๐Ÿ‘ Table.from_pandas now supports a units dictionary as argument to pass units for columns in the DataFrame. [#9472]

    โœ… astropy.tests ^

    astropy.time ^

    • Require that in_subfmt and out_subfmt properties of a Time object have allowed values at the time of being set, either when creating the object or when setting those properties on an existing Time instance. Previously the validation of those properties was not strictly enforced. [#9868]

    astropy.timeseries

    astropy.uncertainty

    astropy.units ^

    astropy.utils ^

    • Changed the exception raised by get_readable_fileobj on missing compression modules (for bz2 or lzma/xz support) to ModuleNotFoundError, consistent with io.fits file handlers. [#9761]

    astropy.visualization

    • Deprecated the imshow_only_kwargs keyword in imshow_norm. [#9915]

    • Non-finite input values are now automatically excluded in HistEqStretch and InvertedHistEqStretch. [#10177]

    • The PowerDistStretch and InvertedPowerDistStretch a value is restricted to be a >= 0 in addition to a != 1. [#10177]

    • ๐Ÿ”Š The PowerStretch, LogStretch, and InvertedLogStretch a value is restricted to be a > 0. [#10177]

    • The AsinhStretch and SinhStretch a value is restricted to be 0 < a <= 1. [#10177]

    astropy.wcs ^

    ๐Ÿ› Bug Fixes

    astropy.config ^

    astropy.constants

    astropy.convolution

    astropy.coordinates

    astropy.cosmology

    astropy.extern ^

    astropy.io.ascii ^

    astropy.io.misc ^

    astropy.io.fits ^

    astropy.io.registry

    astropy.io.votable

    • For FIELDs with datatype="char", store the values as strings instead of bytes. [#9505]

    astropy.modeling ^ astropy.nddata ^

    astropy.samp ^

    astropy.stats ^

    astropy.table ^

    โœ… astropy.tests ^

    astropy.time ^

    astropy.timeseries

    astropy.uncertainty

    astropy.units ^

    astropy.utils ^

    astropy.visualization

    astropy.wcs ^

    • WCS objects with a spectral axis will now return SpectralCoord objects when calling pixel_to_world instead of Quantity (note that SpectralCoord is a sub-class of Quantity). [#10185]

    Other Changes and Additions

    • ๐Ÿ— The way in which users can specify whether to build astropy against existing installations of C libraries rather than the bundled one has changed, and should now be done via environment variables rather than setup.py flags (e.g. --use-system-erfa). The available variables are ASTROPY_USE_SYSTEM_CFITSIO, ASTROPY_USE_SYSTEM_ERFA, ASTROPY_USE_SYSTEM_EXPAT, ASTROPY_USE_SYSTEM_WCSLIB, and ASTROPY_USE_SYSTEM_ALL. These should be set to 1 to build against the system libraries. [#9730]

    • โšก๏ธ The infrastructure of the package has been updated in line with the APE 17 roadmap (https://github.com/astropy/astropy-APEs/blob/master/APE17.rst). The main changes are that the python setup.py test and python setup.py build_docs commands will no longer work. The easiest way to replicate these commands is to install the tox (https://tox.readthedocs.io) package and run tox -e test and tox -e build_docs. It is also possible to run pytest and sphinx directly. Other significant changes include switching to setuptools_scm to manage the version number, and adding a pyproject.toml to opt in to isolated builds as described in PEP 517/518. [#9726]

    • โšก๏ธ Bundled expat is updated to version 2.2.9. [#10038]

    • Increase minimum asdf version to 2.6.0. [#10189]

    • โšก๏ธ The bundled version of PLY was updated to 3.11. [#10258]

    • โœ‚ Removed dependency on scikit-image. [#10214]