Astropy

Latest version: v6.1.0

Safety actively analyzes 634772 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 17

5.2.2

Not secure
==========================

Bug Fixes
---------

astropy.io.ascii
^^^^^^^^^^^^^^^^

- CDS and MRT tables with units that contain with multiple divisions, such as
``km/s/Mpc`` now parse correctly as being equal to ``km/(s.Mpc)``. [14369]

astropy.io.fits
^^^^^^^^^^^^^^^

- Fix ``FITSDiff`` when table contains a VLA column with the Q type. [14539]

astropy.table
^^^^^^^^^^^^^

- Fix a bug when creating a ``QTable`` when a ``Quantity`` input column is present and the
``units`` argument modifies the unit of that column. This now works as expected where
previously this caused an exception. [14357]

astropy.units
^^^^^^^^^^^^^

- CDS units with multiple divisions, such as ``km/s/Mpc`` now parse
correctly as being equal to ``km/(s.Mpc)``. [14369]

astropy.wcs
^^^^^^^^^^^

- Fixed a bug that caused subclasses of BaseHighLevelWCS and HighLevelWCSMixin to
not work correctly under certain conditions if they did not have ``world_n_dim``
and ``pixel_n_dim`` defined on them. [14495]

5.2.1

Not secure
==========================

Bug Fixes
---------

astropy.coordinates
^^^^^^^^^^^^^^^^^^^

- Fix to ITRS frame ``earth_location`` attribute to give the correct result for
a topocentric frame. [14180]

astropy.cosmology
^^^^^^^^^^^^^^^^^

- Bounds are no longer passed to the scipy minimizer for methods Brent and
Golden. The scipy minimizer never used the bounds but silently accepted them.
In scipy v1.11.0.dev0+ an error is raised, so we now pass None as the bounds
to the minimizer. Users should not be affected by this change. [14232]

astropy.io.fits
^^^^^^^^^^^^^^^

- Tables with multidimensional variable length array can now be properly read
and written. [13417]

astropy.units
^^^^^^^^^^^^^

- Modified the behavior of ``numpy.histogram()``,
``numpy.histogram_bin_edges()``, ``numpy.histogram2d()``, and
``numpy.histogramdd()`` so that the ``range`` argument must a compatible
instance of ``astropy.units.Quantity`` if the other arguments are instances of
``astropy.units.Quantity``. [14213]

astropy.visualization
^^^^^^^^^^^^^^^^^^^^^

- Improved the performance of drawing WCSAxes grids by skipping some unnecessary
computations. [14164]

- Fixed WCSAxes sometimes triggering a NumPy RuntimeWarning when determining the
coordinate range of the axes. [14211]

Other Changes and Additions
---------------------------

- Fix compatibility with Numpy 1.24. [14193]

5.2

Not secure
========================

New Features
------------

astropy.coordinates
^^^^^^^^^^^^^^^^^^^

- Adds new topocentric ITRS frame and direct transforms to and from the observed
frames ``AltAz`` and ``HADec`` with the ability to add or remove refraction
corrections as required. Since these frames are all within the ITRS, there are
no corrections applied other than refraction in the transforms. This makes the
topocentric ITRS frame and these transforms convenient for observers of near
Earth objects where stellar aberration should be omitted. [13398]

- Allow comparing ``SkyCoord`` to frames with data. [13477]

astropy.cosmology
^^^^^^^^^^^^^^^^^

- Cosmology instance can be parsed from or converted to a HTML table using
the new HTML methods in Cosmology's ``to/from_format`` I/O. [13075]

- A new comparison function has been added -- ``cosmology_equal()`` -- that
mirrors its ``numpy`` counterpart but allows for the arguments to be converted
to a ``Cosmology`` and to compare flat cosmologies with their non-flat
equivalents. [13104]

- Cosmology equivalence for flat FLRW cosmologies has been generalized to apply
to all cosmologies using the FlatCosmology mixin. [13261]

- The cosmological redshift unit now has a physical type of ``"redshift"``. [13561]

astropy.io.ascii
^^^^^^^^^^^^^^^^

- Add ability to read and write a fixed width ASCII table that includes additional
header rows specifying any or all of the column dtype, unit, format, and
description. This is available in the ``fixed_width`` and
``fixed_width_two_line`` formats via the new ``header_rows`` keyword argument. [13734]

astropy.io.fits
^^^^^^^^^^^^^^^

- Added support to the ``io.fits`` API for reading and writing file paths of the
form ``~/file.fits`` or ``~<username>/file.fits``, referring to the home
directory of the current user or the specified user, respectively. [13131]

- Added support for opening remote and cloud-hosted FITS files using the
``fsspec`` package, which has been added as an optional dependency. [13238]

astropy.io.votable
^^^^^^^^^^^^^^^^^^

- Added support in ``io.votable`` for reading and writing file paths of the form
``~/file.xml`` or ``~<username>/file.xml``, referring to the home directory of
the current user or the specified user, respectively. [13149]

astropy.modeling
^^^^^^^^^^^^^^^^

- Add option to non-linear fitters which enables automatic
exclusion of non-finite values from the fit data. [13259]

astropy.nddata
^^^^^^^^^^^^^^

- Modified ``Cutout2D`` to allow objects of type ``astropy.io.fits.Section``
to be passed to the ``data`` parameter. [13238]

- Add a PSF image representation to ``astropy.nddata.NDData`` and ``astropy.nddata.CCDData``. [13743]

astropy.table
^^^^^^^^^^^^^

- An Astropy table can now be converted to a scalar NumPy object array. For NumPy
>= 1.20, a list of Astropy tables can be converted to an NumPy object array of
tables. [13469]

astropy.time
^^^^^^^^^^^^

- Added the ``astropy.time.Time.mean()`` method which also enables the ``numpy.mean()`` function to be used on instances of ``astropy.time.Time``. [13508]

- Improve the performance of getting the string representation of a large ``Time``
or ``TimeDelta`` object. This is done via a new ``to_string()`` method that does
the time string format conversion only for the outputted values. Previously the
entire array was formatted in advance. [13555]

astropy.units
^^^^^^^^^^^^^

- It is now possible to use unit format names as string format specifiers for a
``Quantity``, e.g. ``f'{1e12*u.m/u.s:latex_inline}'`` now produces the string
``'$1 \\times 10^{12} \\; \\mathrm{m\\,s^{-1}}$'``. [13050]

- Ensure that the ``argmin`` and ``argmax`` methods of ``Quantity`` support the
``keepdims`` argument when numpy does (numpy version 1.22 and later). [13329]

- ``numpy.lib.recfunctions.merge_arrays()`` is registered with numpy overload for
``Quantity``. [13669]

- Added SI prefixes for quecto ("q", :math:`10^{-30}`), ronto ("r",
:math:`10^{-27}`), ronna ("R", :math:`10^{27}`), and quetta ("Q",
:math:`10^{30}`). [14046]

astropy.utils
^^^^^^^^^^^^^

- Added the ``use_fsspec``, ``fsspec_kwargs``, and ``close_files`` arguments
to ``utils.data.get_readable_fileobj``. [13238]

- Ensure that the ``argmin`` and ``argmax`` methods of ``Masked`` instances
support the ``keepdims`` argument when numpy does (numpy version 1.22 and
later). [13329]

astropy.visualization
^^^^^^^^^^^^^^^^^^^^^

- Add helper functions for WCSAxes instances to draw the instrument beam and a physical scale. [12102]

- Add a ``scatter_coord`` method to the ``wcsaxes`` functionality based on the
existing ``plot_coord`` method but that calls ``matplotlib.pyplot.scatter``. [13562]

- Added a ``sinh`` stretch option to ``simple_norm``. [13746]

- It is now possible to define "tickable" gridlines for the purpose of placing ticks or tick labels in the interior of WCSAxes plots. [13829]


API Changes
-----------

astropy.convolution
^^^^^^^^^^^^^^^^^^^

- Removed deprecated ``MexicanHat1DKernel`` and ``MexicanHat2DKernel``
classes. Please use ``RickerWavelet1DKernel`` and
``RickerWavelet2DKernel`` instead. [13300]

astropy.units
^^^^^^^^^^^^^

- Multiplying a ``LogQuantity`` like ``Magnitude`` with dimensionless physical
units by an array will no longer downcast to ``Quantity``. [12579]

- Quantity normally upcasts integer dtypes to floats, unless the dtype is
specifically provided.
Before this happened when ``dtype=None``; now the default has been changed to
``dtype=numpy.inexact`` and ``dtype=None`` has the same meaning as in `numpy`. [12941]

- In "in-place unit changes" of the form ``quantity <<= new_unit``, the result
will now share memory with the original only if the conversion could be done
through a simple multiplication with a scale factor. Hence, memory will not be
shared if the quantity has integer dtype or is structured, or when the
conversion is through an equivalency. [13638]

- When ``Quantity`` is constructed from a structured array and ``unit`` is
``None``, the default unit is now structured like the input data. [13676]

astropy.utils
^^^^^^^^^^^^^

- ``astropy.utils.misc.suppress`` has been removed, use ``contextlib.suppress``
instead. ``astropy.utils.namedtuple_asdict`` has been removed, instead use
method ``._asdict`` on a ``namedtuple``. ``override__dir__`` has been deprecated
and will be removed in a future version, see the docstring for the better
alternative. [13636]

- ``astropy.utils.misc.possible_filename`` has been removed. [13661]

astropy.visualization
^^^^^^^^^^^^^^^^^^^^^

- Rename number-of-samples keyword ``nsamples`` in ``ZScaleInterval`` to align
with the ``n_samples`` keyword used in all other ``Interval`` classes in
this module. [13810]


Bug Fixes
---------

astropy.convolution
^^^^^^^^^^^^^^^^^^^

- Fixed convolution Kernels to ensure the that returned kernels
are normalized to sum to one (e.g., ``Gaussian1DKernel``,
``Gaussian2DKernel``). Also fixed the Kernel ``truncation`` calculation. [13299]

- Fix import error with setuptools v65.6.0 by replacing
``numpy.ctypeslib.load_library`` with Cython to load the C convolution
extension. [14035]

astropy.coordinates
^^^^^^^^^^^^^^^^^^^

- ``BaseCoordinateFrame.get_frame_attr_names()`` had a misleading name,
because it actually provided a ``dict`` of attribute names and
their default values. It is now deprecated and replaced by ``BaseCoordinateFrame.get_frame_attr_defaults()``.
The fastest way to obtain the attribute names is ``BaseFrame.frame_attributes.keys()``. [13484]

- Fixed bug that caused ``earth_orientation.nutation_matrix()`` to error instead of returning output. [13572]

- Ensure that ``angle.to_string()`` continues to work after pickling,
and that units passed on to ``to_string()`` or the ``Angle``
initializer can be composite units (like ``u.hour**1``), which might
result from preceding calculations. [13933]

astropy.io.fits
^^^^^^^^^^^^^^^

- ``report_diff_values()`` have now two new parameters ``rtol`` and ``atol`` to make the
report consistent with ``numpy.allclose`` results.
This fixes ``FITSDiff`` with multi-dimensional columns. [13465]

astropy.io.votable
^^^^^^^^^^^^^^^^^^

- Fixed two bugs in validator.validator.make_validation_report:
- ProgressBar iterator was not called correctly.
- make_validation_report now handles input string urls correctly. [14102]

astropy.timeseries
^^^^^^^^^^^^^^^^^^

- Fixed a performance regression in ``timeseries.aggregate_downsample``
introduced in Astropy 5.0 / 11266. [13069]

astropy.units
^^^^^^^^^^^^^

- Unit changes of the form ``quantity <<= new_unit`` will now work also if the
quantity is integer. The result will always be float. This means that the result
will not share memory with the original. [13638]

- Ensure dimensionless quantities can be added inplace to regular ndarray. [13913]

astropy.utils
^^^^^^^^^^^^^

- Fixed an incompatibility with latest Python 3.1x versions that kept
``astropy.utils.data.download_file`` from switching to TLS+FTP mode. [14092]

- ``np.quantile`` and ``np.percentile`` can now be used on ``Masked``
arrays and quantities also with ``keepdims=True``. [14113]

astropy.visualization
^^^^^^^^^^^^^^^^^^^^^

- Significantly improve performance of ``ManualInterval`` when both limits
are specified manually. [13898]


Other Changes and Additions
---------------------------

- The deprecated private ``astropy._erfa`` module has been removed. Use
``pyerfa``, which is a dependency of ``astropy`` and can be imported directly
using ``import erfa``. [13317]

- The minimum version required for numpy is now 1.20 and that for scipy 1.5. [13885]

- Updated the bundled CFITSIO library to 4.2.0. [14020]

5.1.1

Not secure
==========================

API Changes
-----------

astropy.wcs
^^^^^^^^^^^

- The ``pixel`` argument to ``astropy.visualization.wcsaxes.ticklabels.TickLabels.add``
no longer does anything, is deprecated, and will be removed in a future
astropy version. It has been replaced by a new required ``data`` argument, which
should be used to specify the data coordinates of the tick label being added.

This changes has been made because it is (in general) not possible to correctly
calculate pixel coordinates before Matplotlib is drawing a figure. [12630]


Bug Fixes
---------

astropy.coordinates
^^^^^^^^^^^^^^^^^^^

- Fixed a bug that prevented ``SkyOffsetFrame`` instances to be pickled by adding
a custom ``__reduce__`` method to the class (see issue 9249). [13305]

- Fixed the check for invalid ``Latitude`` values for float32 values.
``Latitude`` now accepts the float32 value of pi/2, which was rejected
before because a comparison was made using the slightly smaller float64 representation.
See issue 13708. [13745]

astropy.io.ascii
^^^^^^^^^^^^^^^^

- Fixed confusing chained exception messages of ``read()`` function when it fails. [13170]

- When writing out a :class:`~astropy.table.Table` to HTML format, the
``formats`` keyword argument to the :meth:`~astropy.table.Table.write` method
will now be applied. [13453]

astropy.io.fits
^^^^^^^^^^^^^^^

- ``heapsize`` is now checked for VLA tables. An error is thrown whether P format is used
but the heap size is bigger than what can be indexed with a 32 bit signed int. [13429]

- Fix parsing of ascii TFORM when precision is missing. [13520]

- A compressed image HDU created from the header of a PRIMARY HDU, now correctly updates
'XTENSION' and 'SIMPLE' keywords. [13557]

- Empty variable-length arrays are now properly handled when pathological combinations of
heapoffset and heapsize are encountered. [13621]

- ``PCOUNT`` and ``GCOUNT`` keywords are now removed from an uncompressed Primary header,
for compliance with ``fitsverify`` behavior. [13753]

astropy.modeling
^^^^^^^^^^^^^^^^

- Bugfix for using ``MagUnit`` units on model parameters. [13158]

- Fix bug in using non-linear fitters to fit 0-degree polynomials using weights. [13628]

astropy.table
^^^^^^^^^^^^^

- Fix a problem where accessing one field of a structured column returned a Column
with the same info as the original column. This resulted in unintuitive behavior
in general and an exception if the format for the column was set. [13269]

- Tables with columns with structured data can now be properly stacked and joined. [13306]

- Update jQuery to 3.6.0, to pick up security fixes. [13438]

- Fix a Python 3.11 compatibility issue. Ensure that when removing a table column
that the ``pprint_include_names`` or ``pprint_exclude_names`` attributes get
updated correctly. [13639]

- When using ``add_columns`` with same indexes in ``indexes`` option or without
specifying the option, the order of the new columns will now be kept. [13783]

- Fix a bug when printing or getting the representation of a multidimensional
table column that has a zero dimension. [13838]

- Ensure that mixin columns and their ``info`` are not shared between tables
even when their underlying data is shared with ``copy=False``. [13842]

astropy.time
^^^^^^^^^^^^

- Fix ``Time.insert()`` on times which have their ``out_subfmt`` set. [12732]

- Prevent ``Time()`` from being initialized with an invalid precision
leading to incorrect results when representing the time as a string. [13068]

- Fix a bug in Time where a date string like "2022-08-01.123" was being parsed
as an ISO-format time "2022-08-01 00:00:00.123". The fractional part at the
end of the string was being taken as seconds. Now this raises an exception
because the string is not in ISO format. [13731]

astropy.units
^^^^^^^^^^^^^

- Significantly improved the performance of parsing composite units with the FITS
format, by ensuring the ``detailed_exception`` argument is properly passed on
and thus used. [12699]

- Ensure that ``np.concatenate`` on quantities can take a ``dtype`` argument (added in numpy 1.20). [13323]

- Ensure that the units of any ``initial`` argument to reductions such as
``np.add.reduce`` (which underlies ``np.sum``) are properly taken into account. [13340]

astropy.utils
^^^^^^^^^^^^^

- Ensure that ``np.concatenate`` on masked data can take a ``dtype`` argument (added in numpy 1.20). [13323]

- Fix error when suppressing download progress bar while using non-default
``sys.stdout`` stream. [13352]

- Ensure ``str`` and ``repr`` work properly for ``Masked`` versions of
structured subarrays. [13404]

- If an attribute is created using ``deprecated_attribute()`` with the
``alternative`` argument then getting or setting the value of the deprecated
attribute now accesses its replacement. [13824]

astropy.visualization
^^^^^^^^^^^^^^^^^^^^^

- Fixed calling ``.tight_layout()`` on a WCSAxes. [12418]

astropy.wcs
^^^^^^^^^^^

- ``WCS.pixel_to_world`` now creates an ``EarthLocation`` object using ``MJD-AVG``
if present before falling back to the old behaviour of using ``MJD-OBS``. [12598]

- The locations of ``WCSAxes`` ticks and tick-labels are now correctly calculated
when the DPI of a figure changes between a WCSAxes being created and the figure
being drawn, or when a rasterized artist is added to the WCSAxes. [12630]

- Fix a bug where ``SlicedLowLevelWCS.world_to_pixel_values`` would break when
the result of the transform is dependent on the coordinate of a sliced out
pixel. [13579]

- Updated bundled WCSLIB version to 7.12. This update includes bug fixes to
``wcssub()`` in how it handles temporal axes with -TAB and fixes handling
of status returns from ``linp2x()`` and ``linx2p()`` relating to distortion
functions, in particular affecting TPV distortions - see 13509. For a full
list of changes - see http://www.atnf.csiro.au/people/mcalabre/WCS/CHANGES or
`astropy/cextern/wcslib/CHANGES <https://github.com/astropy/astropy/blob/24e8730c63902d035cb9110eae2a9ebec12d8905/cextern/wcslib/CHANGES>`_. [#13635]

- Fixed WCS validation not working properly if HDUList is needed
for multi-extension FITS file. [13668]


Other Changes and Additions
---------------------------

- Development wheels of astropy should now be installed from
https://pypi.anaconda.org/astropy/simple instead of from
https://pkgs.dev.azure.com/astropy-project/astropy/_packaging/nightly/pypi/simple. [#13431]

- Compatibility with Python 3.11, 3.10.7, 3.9.14, 3.8.14 [13614]

5.1

Not secure
========================

New Features
------------

astropy.coordinates
^^^^^^^^^^^^^^^^^^^

- The ephemeris used in ``astropy.coordinates`` can now be set to any version of
the JPL ephemeris available from https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/. [#12541]

- ``Angle.to_string()`` now accepts the ``'latex_inline'`` unit format. [13056]

astropy.cosmology
^^^^^^^^^^^^^^^^^

- Cosmology instance can be parsed from or converted to a YAML string using
the new "yaml" format in Cosmology's ``to/from_format`` I/O. [12279]

- Register "astropy.row" into Cosmology's to/from format I/O, allowing a
Cosmology instance to be parse from or converted to an Astropy Table Row. [12313]

- A method ``clone`` has been added to ``Parameter`` to quickly deep copy the
object and change any constructor argument.
A supporting equality method is added, and ``repr`` is enhanced to be able to
roundtrip -- ``eval(repr(Parameter()))`` -- if the Parameter's arguments can
similarly roundtrip.
Parameter's arguments are made keyword-only. [12479]

- Add methods ``Otot`` and ``Otot0`` to FLRW cosmologies to calculate the total
energy density of the Universe. [12590]

- Add property ``is_flat`` to cosmologies to calculate the curvature of the Universe.
``Cosmology`` is now an abstract class and subclasses must override the
abstract property ``is_flat``. [12606]

- For converting a cosmology to a mapping, two new boolean keyword arguments are
added: ``cosmology_as_str`` for turning the class reference to a string,
instead of the class object itself, and ``move_from_meta`` to merge the
metadata with the rest of the returned mapping instead of adding it as a
nested dictionary. [12710]

- Register format "astropy.cosmology" with Cosmology I/O. [12736]

- Cosmological equivalency (``Cosmology.is_equivalent``) can now be extended
to any Python object that can be converted to a Cosmology, using the new
keyword argument ``format``.
This allows e.g. a properly formatted Table to be equivalent to a Cosmology. [12740]

- The new module ``cosmology/tests/helper.py`` has been added to provide tools
for testing the cosmology module and related extensions. [12966]

- A new property ``nonflat`` has been added to flat cosmologies
(``FlatCosmologyMixin`` subclasses) to get an equivalent cosmology, but of the
corresponding non-flat class. [13076]

- ``clone`` has been enhanced to allow for flat cosmologies to clone on the
equivalent non-flat cosmology. [13099]

- ``cosmology`` file I/O uses the Unified Table I/O interface, which has added
support for reading and writing file paths of the form ``~/file.ecsv`` or
``~<username>/file.ecsv``, referring to the home directory of the current user
or the specified user, respectively. [13129]

astropy.io.ascii
^^^^^^^^^^^^^^^^

- Simplify the way that the ``converters`` argument of ``io.ascii.read`` is
provided. Previously this required wrapping each data type as the tuple returned
by the ``io.ascii.convert_numpy()`` function and ensuring that the value is a
``list``. With this update you can write ``converters={'col1': bool}`` to force
conversion as a ``bool`` instead of the previous syntax ``converters={'col1':
[io.ascii.convert_numpy(bool)]}``. Note that this update is back-compatible with
the old behavior. [13073]

- Added support in ``io.ascii`` for reading and writing file paths of the form
``~/file.csv`` or ``~<username>/file.csv``, referring to the home directory of
the current user or the specified user, respectively. [13130]

astropy.io.fits
^^^^^^^^^^^^^^^

- Add option ``unit_parse_strict`` to ``astropy.io.fits.connect.read_table_fits``
to enable warnings or errors about invalid FITS units when using ``astropy.table.Table.read``.
The default for this new option is ``"warn"``, which means warnings are now raised for
columns with invalid units. [11843]

- Changes default FITS behavior to use buffered I/O
rather than unbuffered I/O for performance reasons. [12081]

- ``astropy.io.fits.Header`` now has a method to calculate the size
(in bytes) of the data portion (with or without padding) following
that header. [12110]

astropy.io.misc
^^^^^^^^^^^^^^^

- Allow serialization of model unit equivalencies. [10198]

- Built-in Cosmology subclasses can now be converted to/from YAML with the
functions ``dump`` and ``load`` in ``astropy.io.misc.yaml``. [12279]

- Add asdf support for ``Cosine1D``, ``Tangent1D``, ``ArcSine1D``,
``ArcCosine1D``, and ``ArcTangent1D`` models. [12895]

- Add asdf support for ``Spline1D`` models. [12897]

astropy.io.registry
^^^^^^^^^^^^^^^^^^^

- Added support to the Unified Table I/O interface for reading and writing file
paths of the form ``~/file.csv`` or ``~<username>/file.csv``, referring to the
home directory of the current user or the specified user, respectively. [13129]

astropy.modeling
^^^^^^^^^^^^^^^^

- Add new fitters based on ``scipy.optimize.least_squares`` method of non-linear
least-squares optimization: [12051]

- ``TRFLSQFitter`` using the Trust Region Reflective algorithm.
- ``LMLSQFitter`` using the Levenberg-Marquardt algorithm (implemented by ``scipy.optimize.least_squares``).
- ``DogBoxLSQFitter`` using the dogleg algorithm.

- Enable direct use of the ``ignored`` feature of ``ModelBoundingBox`` by users in
addition to its use as part of enabling ``CompoundBoundingBox``. [12384]

- Switch ``modeling.projections`` to use ``astropy.wcs.Prjprm`` wrapper internally and provide access to the ``astropy.wcs.Prjprm`` structure. [12558]

- Add error to non-finite inputs to the ``LevMarLSQFitter``, to protect against soft scipy failure. [12811]

- Allow the ``Ellipse2D`` and ``Sersic2D`` theta parameter to be input as
an angular quantity. [13030]

- Added ``Schechter1D`` model. [13116]

astropy.nddata
^^^^^^^^^^^^^^

- Add support for converting between uncertainty types. This uncertainty
conversion system uses a similar flow to the coordinate subsystem, where
Cartesian is used as the common system. In this case, variance is used as the
common system. [12057]

- The ``as_image_hdu`` option is now available for ``CCDData.to_hdu`` and
``CCDData.write``. This option allows the user to get an ``ImageHDU`` as the
first item of the returned ``HDUList``, instead of the default ``PrimaryHDU``. [12962]

- File I/O through ``nddata.CCDData`` uses the Unified I/O interface, which has
added support for reading and writing file paths of the form ``~/file.csv`` or
``~<username>/file.csv``, referring to the home directory of the current user
or the specified user, respectively. [13129]

astropy.table
^^^^^^^^^^^^^

- A new keyword-only argument ``kind`` was added to the ``Table.sort`` method to
specify the sort algorithm. [12637]

- Columns which are ``numpy`` structured arrays are now fully supported,
effectively allowing tables within tables. This applies to ``Column``,
``MaskedColumn``, and ``Quantity`` columns. These structured data columns
can be stored in ECSV, FITS, and HDF5 formats. [12644]

- Improve the performance of ``np.searchsorted`` by a factor of 1000 for a
bytes-type ``Column`` when the search value is ``str`` or an array of ``str``.
This happens commonly for string data stored in FITS or HDF5 format files. [12680]

- Add support for using mixin columns in group aggregation operations when the
mixin supports the specified operation (e.g. ``np.sum`` works for ``Quantity``
but not ``Time``). In cases where the operation is not supported the code now
issues a warning and drops the column instead of raising an exception. [12825]

- Added support to the Unified Table I/O interface for reading and writing file
paths of the form ``~/file.csv`` or ``~<username>/file.csv``, referring to the
home directory of the current user or the specified user, respectively. [13129]

astropy.time
^^^^^^^^^^^^

- Add support for calling ``numpy.linspace()`` with two ``Time`` instances to
generate a or multiple linearly spaced set(s) of times. [13132]

astropy.units
^^^^^^^^^^^^^

- ``structured_to_unstructured`` and ``unstructured_to_structured`` in
``numpy.lib.recfunctions`` now work with Quantity. [12486]

- Implement multiplication and division of LogQuantities and numbers [12566]

- New ``doppler_redshift`` equivalency to convert between
Doppler redshift and radial velocity. [12709]

- Added the ``where`` keyword argument to the ``mean()``,``var()``, ``std()`` and ``nansum()`` methods of
``astropy.units.Quantity``. Also added the ``initial`` keyword argument to ``astropy.units.Quantity.nansum()``. [12891]

- Added "Maxwell" as a unit for magnetic flux to the CGS module. [12975]

- ``Quantity.to_string()`` and ``FunctionUnitBase.to_string()`` now accept the
``'latex_inline'`` unit format. The output of ``StructuredUnit.to_string()``
when called with ``format='latex_inline'`` is now more consistent with the
output when called with ``format='latex'``. [13056]

astropy.utils
^^^^^^^^^^^^^

- Added the ``where`` keyword argument to the ``mean()``, ``var()``, ``std()``, ``any()``, and ``all()`` methods of
``astropy.utils.masked.MaskedNDArray``. [12891]

- Improve handling of unavailable IERS-A (predictive future Earth rotation) data
in two ways. First, allow conversions with degraded accuracy if the IERS-A data
are missing or do not cover the required time span. This is done with a new
config item ``conf.iers_degraded_accuracy`` which specifies the behavior when
times are outside the range of IERS table. The options are 'error' (raise an
``IERSRangeError``, default), 'warn' (issue a ``IERSDegradedAccuracyWarning``)
or 'ignore' (ignore the problem). Second, the logic for auto-downloads was
changed to guarantee that no matter what happens with the IERS download
operations, only warnings will be issued. [13052]

astropy.wcs
^^^^^^^^^^^

- ``astropy.wcs.Celprm`` and ``astropy.wcs.Prjprm`` have been added
to allow access to lower level WCSLIB functionality and to allow direct
access to the ``cel`` and ``prj`` members of ``Wcsprm``. [12514]

- Add ``temporal`` properties for convenient access of/selection of/testing for
the ``TIME`` axis introduced in WCSLIB version 7.8. [13094]

API Changes
-----------

astropy.coordinates
^^^^^^^^^^^^^^^^^^^

- The ``dms_to_degrees`` and ``hms_to_hours`` functions (and implicitly
tuple-based initialization of ``Angle``) is now deprecated, as it was
difficult to be sure about the intent of the user for signed values of
the degrees/hours, minutes, and seconds. [13162]

astropy.cosmology
^^^^^^^^^^^^^^^^^

- The already deprecated ``Planck18_arXiv_v2`` has been removed.
Use ``Planck18`` instead [12354]

- ``default_cosmology.get_cosmology_from_string`` is deprecated and will be
removed in two minor versions.
Use ``getattr(astropy.cosmology, <str>)`` instead. [12375]

- In I/O, conversions of Parameters move more relevant information from the
Parameter to the Column.
The default Parameter ``format_spec`` is changed from ``".3g"`` to ``""``. [12612]

- Units of redshift are added to ``z_reion`` in built-in realizations' metadata. [12624]

- Cosmology realizations (e.g. ``Planck18``) and parameter dictionaries are now
lazily loaded from source files. [12746]

- The Cosmology Parameter argument "fmt" for specifying a format spec
has been deprecated in favor of using the built-in string representation from
the Parameter's value's dtype. [13072]

astropy.io.ascii
^^^^^^^^^^^^^^^^

- When reading an ECSV file, changed the type checking
to issue an ``InvalidEcsvDatatypeWarning`` instead of raising a ``ValueError``
exception if the ``datatype`` of a column is not recognized in the ECSV standard.
This also applies to older versions of ECSV files which used to silently
proceed but now warn first. [12841]

astropy.io.fits
^^^^^^^^^^^^^^^

- Removed deprecated ``clobber`` argument from functions in ``astropy.io.fits``. [12258]

- Add ``-s/--sort`` argument to ``fitsheader`` to sort the fitsort-mode output. [13106]

astropy.io.misc
^^^^^^^^^^^^^^^

- Deprecate asdf in astropy core in favor of the asdf-astropy package. [12903, 12930]

astropy.modeling
^^^^^^^^^^^^^^^^

- Made ``astropy.modeling.fitting._fitter_to_model_params`` and ``astropy.modeling.fitting._model_to_fit_params``
public methods. [12585]

astropy.table
^^^^^^^^^^^^^

- Change the repr of the Table object to replace embedded newlines and tabs with
``r'\n'`` and ``r'\t'`` respectively. This improves the display of such tables. [12631]

- A new keyword-only argument ``kind`` was added to the ``Table.sort`` method to
specify the sort algorithm. The signature of ``Table.sort`` was modified so that
the ``reverse`` argument is now keyword-only. Previously ``reverse`` could be
specified as the second positional argument. [12637]

- Changed behavior when a structured ``numpy.ndarray`` is added as a column to a
``Table``. Previously this was converted to a ``NdarrayMixin`` subclass of
``ndarray`` and added as a mixin column. This was because saving as a file (e.g.
HDF5, FITS, ECSV) was not supported for structured array columns. Now a
structured ``numpy.ndarray`` is added to the table as a native ``Column`` and
saving to file is supported. [13236]

astropy.tests
^^^^^^^^^^^^^

- Backward-compatible import of ``astropy.tests.disable_internet``
has been removed; use ``pytest_remotedata.disable_internet``
from ``pytest-remotedata`` instead. [12633]

- Backward-compatible import of ``astropy.tests.helper.remote_data``
has been removed; use ``pytest.mark.remote_data`` from ``pytest-remotedata``
instead. [12633]

- The following are deprecated and will be removed in a future release.
Use ``pytest`` warning and exception handling instead: [12633]

* ``astropy.io.ascii.tests.common.raises``
* ``astropy.tests.helper.catch_warnings``
* ``astropy.tests.helper.ignore_warnings``
* ``astropy.tests.helper.raises``
* ``astropy.tests.helper.enable_deprecations_as_exceptions``
* ``astropy.tests.helper.treat_deprecations_as_exceptions``

- Backward-compatible plugin ``astropy.tests.plugins.display``
has been removed; use ``pytest-astropy-header`` instead. [12633]

astropy.time
^^^^^^^^^^^^

- Creating an `~astropy.time.TimeDelta` object with numerical inputs
that do not have a unit and without specifying an explicit format,
for example ``TimeDelta(5)``,
now results in a `~astropy.time.TimeDeltaMissingUnitWarning`.
This also affects statements like ``Time("2020-01-01") + 5`` or
``Time("2020-01-05") - Time("2020-01-03") < 5``, which implicitly
transform the right-hand side into an `~astropy.time.TimeDelta` instance. [12888]

Bug Fixes
---------

astropy.coordinates
^^^^^^^^^^^^^^^^^^^

- The machinery that makes observatory locations available as ``EarthLocation``
objects is now smarter about processing observatory names from its data files.
More names are available for use and the empty string is no longer considered
to be a valid name. [12721]

astropy.io.ascii
^^^^^^^^^^^^^^^^

- Fixed ``io.ascii`` read and write functions for most formats to correctly handle
data fields with embedded newlines for both the fast and pure-Python readers and
writers. [12631]

- Fix an issue when writing ``Time`` table columns to a file when the time
``format`` is one of ``datetime``, ``datetime64``, or ``ymdhms``. Previously,
writing a ``Time`` column with one of these formats could result in an exception
or else an incorrect output file that cannot be read back in. [12842]

astropy.io.fits
^^^^^^^^^^^^^^^

- Add a ``mask_invalid`` option to ``Table.read`` to allow deactivating the
masking of NaNs in float columns and empty strings in string columns. This
option is necessary to allow effective use of memory-mapped reading with
``memmap=True``. [12544]

- Fix ``CompImageHeader.clear()``. [13102]

astropy.modeling
^^^^^^^^^^^^^^^^

- Bugfix for ``ignore`` functionality failing in ``ModelBoundingBox`` when using
``ignore`` option alongside passing bounding box data as tuples. [13032]

astropy.table
^^^^^^^^^^^^^

- Fixed a bug in ``Table.show_in_browser`` using the ``jsviewer=True`` option
to display the table with sortable columns. Previously the sort direction arrows
were not being shown due to missing image files for the arrows. [12716]

- Fix an issue when writing ``Time`` table columns to a file when the time
``format`` is one of ``datetime``, ``datetime64``, or ``ymdhms``. Previously,
writing a ``Time`` column with one of these formats could result in an exception
or else an incorrect output file that cannot be read back in. [12842]

- Fixed a bug where it is not possible to set the ``.info.format`` property of a
table structured column and get formatted output. [13233]

- Fixed a bug when adding a masked structured array to a table. Previously this
was auto-converted to a ``NdarrayMixin`` which loses the mask. With this fix
the data are added to the table as a ``MaskedColumn`` and the mask is preserved. [13236]

astropy.time
^^^^^^^^^^^^

- Fix an issue when writing ``Time`` table columns to a file when the time
``format`` is one of ``datetime``, ``datetime64``, or ``ymdhms``. Previously,
writing a ``Time`` column with one of these formats could result in an exception
or else an incorrect output file that cannot be read back in. [12842]

astropy.utils
^^^^^^^^^^^^^

- Fixed a bug which caused ``numpy.interp`` to produce incorrect
results when ``Masked`` arrays were passed. [12978]

- Fixed HAS_YAML not working as intended. [13066]

astropy.wcs
^^^^^^^^^^^

- Convert ``NoConvergence`` errors to warnings in ``world_to_pixel_values`` so that callers can work at least with the non converged solution. [11693]

- Expose the ability to select TIME axis introduced in WCSLIB version 7.8. [13062]

- Do not call ``wcstab`` on ``wcscopy`` and copy ``wtb`` members from the original WCS. [13063]

- Updated bundled WCSLIB version to 7.11. This update together with 7.10
includes bug fixes to ``tabini()`` and ``tabcpy()`` as well as several
print formatting enhancements. For a full list of
changes - see http://www.atnf.csiro.au/people/mcalabre/WCS/CHANGES [#13171]

- Fixed error that occurred in ``WCS.world_to_pixel`` for ``WCS`` objects with a
spectral axis and observer location information when passing a ``SpectralCoord``
that had missing observer or target information. [13228]

5.0.4

Not secure
==========================

Bug Fixes
---------

astropy.modeling
^^^^^^^^^^^^^^^^

- Fixed the ``Gaussian2D`` ``bounding_box`` when ``theta`` is an angular
``Quantity``. [13021]

astropy.utils
^^^^^^^^^^^^^

- Reverted ``astropy.utils.iers.iers.IERS_A_URL`` to ``maia.usno.navy.mil`` domain instead
of NASA FTP to work around server issues. [13004]

Other Changes and Additions
---------------------------

- Updated bundled WCSLIB to version 7.9 with several bugfixes and added
support for time coordinate axes in ``wcsset()`` and ``wcssub()``. The
four-digit type code for the time axis will have the first digit set to 4,
i.e., four digit code will be 4xxx where x is a digit 0-9. For a full list of
bug fixes see https://www.atnf.csiro.au/people/mcalabre/WCS/CHANGES [#12994]

Page 2 of 17

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.