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__
andConfigNamespace.keys
now yieldConfigItem
names defined within it. Similarly,items
andvalues
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 asstring
instances. eg"17ยฐ53'27"W"
.[#9859]๐ Allow in-place modification of array-valued
Frame
andSkyCoord
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 likesc1 == 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
andDifferential
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 handlenames
,include_names
,exclude_names
arguments forRDB
formatted tables. Homogenised checks and exceptions for invalidnames
arguments. Improved performance when parsing "wide" tables with many columns. [#10306]โ Added type validation of key arguments in calls to
io.ascii.read()
andio.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
andPrimaryHDU
. [#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 andModel.coerce_units
to support units on otherwise unitless models. [#9936]โ Added
domain
andwindow
attributes torepr
andstr
. Fixed bug with_format_repr
in core.py. [#9941]Polynomial attributes
domain
andwindow
are now tuples of size 2 and are validated.repr
andprint
show only their non-default values. [#10145]โ Added
replace_submodel()
method toCompoundModel
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 forCCDData.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
anddescriptions
keyword arguments to the Table object initialization andTable.read()
methods. This allows directly setting theunit
anddescription
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 aRow
into a dictionary withdict(row)
. [#9712]โ Added two new
Table
methods.items()
and.values()
, which return respectivelytbl.columns.items()
(iterator over name, column tuples) andtbl.columns.values()
(list of columns) for aTable
objecttbl
. [#9780]โ Added new
Table
method.round()
, which rounds numeric columns to the specified number of decimals. [#9862]Updated
to_pandas()
andfrom_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 theh5py.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 indstack
,vstack
andinsert_row
functions. [#9857]โ Added support for coordinate
Representation
andDifferential
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 since1970-01-01 00:00:08 TAI
and corresponds to theCLOCK_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 toisclose
andallclose
, 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 wheredimensionless_unscaled
is an allowed unit. [#10232]
astropy.utils ^
- โ Added a new
MetaAttribute
class to support easily adding custom attributes to a subclass of classes likeTable
orNDData
that have ameta
attribute. [#10097]
astropy.visualization
- โ Added
invalid
keyword toSqrtStretch
,LogStretch
,PowerStretch
, andImageNormalize
classes and thesimple_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 callingpixel_to_world
instead ofQuantity
, and can now take eitherQuantity
orSpectralCoord
as input topixel_to_world
. [#10185]๐ Implemented support for the
-TAB
algorithm (WCS Paper III). [#9641]Added an
_as_mpl_axes
method to theHightLevelWCSWrapper
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 likesc1 == sc2
was previously equivalent tosc1 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 anobstime
directly when theSkyCoord
also has anobstime
set. In this situation, the position of theSkyCoord
has space motion applied to correct to the passedobstime
. This allows mm/s radial velocity precision for objects with large space motion. [#10094]For consistency with other astropy classes, coordinate
Representations
andDifferentials
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 theconverters
argument is provided (to specify column conversion functions). Previously theconverters
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 aunits
dictionary as argument to pass units for columns in theDataFrame
. [#9472]
โ astropy.tests ^
astropy.time ^
- Require that
in_subfmt
andout_subfmt
properties of aTime
object have allowed values at the time of being set, either when creating the object or when setting those properties on an existingTime
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 (forbz2
orlzma
/xz
support) toModuleNotFoundError
, consistent withio.fits
file handlers. [#9761]
astropy.visualization
Deprecated the
imshow_only_kwargs
keyword inimshow_norm
. [#9915]Non-finite input values are now automatically excluded in
HistEqStretch
andInvertedHistEqStretch
. [#10177]The
PowerDistStretch
andInvertedPowerDistStretch
a
value is restricted to bea >= 0
in addition toa != 1
. [#10177]๐ The
PowerStretch
,LogStretch
, andInvertedLogStretch
a
value is restricted to bea > 0
. [#10177]The
AsinhStretch
andSinhStretch
a
value is restricted to be0 < 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 callingpixel_to_world
instead ofQuantity
(note thatSpectralCoord
is a sub-class ofQuantity
). [#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
, andASTROPY_USE_SYSTEM_ALL
. These should be set to1
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
andpython 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 runtox -e test
andtox -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 apyproject.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]