Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduled monthly dependency update for June #171

Closed
wants to merge 16 commits into from

Conversation

pyup-bot
Copy link
Contributor

@pyup-bot pyup-bot commented Jun 1, 2021

Update astropy from 4.0.1.post1 to 4.2.1.

Changelog

4.2.1

================

Bug Fixes
---------

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

- Fixed an issue where specializations of the comoving distance calculation
for certain cosmologies could not handle redshift arrays. [10980]

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

- Fix bug where manual fixes to invalid header cards were not preserved when
saving a FITS file. [11108]

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

- ``NumericArray`` converter now properly broadcasts scalar mask to array.
[11157]

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

- Fix bug when initializing a ``Table`` subclass that uses ``TableAttribute``'s.
If the data were an instance of the table then attributes provided in the
table initialization call could be ignored. [11217]

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

- Change epoch of ``TimeUnixTAI`` (``"unix_tai"``) from ``1970-01-01T00:00:00 UTC``
to ``1970-01-01T00:00:00 TAI`` to match the intended and documented behaviour.
This essentially changes the resulting times by 8.000082 seconds, the initial
offset between TAI and UTC. [11249]

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

- Fixed a bug with the ``quantity_input`` decorator where allowing
dimensionless inputs for an argument inadvertently disabled any checking of
compatible units for that argument. [11283]

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

- Fix a bug so that ``np.shape``, ``np.ndim`` and ``np.size`` again work on
classes that use ``ShapedLikeNDArray``, like representations, frames,
sky coordinates, and times. [11133]

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

- Fix error when a user defined ``proj_point`` parameter is passed to ``fit_wcs_from_points``. [11139]


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


- Change epoch of ``TimeUnixTAI`` (``"unix_tai"``) from ``1970-01-01T00:00:00 UTC``
to ``1970-01-01T00:00:00 TAI`` to match the intended and documented behaviour.
This essentially changes the resulting times by 8.000082 seconds, the initial
offset between TAI and UTC. [11249]

4.2

================

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

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

- Methods ``convolve`` and ``convolve_fft`` both now return Quantity arrays
if user input is given in one. [10822]

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

- Numpy functions that broadcast, change shape, or index (like
``np.broadcast_to``, ``np.rot90``, or ``np.roll``) now work on
coordinates, frames, and representations. [10337]

- Add a new science state ``astropy.coordinates.erfa_astrom.erfa_astrom`` and
two classes ``ErfaAstrom``, ``ErfaAstromInterpolator`` as wrappers to
the ``pyerfa`` astrometric functions used in the coordinate transforms.
Using ``ErfaAstromInterpolator``, which interpolates astrometric properties for
``SkyCoord`` instances with arrays of obstime, can dramatically speed up
coordinate transformations while keeping microarcsecond resolution.
Depending on needed precision and the obstime array in question, speed ups
reach factors of 10x to >100x. [10647]

- ``galactocentric_frame_defaults`` can now also be used as a registry, with
user-defined parameter values and metadata. [10624]

- Method ``.realize_frame`` from coordinate frames now accepts ``**kwargs``,
including ``representation_type``. [10727]

- Avoid an unnecessary call to ``erfa.epv00`` in transformations between
``CIRS`` and ``ICRS``, improving performance by 50 %. [10814]

- A new equatorial coordinate frame, with RA and Dec measured w.r.t to the True
Equator and Equinox (TETE). This frame is commonly known as "apparent place"
and is the correct frame for coordinates returned from JPL Horizons. [10867]

- Added a context manager ``impose_finite_difference_dt`` to the
``TransformGraph`` class to override the finite-difference time step
attribute (``finite_difference_dt``) for all transformations in the graph
with that attribute. [10341]

- Improve performance of ``SpectralCoord`` by refactoring internal
implementation. [10398]

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

- The final version of the Planck 2018 cosmological parameters are included
as the ``Planck18`` object, which is now the default cosmology.  The
parameters are identical to those of the ``Planck18_arXiv_v2`` object,
which is now deprecated and will be removed in a future release. [10915]

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

- Added NFW profile and tests to modeling package [10505]

- Added missing logic for evaluate to compound models [10002]

- Stop iteration in ``FittingWithOutlierRemoval`` before reaching ``niter`` if
the masked points are no longer changing. [10642]

- Keep a (shallow) copy of ``fit_info`` from the last iteration of the wrapped
fitter in ``FittingWithOutlierRemoval`` and also record the actual number of
iterations performed in it. [10642]

- Added attributes for fitting uncertainties (covariance matrix, standard
deviations) to models. Parameter covariance matrix can be accessed via
``model.cov_matrix``, standard deviations by ``model.stds`` or individually
for each parameter by ``parameter.std``. Currently implemented for
``LinearLSQFitter`` and ``LevMarLSQFitter``. [10552]

- N-dimensional least-squares statistic and specific 1,2,3-D methods [10670]

astropy.stats
^^^^^^^^^^^^^

- Added ``circstd`` function to obtain a circular standard deviation. [10690]

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

- Allow initializing a ``Table`` using a list of ``names`` in conjunction with
a ``dtype`` from a numpy structured array. The list of ``names`` overrides the
names specified in the ``dtype``. [10419]

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

- Add new ``isclose()`` method to ``Time`` and ``TimeDelta`` classes to allow
comparison of time objects to within a specified tolerance. [10646]

- Improve initialization time by a factor of four when creating a scalar ``Time``
object in a format like ``unix`` or ``cxcsec`` (time delta from a reference
epoch time). [10406]

- Improve initialization time by a factor of ~25 or more for large arrays of
string times in ISO, ISOT or year day-of-year formats. This is done with a new
C-based time parser that can be adapted for other fixed-format custom time
formats. [10360]

- Numpy functions that broadcast, change shape, or index (like
``np.broadcast_to``, ``np.rot90``, or ``np.roll``) now work on times.
[10337, 10502]

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

- Improve memory and speed performance when iterating over the entire time
column of a ``TimeSeries`` object. Previously this involved O(N^2) operations
and memory. [10889]

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

- ``Quantity.to`` has gained a ``copy`` option to allow copies to be avoided
when the units do not change. [10517]

- Added the ``spat`` unit of solid angle that represents the full sphere.
[10726]

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

- ``ShapedLikeNDArray`` has gained the capability to use numpy functions
that broadcast, change shape, or index. [10337]

- ``get_free_space_in_dir`` now takes a new ``unit`` keyword and
``check_free_space_in_dir`` takes ``size`` defined as ``Quantity``. [10627]

- New ``astropy.utils.data.conf.allow_internet`` configuration item to
control downloading data from the Internet. Setting ``allow_internet=False``
is the same as ``remote_timeout=0``. Using ``remote_timeout=0`` to control
internet access will stop working in a future release. [10632]

- New ``is_url`` function so downstream packages do not have to secretly use
the hidden ``_is_url`` anymore. [10684]

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

- Added the ``Quadrangle`` patch for ``WCSAxes`` for a latitude-longitude
quadrangle.  Unlike ``matplotlib.patches.Rectangle``, the edges of this
patch will be rendered as curved lines if appropriate for the WCS
transformation. [10862]

- The position of tick labels are now only calculated when needed. If any text
parameters are changed (color, font weight, size etc.) that don't effect the
tick label position, the positions are not recomputed, improving performance.
[10806]

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

- ``WCS.to_header()`` now appends comments to SIP coefficients. [10480]

- A new property ``dropped_world_dimensions`` has been added to
``SlicedLowLevelWCS`` to record information about any world axes removed by
slicing a WCS. [10195]

- New ``WCS.proj_plane_pixel_scales()`` and ``WCS.proj_plane_pixel_area()``
methods to return pixel scales and area, respectively, as Quantity. [10872]


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

astropy.config
^^^^^^^^^^^^^^

- ``set_temp_config`` now preserves the existing cache rather than deleting
it and relying on reloading it from the previous config file. This ensures
that any programmatically made changes are preserved as well. [10474]

- Configuration path detection logic has changed: Now, it looks for ``~`` first
before falling back to older logic. In addition, ``HOMESHARE`` is no longer
used in Windows. [10705]

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

- The passing of frame classes (as opposed to frame instances) to the
``transform_to()`` methods of low-level coordinate-frame classes has been
deprecated.  Frame classes can still be passed to the ``transform_to()``
method of the high-level ``SkyCoord`` class, and using ``SkyCoord`` is
recommended for all typical use cases of transforming coordinates. [10475]

astropy.stats
^^^^^^^^^^^^^

- Added a ``grow`` parameter to ``SigmaClip``, ``sigma_clip`` and
``sigma_clipped_stats``, to allow expanding the masking of each deviant
value to its neighbours within a specified radius. [10613]

- Passing float ``n`` to ``poisson_conf_interval`` when using
``interval='kraft-burrows-nousek'`` now raises ``TypeError`` as its value
must be an integer. [10838]

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

- Change ``Table.columns.keys()`` and ``Table.columns.values()`` to both return
generators instead of a list. This matches the behavior for Python ``dict``
objects. [10543]

- Removed the ``FastBST`` and ``FastRBT`` indexing engines because they depend
on the ``bintrees`` package, which is no longer maintained and is deprecated.
Instead, use the ``SCEngine`` indexing engine, which is similar in
performance and relies on the ``sortedcontainers`` package. [10622]

- When slicing a mixin column in a table that had indices, the indices are no
longer copied since they generally are not useful, having the wrong shape.
With this, the behaviour becomes the same as that for a regular ``Column``.
(Note that this does not affect slicing of a table; sliced columns in those
will continue to carry a sliced version of any indices). [10890]

- Change behavior so that when getting a single item out of a mixin column such
as ``Time``, ``TimeDelta``, ``SkyCoord`` or ``Quantity``, the ``info``
attribute is no longer copied. This improves performance, especially when the
object is an indexed column in a ``Table``. [10889]

- Raise a TypeError when a scalar column is added to an unsized table. [10476]

- The order of columns when creating a table from a ``list`` of ``dict`` may be
changed. Previously, the order was alphabetical because the ``dict`` keys
were assumed to be in random order. Since Python 3.7, the keys are always in
order of insertion, so ``Table`` now uses the order of keys in the first row
to set the column order. To alphabetize the columns to match the previous
behavior, use ``t = t[sorted(t.colnames)]``. [10900]

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

- Refactor ``Time`` and ``TimeDelta`` classes to inherit from a common
``TimeBase`` class. The ``TimeDelta`` class no longer inherits from ``Time``.
A number of methods that only apply to ``Time`` (e.g. ``light_travel_time``)
are no longer available in the ``TimeDelta`` class. [10656]

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

- The ``bar`` unit is no longer wrongly considered an SI unit, meaning that
SI decompositions like ``(u.kg*u.s**-2* u.sr**-1 * u.nm**-1).si`` will
no longer include it. [10586]

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

- Shape-related items from ``astropy.utils.misc`` -- ``ShapedLikeNDArray``,
``check_broadcast``, ``unbroadcast``, and ``IncompatibleShapeError`` --
have been moved to their own module, ``astropy.utils.shapes``. They remain
importable from ``astropy.utils``. [10337]

- ``check_hashes`` keyword in ``check_download_cache`` is deprecated and will
be removed in a future release. [10628]

- ``hexdigest`` keyword in ``import_file_to_cache`` is deprecated and will
be removed in a future release. [10628]


Bug Fixes
---------

astropy.config
^^^^^^^^^^^^^^

- Fix a few issues with ``generate_config`` when used with other packages.
[10893]

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

- Fixed a bug in the coordinate-frame attribute ``CoordinateAttribute`` where
the internal transformation could behave differently depending on whether
the input was a low-level coordinate frame or a high-level ``SkyCoord``.
``CoordinateAttribute`` now always performs a ``SkyCoord``-style internal
transformation, including the by-default merging of frame attributes. [10475]

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

- Fixed an issue of ``Model.render`` when the input ``out`` datatype is not
float64. [10542]

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

- Fix support for referencing WCSAxes coordinates by their world axes names.
[10484]

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

- Objective functions called by ``astropy.wcs.fit_wcs_from_points`` were
treating longitude and latitude distances equally. Now longitude scaled
properly. [10759]


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

- Minimum version of required Python is now 3.7. [10900]

- Minimum version of required Numpy is now 1.17. [10664]

- Minimum version of required Scipy is now 1.1. [10900]

- Minimum version of required PyYAML is now 3.13. [10900]

- Minimum version of required Matplotlib is now 3.0. [10900]

- The private ``_erfa`` module has been converted to its own package,
``pyerfa``, which is a required dependency for astropy, and can be imported
with ``import erfa``.  Importing ``_erfa`` from ``astropy`` will give a
deprecation warning.  [10329]

- Added ``optimize=True`` flag to calls of ``yacc.yacc`` (as already done for
``lex.lex``) to allow running in ``python -OO`` session without raising an
exception in ``astropy.units.format``. [10379]

- Shortened FITS comment strings for some D2IM and CPDIS FITS keywords to
reduce the number of FITS ``VerifyWarning`` warnings when working with WCSes
containing lookup table distortions. [10513]

- When importing astropy without first building the extension modules first,
raise an error directly instead of trying to auto-build. [10883]

4.1

================

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.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.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.votable
^^^^^^^^^^^^^^^^^^

- New ``exceptions.conf.max_warnings`` configuration item to control the number of times a
type of warning appears before being suppressed. [10152]

- No longer ignore attributes whose values were specified as empty
strings. [10583]

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.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.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.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]

- Fixed an issue where ticks were sometimes not drawn at the edges of a spherical
projection on a WCSAxes. [10442]

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]

- Add .upper() to ctype or ctype names to wcsapi/fitwcs.py to mitigate bugs from
unintended lower/upper case issues [10557]

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

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.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.votable
^^^^^^^^^^^^^^^^^^

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

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

- ``Table.from_pandas`` now supports a ``units`` dictionary as argument to pass units
for columns in the ``DataFrame``. [9472]

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.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]

Bug Fixes
---------

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

- Fix a bug where for light deflection by the Sun it was always assumed that the
source was at infinite distance, which in the (rare and) absolute worst-case
scenario could lead to errors up to 3 arcsec. [10666]

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

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

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

- Fix a bug that prevented ``Time`` columns from being used to sort a table.
[10824]

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]

- Add .upper() to ctype or ctype names to wcsapi/fitwcs.py to mitigate bugs from
unintended lower/upper case issues [10557]

- Added bounds to ``fit_wcs_from_points`` to ensure CRPIX is on
input image. [10346]


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]

4.0.6

==================

Bug Fixes
---------

astropy.config
^^^^^^^^^^^^^^

astropy.constants
^^^^^^^^^^^^^^^^^

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

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

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

astropy.extern
^^^^^^^^^^^^^^

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

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

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

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

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

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
^^^^^^^^^^^


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

4.0.5

=================

Bug Fixes
---------

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

- Fix bug where manual fixes to invalid header cards were not preserved when
saving a FITS file. [11108]

- Fix parsing of RVKC header card patterns that were not recognised
where multiple spaces were separating field-specifier and value like
"DP1.AXIS.1:   1". [11301]

- Fix misleading missing END card error when extra data are found at the end
of the file. [11285]

- Fix incorrect wrapping of long card values as CONTINUE cards when some
words in the value are longer than a single card. [11304]

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

- Fixed problem when writing serialized metadata to HDF5 using h5py >= 3.0.
With the newer h5py this was writing the metadata table as a variable-length
string array instead of the previous fixed-length bytes array. Fixed astropy
to force using a fixed-length bytes array. [11359]

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

- Change ``Voigt1D`` function to use Humlicek's approximation to avoid serious
inaccuracies + option to use (compiled) ``scipy.special.wofz`` error function
for yet more accurate results. [11177]

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

- Fixed bug when initializing a ``Table`` with a column as list of ``Quantity``,
for example ``Table({'x': [1*u.m, 2*u.m]})``. Previously this resulted in an
``object`` dtype with no column ``unit`` set, but now gives a float array with
the correct unit. [11329]

- Fixed byteorder conversion in ``to_pandas()``, which had incorrectly
triggered swapping when native endianness was stored with explicit
``dtype`` code ``'<'`` (or ``'>'``) instead of ``'='``. [11288, 11294]

- Fixed a compatibility issue with numpy 1.21. Initializing a Table with a
column like ``['str', np.ma.masked]`` was failing in tests due to a change in
numpy. [11364]

- Fixed bug when validating the inputs to ``table.hstack``, ``table.vstack``,
and ``table.dstack``. Previously, mistakenly calling ``table.hstack(t1, t2)``
(instead of ``table.hstack([t1, t2]))`` would return ``t1`` instead of raising
an exception. [11336]

- Fixed byteorder conversion in ``to_pandas()``, which had incorrectly
triggered swapping when native endianness was stored with explicit
``dtype`` code ``'<'`` (or ``'>'``) instead of ``'='``. [11288]

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

- Fix leap second update when using a non english locale. [11062]

- Fix default assumed location to be the geocenter when transforming times
to and from solar-system barycenter scales. [11134]

- Fix inability to write masked times with ``formatted_value``. [11195]

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

- Ensure ``keepdims`` works for taking ``mean``, ``std``, and ``var`` of
``Quantity``. [11198]

- For ``Quantity.to_string()``, ensure that the precision argument is also
used when the format is not latex. [11145]

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

- Allow "un-setting" of auxiliary WCS parameters in the ``aux`` attribute of
``Wcsprm``. [11166]

4.0.4

==================

Bug Fixes
---------

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

- The ``norm()`` method for ``RadialDifferential`` no longer requires ``base``
to be specified.  The ``norm()`` method for other non-Cartesian differential
classes now gives a clearer error message if ``base`` is not specified. [10969]

- The transformations between ``ICRS`` and any of the heliocentric ecliptic
frames (``HeliocentricMeanEcliptic``, ``HeliocentricTrueEcliptic``, and
``HeliocentricEclipticIAU76``) now correctly account for the small motion of
the Sun when transforming a coordinate with velocity information. [10970]

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

- Partially fixed a performance issue when reading in parallel mode. Parallel
reading currently has substantially worse performance than the default serial
reading, so we now ignore the parallel option and fall back to serial reading.
[10880]

- Fixed a bug where "" (blank string) as input data for a boolean type column
was causing an exception instead of indicating a masked value. As a
consequence of the fix, the values "0" and "1" are now also allowed as valid
inputs for boolean type columns. These new allowed values apply for both ECSV
and for basic character-delimited data files ('basic' format with appropriate
``converters`` specified). [10995]

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

- Fixed use of weights with ``LinearLSQFitter``. [10687]

astropy.stats
^^^^^^^^^^^^^

- Fixed an issue in biweight stats when MAD=0 to give the same output
with and without an input ``axis``. [10912]

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

- Fix a problem with the ``plot_date`` format for matplotlib >= 3.3 caused by
a change in the matplotlib plot date default reference epoch in that release.
[10876]

- Improve initialization time by a factor of four when creating a scalar ``Time``
object in a format like ``unix`` or ``cxcsec`` (time delta from a reference
epoch time). [10406]

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

- Fixed the caclulation of the tight bounding box of a ``WCSAxes``. This should
also significantly improve the application of ``tight_layout()`` to figures
containing ``WCSAxes``. [10797]

4.0.3

==================

Bug Fixes
---------

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

- Fixed a small bug where initializing an empty ``Column`` with a structured dtype
with a length and a shape failed to give the requested dtype. [10819]

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

- Fixed installation of the source distribution with pip<19. [10837, 10852]

4.0.2

==================

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

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

- ``astropy.utils.data.download_file`` now supports FTPS/FTP over TLS. [9964]

- ``astropy.utils.data`` now uses a lock-free mechanism for caching. This new
mechanism uses a new cache layout and so ignores caches created using earlier
mechanisms (which were causing lockups on clusters). The two cache formats can
coexist but do not share any files. [10437, 10683]

- ``astropy.utils.data`` now ignores the config item
``astropy.utils.data.conf.download_cache_lock_attempts`` since no locking is
done. [10437, 10683]

- ``astropy.utils.data.download_file`` and related functions now interpret the
parameter or config file setting ``timeout=0`` to mean they should make no
attempt to download files. [10437, 10683]

- ``astropy.utils.import_file_to_cache`` now accepts a keyword-only argument
``replace``, defaulting to True, to determine whether it should replace existing
files in the cache, in a way as close to atomic as possible. [10437, 10683]

- ``astropy.utils.data.download_file`` and related functions now treat
``http://example.com`` and ``http://example.com/`` as equivalent. [#10631]

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

- The new auxiliary WCS parameters added in WCSLIB 7.1 are now exposed as
the ``aux`` attribute of ``Wcsprm``. [10333]

- Updated bundled version of ``WCSLIB`` to v7.3. [10433]


Bug fixes
---------

astropy.config
^^^^^^^^^^^^^^

- Added an extra fallback to ``os.expanduser('~')`` when trying to find the
user home directory. [10570]

astropy.constants
^^^^^^^^^^^^^^^^^

- Corrected definition of parsec to 648 000 / pi AU following IAU 2015 B2 [10569]

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

- Fixed a bug where a float-typed integers in the argument ``x_range`` of
``astropy.convolution.utils.discretize_oversample_1D`` (and the 2D version as
well) fails because it uses ``numpy.linspace``, which requires an ``int``.
[10696]

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

- Ensure that for size-1 array ``SkyCoord`` and coordinate frames
the attributes also properly become scalars when indexed with 0.
[10113]

- Fixed a bug where ``SkyCoord.separation()`` and ``SkyCoord.separation_3d``
were not accepting a frame object. [10332]

- Ensure that the ``lon`` values in ``SkyOffsetFrame`` are wrapped correctly at
180 degree regardless of how the underlying data is represented. [10163]

- Fixed an error in the obliquity of the ecliptic when transforming to/from the
``*TrueEcliptic`` coordinate frames. The error would primarily result in an
inaccuracy in the ecliptic latitude on the order of arcseconds. [10129]

- Fixed an error in the computation of the location of solar system bodies where the
Earth location of the observer was ignored during the correction for light travel
time. [10292]

- Ensure that coordinates with proper motion that are transformed to other
coordinate frames still can be represented properly. [10276]

- Improve the error message given when trying to get a cartesian representation
for coordinates that have both proper motion and radial velocity, but no
distance. [10276]

- Fixed an error where ``SkyCoord.apply_space_motion`` would return incorrect
results when no distance is set and proper motion is high. [10296]

- Make the parsing of angles thread-safe so that ``Angle`` can be used in
Python multithreading. [10556]

- Fixed reporting of ``EarthLocation.info`` which previously raised an exception.
[10592]

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

- Fixed a bug with the C ``fast_reader`` not correctly parsing newlines when
``delimiter`` was also set to ``\n`` or ``\r``; ensured consistent handling
of input strings without newline characters. [9929]

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

- Fix integer formats of ``TFORMn=Iw`` columns in ASCII tables to correctly read
values exceeding int32 - setting int16, int32 or int64 according to ``w``. [9901]

- Fix unclosed memory-mapped FITS files in ``FITSDiff`` when difference found.
[10159]

- Fix crash when reading an invalid table file. [10171]

- Fix duplication issue when setting a keyword ending with space. [10482]

- Fix ResourceWarning with ``fits.writeto`` and ``pathlib.Path`` object.
[10599]

- Fix repr for commentary cards and strip spaces for commentary keywords.
[10640]

- Fix compilation of cfitsio with Xcode 12. [10772]

- Fix handling of 1-dimensional arrays with a single element in ``BinTableHDU`` [10768]

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

- Fix id URL in ``baseframe-1.0.0`` ASDF schema. [10223]

- Write keys to ASDF only if the value is present, to account
for a change in behavior in asdf 2.8. [10674]

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

- Fix ``Table.(read|write).help`` when reader or writer has no docstring. [10460]

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

- Fixed parsing failure of VOTable with no fields. When detecting a non-empty
table with no fields, the following warning/exception is issued:
E25 "No FIELDs are defined; DATA section will be ignored." [10192]

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

- Fixed a problem with mapping ``input_units`` and ``return_units``
of a ``CompoundModel`` to the units of the constituent models. [10158]

- Removed hard-coded names of inputs and outputs. [10174]

- Fixed a problem where slicing a ``CompoundModel`` by name will crash if
there ``fix_inputs`` operators are present. [10224]

- Removed a limitation of fitting of data with units with compound models
without units when the expression involves operators other than addition
and subtraction. [10415]

- Fixed a problem with fitting ``Linear1D`` and ``Planar2D`` in model sets. [10623]

- Fixed reported module name of ``math_functions`` model classes. [10694]

- Fixed reported module name of ``tabular`` model classes. [10709]

- Do not create new ``math_functions`` models for ufuncs that are
only aliases (divide and mod). [10697]

- Fix calculation of the ``Moffat2D`` derivative with respect to gamma. [10784]

astropy.stats
^^^^^^^^^^^^^

- Fixed an API regression where ``SigmaClip.__call__`` would convert masked
elements to ``nan`` and upcast the dtype to ``float64`` in its output
``MaskedArray`` when using the ``axis`` parameter along with the defaults
``masked=True`` and ``copy=True``. [10610]

- Fixed an issue where fully masked ``MaskedArray`` input to
``sigma_clipped_stats`` gave incorrect results. [10099]

- Fixed an issue where ``sigma_clip`` and ``SigmaClip.__call__``
would return a masked array instead of a ``ndarray`` when
``masked=False`` and the input was a full-masked ``MaskedArray``.
[10099]

- Fixed bug with ``funcs.poisson_conf_interval`` where an integer for N
with ``interval='kraft-burrows-nousek'`` would throw an error with
mpmath backend. [10427]

- Fixed bug in ``funcs.poisson_conf_interval`` with
``interval='kraft-burrows-nousek'`` where certain combinations of source
and background count numbers led to ``ValueError`` due to the choice of
starting value for numerical optimization. [10618]

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

- Fixed a bug when writing a table with mixin columns to FITS, ECSV or HDF5.
If one of the data attributes of the mixin (e.g. ``skycoord.ra``) had the
same name as one of the table column names (``ra``), the column (``ra``)
would be dropped when reading the table back. [10222]

- Fixed a bug when sorting an indexed table on the indexed column after first
sorting on another column. [10103]

- Fixed a bug in table argsort when called with ``reverse=True`` for an
indexed table. [10103]

- Fixed a performance regression introduced in 9048 when initializing a table
from Python lists. Also fixed incorrect behavior (for data types other than
float) when those lists contain ``np.ma.masked`` elements to indicate masked
data. [10636]

- Avoid modifying ``.meta`` when serializing columns to FITS. [10485]

- Avoid crash when reading a FITS table that contains mixin info and PyYAML
is missing. [10485]

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

- Ensure that for size-1 array ``Time``, the location also properly becomes
a scalar when indexed with 0. [10113]

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

- Refined test_parallax to resolve difference between 2012 and 2015 definitions. [10569]

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

- The default IERS server has been updated to use the FTPS server hosted by
CDDIS. [9964]

- Fixed memory allocation on 64-bit systems within ``xml.iterparse`` [10076]

- Fix case where ``None`` could be used in a numerical computation. [10126]

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

- Fixed a bug where the ``ImageNormalize`` ``clip`` keyword was
ignored when used with calling the object on data. [10098]

- Fixed a bug where ``axes.xlabel``/``axes.ylabel`` where not correctly set
nor returned on an ``EllipticalFrame`` class ``WCSAxes`` plot. [10446]

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

- Handled WCS 360 -> 0 deg crossover in ``fit_wcs_from_points`` [10155]

- Do not issue ``DATREF`` warning when ``MJDREF`` has default value. [10440]

- Fixed a bug due to which ``naxis`` argument was ignored if ``header``
was supplied during the initialization of a WCS object. [10532]

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

- Improved the speed of sorting a large ``Table`` on a single column by a factor
of around 5. [10103]

- Ensure that astropy can be used inside Application bundles built with
pyinstaller. [8795]

- Updated the bundled CFITSIO library to 3.49. See
``cextern/cfitsio/docs/changes.txt`` for additional information.
[10256, 10665]

- ``extract_array`` raises a ``ValueError`` if the data type of the
input array is inconsistent with the ``fill_value``. [10602]
Links

Update coverage from 5.1 to 5.5.

Changelog

5.5

--------------------------

- ``coverage combine`` has a new option, ``--keep`` to keep the original data
files after combining them.  The default is still to delete the files after
they have been combined.  This was requested in `issue 1108`_ and implemented
in `pull request 1110`_.  Thanks, Éric Larivière.

- When reporting missing branches in ``coverage report``, branches aren't
reported that jump to missing lines.  This adds to the long-standing behavior
of not reporting branches from missing lines.  Now branches are only reported
if both the source and destination lines are executed.  Closes both `issue
1065`_ and `issue 955`_.

- Minor improvements to the HTML report:

- The state of the line visibility selector buttons is saved in local storage
 so you don't have to fiddle with them so often, fixing `issue 1123`_.

- It has a little more room for line numbers so that 4-digit numbers work
 well, fixing `issue 1124`_.

- Improved the error message when combining line and branch data, so that users
will be more likely to understand what's happening, closing `issue 803`_.

.. _issue 803: https://github.com/nedbat/coveragepy/issues/803
.. _issue 955: https://github.com/nedbat/coveragepy/issues/955
.. _issue 1065: https://github.com/nedbat/coveragepy/issues/1065
.. _issue 1108: https://github.com/nedbat/coveragepy/issues/1108
.. _pull request 1110: https://github.com/nedbat/coveragepy/pull/1110
.. _issue 1123: https://github.com/nedbat/coveragepy/issues/1123
.. _issue 1124: https://github.com/nedbat/coveragepy/issues/1124


.. _changes_54:

5.4

--------------------------

- The text report produced by ``coverage report`` now always outputs a TOTAL
line, even if only one Python file is reported.  This makes regex parsing
of the output easier.  Thanks, Judson Neer.  This had been requested a number
of times (`issue 1086`_, `issue 922`_, `issue 732`_).

- The ``skip_covered`` and ``skip_empty`` settings in the configuration file
can now be specified in the ``[html]`` section, so that text reports and HTML
reports can use separate settings.  The HTML report will still use the
``[report]`` settings if there isn't a value in the ``[html]`` section.
Closes `issue 1090`_.

- Combining files on Windows across drives now works properly, fixing `issue
577`_.  Thanks, `Valentin Lab <pr1080_>`_.

- Fix an obscure warning from deep in the _decimal module, as reported in
`issue 1084`_.

- Update to support Python 3.10 alphas in progress, including `PEP 626: Precise
line numbers for debugging and other tools <pep626_>`_.

.. _issue 577: https://github.com/nedbat/coveragepy/issues/577
.. _issue 732: https://github.com/nedbat/coveragepy/issues/732
.. _issue 922: https://github.com/nedbat/coveragepy/issues/922
.. _issue 1084: https://github.com/nedbat/coveragepy/issues/1084
.. _issue 1086: https://github.com/nedbat/coveragepy/issues/1086
.. _issue 1090: https://github.com/nedbat/coveragepy/issues/1090
.. _pr1080: https://github.com/nedbat/coveragepy/pull/1080
.. _pep626: https://www.python.org/dev/peps/pep-0626/


.. _changes_531:

5.3.1

----------------------------

- When using ``--source`` on a large source tree, v5.x was slower than previous
versions.  This performance regression is now fixed, closing `issue 1037`_.

- Mysterious SQLite errors can happen on PyPy, as reported in `issue 1010`_. An
immediate retry seems to fix the problem, although it is an unsatisfying
solution.

- The HTML report now saves the sort order in a more widely supported way,
fixing `issue 986`_.  Thanks, Sebastián Ramírez (`pull request 1066`_).

- The HTML report pages now have a :ref:`Sleepy Snake <sleepy>` favicon.

- Wheels are now provided for manylinux2010, and for PyPy3 (pp36 and pp37).

- Continuous integration has moved from Travis and AppVeyor to GitHub Actions.

.. _issue 986: https://github.com/nedbat/coveragepy/issues/986
.. _issue 1037: https://github.com/nedbat/coveragepy/issues/1037
.. _issue 1010: https://github.com/nedbat/coveragepy/issues/1010
.. _pull request 1066: https://github.com/nedbat/coveragepy/pull/1066

.. _changes_53:

5.3

--------------------------

- The ``source`` setting has always been interpreted as either a file path or a
module, depending on which existed.  If both interpretations were valid, it
was assumed to be a file path.  The new ``source_pkgs`` setting can be used
to name a package to disambiguate this case.  Thanks, Thomas Grainger. Fixes
`issue 268`_.

- If a plugin was disabled due to an exception, we used to still try to record
its information, causing an exception, as reported in `issue 1011`_.  This is
now fixed.

.. _issue 268: https://github.com/nedbat/coveragepy/issues/268
.. _issue 1011: https://github.com/nedbat/coveragepy/issues/1011


.. _changes_521:

5.2.1

----------------------------

- The dark mode HTML report still used light colors for the context listing,
making them unreadable (`issue 1009`_).  This is now fixed.

- The time stamp on the HTML report now includes the time zone. Thanks, Xie
Yanbo (`pull request 960`_).

.. _pull request 960: https://github.com/nedbat/coveragepy/pull/960
.. _issue 1009: https://github.com/nedbat/coveragepy/issues/1009


.. _changes_52:

5.2

--------------------------

- The HTML report has been redesigned by Vince Salvino.  There is now a dark
mode, the code text is larger, and system sans serif fonts are used, in
addition to other small changes (`issue 858`_ and `pull request 931`_).

- The ``coverage report`` and ``coverage html`` commands now accept a
``--precision`` option to control the number of decimal points displayed.
Thanks, Teake Nutma (`pull request 982`_).

- The ``coverage report`` and ``coverage html`` commands now accept a
``--no-skip-covered`` option to negate ``--skip-covered``.  Thanks, Anthony
Sottile (`issue 779`_ and `pull request 932`_).

- The ``--skip-empty`` option is now available for the XML report, closing
`issue 976`_.

- The ``coverage report`` command now accepts a ``--sort`` option to specify
how to sort the results.  Thanks, Jerin Peter George (`pull request 1005`_).

- If coverage fails due to the coverage total not reaching the ``--fail-under``
value, it will now print a message making the condition clear.  Thanks,
Naveen Yadav (`pull request 977`_).

- TOML configuration files with non-ASCII characters would cause errors on
Windows (`issue 990`_).  This is now fixed.

- The output of ``--debug=trace`` now includes information about how the
``--source`` option is being interpreted, and the module names being
considered.

.. _pull request 931: https://github.com/nedbat/coveragepy/pull/931
.. _pull request 932: https://github.com/nedbat/coveragepy/pull/932
.. _pull request 977: https://github.com/nedbat/coveragepy/pull/977
.. _pull request 982: https://github.com/nedbat/coveragepy/pull/982
.. _pull request 1005: https://github.com/nedbat/coveragepy/pull/1005
.. _issue 779: https://github.com/nedbat/coveragepy/issues/779
.. _issue 858: https://github.com/nedbat/coveragepy/issues/858
.. _issue 976: https://github.com/nedbat/coveragepy/issues/976
.. _issue 990: https://github.com/nedbat/coveragepy/issues/990


.. _changes_51:
Links

Update hypothesis from 5.16.0 to 6.13.10.

Changelog

6.13.10

--------------------

This release adjusts some internal code to help make our test suite more
reliable.

There is no user-visible change.

6.13.9

-------------------

This patch cleans up some internal code related to filtering strategies.

There is no user-visible change.

6.13.8

-------------------

This patch slightly improves the performance of some internal code for
generating integers.

6.13.7

-------------------

This patch fixes a bug in :func:`~hypothesis.strategies.from_regex` that
caused ``from_regex("", fullmatch=True)`` to unintentionally generate non-empty
strings (:issue:`4982`).

The only strings that completely match an empty regex pattern are empty
strings.

6.13.6

-------------------

This patch fixes a bug that caused :func:`~hypothesis.strategies.integers`
to shrink towards negative values instead of positive values in some cases.

6.13.5

-------------------

This patch fixes rare cases where ``hypothesis write --binary-op`` could
print :doc:`reproducing instructions <reproducing>` from the internal
search for an identity element.

6.13.4

-------------------

This patch removes some unnecessary intermediate list-comprehensions,
using the latest versions of :pypi:`pyupgrade` and :pypi:`shed`.

6.13.3

-------------------

This patch adds a ``.hypothesis`` property to invalid test functions, bringing
them inline with valid tests and fixing a bug where :pypi:`pytest-asyncio` would
swallow the real error message and mistakenly raise a version incompatibility
error.

6.13.2

-------------------

Some of Hypothesis's numpy/pandas strategies use a ``fill`` argument to speed
up generating large arrays, by generating a single fill value and sharing that
value among many array slots instead of filling every single slot individually.

When no ``fill`` argument is provided, Hypothesis tries to detect whether it is
OK to automatically use the ``elements`` argument as a fill strategy, so that
it can still use the faster approach.

This patch fixes a bug that would cause that optimization to trigger in some
cases where it isn't 100% guaranteed to be OK.

If this makes some of your numpy/pandas tests run more slowly, try adding an
explicit ``fill`` argument to the relevant strategies to ensure that Hypothesis
always uses the faster approach.

6.13.1

-------------------

This patch strengthens some internal import-time consistency checks for the
built-in strategies.

There is no user-visible change.

6.13.0

-------------------

This release adds URL fragment generation to the :func:`~hypothesis.provisional.urls`
strategy (:issue:`2908`). Thanks to Pax (R. Margret) for contributing this patch at the
`PyCon US Mentored Sprints <https://us.pycon.org/2021/summits/mentored-sprints/>`__!

6.12.1

-------------------

This patch fixes :issue:`2964`, where ``.map()`` and ``.filter()`` methods
were omitted from the ``repr()`` of :func:`~hypothesis.strategies.just` and
:func:`~hypothesis.strategies.sampled_from` strategies, since
:ref:`version 5.43.7 <v5.43.7>`.

6.12.0

-------------------

This release automatically rewrites some simple filters, such as
``integers().filter(lambda x: x > 9)`` to the more efficient
``integers(min_value=10)``, based on the AST of the predicate.

We continue to recommend using the efficient form directly wherever
possible, but this should be useful for e.g. :pypi:`pandera` "``Checks``"
where you already have a simple predicate and translating manually
is really annoying.  See :issue:`2701` for ideas about floats and
simple text strategies.

6.11.0

-------------------

:func:`hypothesis.target` now returns the ``observation`` value,
allowing it to be conveniently used inline in expressions such as
``assert target(abs(a - b)) < 0.1``.

6.10.1

-------------------

This patch fixes a deprecation warning if you're using recent versions
of :pypi:`importlib-metadata` (:issue:`2934`), which we use to load
:ref:`third-party plugins <entry-points>` such as `Pydantic's integration
<https://pydantic-docs.helpmanual.io/hypothesis_plugin/>`__.
On older versions of :pypi:`importlib-metadata`, there is no change and
you don't need to upgrade.

6.10.0

-------------------

This release teaches the :doc:`Ghostwriter <ghostwriter>` to read parameter
types from Sphinx, Google, or Numpy-style structured docstrings, and improves
some related heuristics about how to test scientific and numerical programs.

6.9.2

------------------

This release improves the :doc:`Ghostwriter's <ghostwriter>` handling
of exceptions, by reading ``:raises ...:`` entries in function docstrings
and ensuring that we don't suppresss the error raised by test assertions.

6.9.1

------------------

This patch updates our autoformatting tools, improving our code style without any API changes.

6.9.0

------------------

This release teaches :func:`~hypothesis.strategies.from_type` how to see
through :obj:`python:typing.Annotated`.  Thanks to Vytautas Strimaitis
for reporting and fixing :issue:`2919`!

6.8.12

-------------------

If :pypi:`rich` is installed, the :command:`hypothesis write` command
will use it to syntax-highlight the :doc:`Ghostwritten <ghostwriter>`
code.

6.8.11

-------------------

This patch improves an error message from :func:`~hypothesis.strategies.from_type`
when :func:`~hypothesis.strategies.builds` would be more suitable (:issue:`2930`).

6.8.10

-------------------

This patch updates the type annotations for :func:`~hypothesis.extra.numpy.arrays` to reflect that
``shape: SearchStrategy[int]`` is supported.

6.8.9

------------------

This patch fixes :func:`~hypothesis.strategies.from_type` with
:mod:`abstract types <python:abc>` which have either required but
non-type-annotated arguments to ``__init__``, or where
:func:`~hypothesis.strategies.from_type` can handle some concrete
subclasses but not others.

6.8.8

------------------

This patch teaches :command:`hypothesis write` to check for possible roundtrips
in several more cases, such as by looking for an inverse in the module which
defines the function to test.

6.8.7

------------------

This patch adds a more helpful error message if you try to call
:func:`~hypothesis.strategies.sampled_from` on an :class:`~python:enum.Enum`
which has no members, but *does* have :func:`~python:dataclasses.dataclass`-style
annotations (:issue:`2923`).

6.8.6

------------------

The :func:`~hypothesis.strategies.fixed_dictionaries` strategy now preserves
dict iteration order instead of sorting the keys.  This also affects the
pretty-printing of keyword arguments to :func:`given() <hypothesis.given>`
(:issue:`2913`).

6.8.5

------------------

This patch teaches :command:`hypothesis write` to default to ghostwriting
tests with ``--style=pytest`` only if :pypi:`pytest` is installed, or
``--style=unittest`` otherwise.

6.8.4

------------------

This patch adds type annotations for the :class:`~hypothesis.settings` decorator,
to avoid an error when running mypy in strict mode.

6.8.3

------------------

This patch improves the :doc:`Ghostwriter's <ghostwriter>` handling
of strategies to generate various fiddly types including frozensets,
keysviews, valuesviews, regex matches and patterns, and so on.

6.8.2

------------------

This patch fixes some internal typos.  There is no user-visible change.

6.8.1

------------------

This patch lays more groundwork for filter rewriting (:issue:`2701`).
There is no user-visible change... yet.

6.8.0

------------------

This release :func:`registers <hypothesis.strategies.register_type_strategy>` the
remaining builtin types, and teaches :func:`~hypothesis.strategies.from_type` to
try resolving :class:`~python:typing.ForwardRef` and :class:`~python:typing.Type`
references to built-in types.

6.7.0

------------------

This release teaches :class:`~hypothesis.stateful.RuleBasedStateMachine` to avoid
checking :func:`~hypothesis.stateful.invariant`\ s until all
:func:`~hypothesis.stateful.initialize` rules have been run.  You can enable checking
of specific invariants for incompletely initialized machines by using
``invariant(check_during_init=True)`` (:issue:`2868`).

In previous versions, it was possible if awkward to implement this behaviour
using :func:`~hypothesis.stateful.precondition` and an auxiliary variable.

6.6.1

------------------

This patch improves the error message when :func:`~hypothesis.strategies.from_type`
fails to resolve a forward-reference inside a :class:`python:typing.Type`
such as ``Type["int"]`` (:issue:`2565`).

6.6.0

------------------

This release makes it an explicit error to apply :func:`~hypothesis.stateful.invariant`
to a :func:`~hypothesis.stateful.rule` or :func:`~hypothesis.stateful.initialize` rule
in :doc:`stateful testing <stateful>`.  Such a combination had unclear semantics,
especially in combination with :func:`~hypothesis.stateful.precondition`, and was never
meant to be allowed (:issue:`2681`).

6.5.0

------------------

This release adds :ref:`the explain phase <phases>`, in which Hypothesis
attempts to explain *why* your test failed by pointing to suspicious lines
of code (i.e. those which were always, and only, run on failing inputs).
We plan to include "generalising" failing examples in this phase in a
future release (:issue:`2192`).

6.4.3

------------------

This patch fixes :issue:`2794`, where nesting :func:`~hypothesis.strategies.deferred`
strategies within :func:`~hypothesis.strategies.recursive` strategies could
trigger an internal assertion.  While it was always possible to get the same
results from a more sensible strategy, the convoluted form now works too.

6.4.2

------------------

This patch fixes several problems with ``mypy`` when `--no-implicit-reexport <https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-implicit-reexport>`_ was activated in user projects.

Thanks to Nikita Sobolev for fixing :issue:`2884`!

6.4.1

------------------

This patch fixes an exception that occurs when using type unions of
the :pypi:`typing_extensions` ``Literal`` backport on Python 3.6.

Thanks to Ben Anhalt for identifying and fixing this bug.

6.4.0

------------------

This release fixes :doc:`stateful testing methods <stateful>` with multiple
:func:`~hypothesis.stateful.precondition` decorators.  Previously, only the
outer-most precondition was checked (:issue:`2681`).

6.3.4

------------------

This patch refacto

@pyup-bot
Copy link
Contributor Author

pyup-bot commented Aug 1, 2021

Closing this in favor of #174

@pyup-bot pyup-bot closed this Aug 1, 2021
@jason-neal jason-neal deleted the pyup/scheduled-update-2021-06-01 branch August 1, 2021 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant