================
General
-------
- The infrastructure of the package has been updated in line with the
APE 17 guidelines. 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. [315]
- Bump the minimum required version of Astropy to 3.2.
New Features
------------
- Added a ``as_mpl_selector`` method to the rectangular and ellipse
pixel-based regions. This method returns an interactive Matplotlib
selector widget. [317]
- Added a ``get_overlap_slices`` method to ``BoundingBox``. [348]
- Added a ``center`` attribute to ``BoundingBox``. [348]
- Added ``get_overlap_slices`` method to ``RegionMask``. [350]
- Added ``get_values`` method to ``RegionMask``. [351, 353]
- Added a ``Regions`` class with a unified I/O interface for reading,
writing, parsing, and serializing regions. [378]
- Added ``serialize`` and ``write`` methods to all ``Region``
subclasses. [378]
Bug Fixes
---------
- Fixed an issue where ``RegionMask.multiply`` ``fill_value`` was not
applied to pixels outside of the mask, but within the region bounding
box. [346]
- Fixed an issue where ``RegionMask.cutout`` would raise an error if
``fill_value`` was non-finite and the input array was integer type.
[346]
- A ``ValueError`` is now raised when calling ``BoundingBox.slices``
when ``ixmin`` or ``iymin`` is negative. [347]
- Fixed an issue in the DS9 parser where uppercase coordinate frames
would fail. [237]
- Fixed an issue where the CRTF file parser would fail if the CRTF
version number was included on the first line. [240]
- Fixed an issue where the CRTF file parser would fail if there was a
space after the region name. [271]
- Fixed an issue where the CRTF file parser was too restrictive about
requiring the last and first polynomial coordinates to be the same.
[359, 362]
- Fixed a bug where an ``EllipsePixelRegion`` with zero height and/or
width would raise a ``ValueError`` when creating a ``RegionMask``.
[363]
- Fixed parsing CRTF regions files that do not have a comma after the
region. [364]
- Fixed parsing CRTF regions files that contain a ``symthick`` value.
[365]
- Fixed an issue where ``PointPixelRegion`` objects would not plot.
[366]
- Fixed an issue where DS9 annulus regions with more than one annulus
would not be parsed correctly. Such regions are skipped for now. [371]
- Fixed an issue where ``Angle`` values for ``SkyRegion`` shape
parameters could be incorrectly serialized. [380]
- Fixed an issue where a semicolon in the DS9 text field would raise an
error. [381,383]
- Fixed an issue where DS9 regions without metadata would not be parsed
correctly. [382]
- Fixed an issue parsing spaces in DS9 region metadata. [384]
API Changes
-----------
- Deprecated the ``BoundingBox`` ``slices`` attribute. [348]
- The ``RegionMeta`` and ``RegionVisual`` classes have been moved to the
``regions.core.metadata`` module. [371]
- Deprecated the ``read_fits_region`` and ``write_fits_region``
functions. Instead, use the ``read_fits`` and ``write_fits``
functions. Note that the ``write_fits`` function is called as
``write_fits(regions, filename)`` for consistency with the other
functions that write files. [376]
- The following helper functions were removed from the public API:
``to_shape_list``, ``to_crtf_meta``, ``to_ds9_meta``,
``CRTFRegionParser``, ``DS9RegionParser``, ``CoordinateParser``,
and ``FITSRegionRowParser``. [375]
- Deprecated the following I/O classes and functions:
``crtf_objects_to_string``, ``ds9_objects_to_string``,
``fits_region_object_to_table``, ``read_crtf``, ``read_ds9``,
``read_fits``, ``write_crtf``, ``write_ds9``, ``write_fits``,
``CRTFParser``, ``DS9Parser``, ``FITSRegionParser``, ``ShapeList``,
and ``Shape``. The ``Regions`` and ``Region`` objects now support this
functionality via a unified I/O interface. [378]
- Existing ``ds9`` and ``crtf`` region files will not be overwritten
by default with the ``write`` functions. Set ``overwrite=True`` to
overwrite existing files. [378]