can create masks for coordinates and regions that do not have a lat/ lon coordinate
reference system and masks for irregular and 2D grids are created faster if the optional
dependency `pygeos <https://pygeos.readthedocs.io/en/stable/>`__ is installed.
Breaking Changes
~~~~~~~~~~~~~~~~
- Points at *exactly* -180°E (or 0°E) and -90°N are no longer special cased if
``wrap_lon=False`` when creating a mask - see :doc:`methods<notebooks/method>` for
details (:issue:`151`).
- Updates to :py:meth:`Regions.plot` and :py:meth:`Regions.plot_regions` (:pull:`246`):
- Deprecated all positional arguments (keyword arguments only).
- The ``regions`` keyword was deprecated. Subset regions before plotting, i.e.
use ``r[regions].plot()`` instead of ``r.plot(regions=regions)``. This will allow
to remove a argument from the methods.
- Updates to :py:meth:`Regions.plot` (:pull:`246`):
- Added ``lw=0`` to the default ``ocean_kws`` and ``land_kws`` to avoid overlap with
the coastlines.
- Renamed the ``proj`` keyword to ``projection`` for consistency with cartopy.
- Renamed the ``coastlines`` keyword to ``add_coastlines`` for consistency with other
keywords (e.g. ``add_land``).
Enhancements
~~~~~~~~~~~~
- Creating masks for irregular and 2D grids can be speed up considerably by installing
`pygeos <https://pygeos.readthedocs.io/en/stable/>`__. pygeos is an optional dependency
(:issue:`123`).
- Can now create masks for regions with arbitrary coordinates e.g. for coordinate reference
systems that are not lat/ lon based by setting ``wrap_lon=False`` (:issue:`151`).
- The extent of the longitude coordinates is no longer checked to determine the wrap,
now only the extent of the mask is considered (:issue:`249`). This should allow to
infer ``wrap_lon`` correctly for more cases (:issue:`213`).
Bug Fixes
~~~~~~~~~
- Fixed a bug that could silently lead to a wrong mask in certain cases. Three conditions are
required:
1. The longitude coordinates are not ordered (note that wrapping the longitudes can
also lead to unordered coordinates).
2. Rearranging the coordinates makes them equally spaced.
3. The split point is not in the middle of the array.
Thus, the issue would happen for the following example longitude coordinates: ``[3, 4, 5, 1, 2]``
(but not for ``[3, 4, 1, 2]``). Before the bugfix the mask would incorrectly be rearranged
in the following order ``[4, 5, 1, 2, 3]`` (:issue:`266`).
- :py:meth:`Regions.mask` (and all other ``mask`` methods and functions) no longer raise
an error for regions that exceed 360° latitude if ``wrap_lon=False``. This was most
likely a regression from :pull:`48` (:issue:`151`).
- Raise a ValueError if the input coordinates (lat and lon) have wrong number of dimensions
or shape (:pull:`245`, :issue:`242`).
Docs
~~~~
- Updated the plotting tutorial (:pull:`246`).
- Install `regionmask` via `ci/requirements/docs.yml` on RTD using pip and update the
packages: don't require jupyter (but ipykernel, which leads to a smaller environment),
use new versions of sphinx and sphinx_rtd_theme (:pull:`248`).
- Pin cartopy to version 0.19 and matplotlib to version 3.4 and use a (temporary) fix for
:issue:`165`. This allows to make use of `conda-forge/cartopy-feedstock116
<https://github.com/conda-forge/cartopy-feedstock/pull/116>`__ such that natural_earth
shapefiles can be downloaded again. Also added some other minor doc updates
(:pull:`269`).
Internal Changes
~~~~~~~~~~~~~~~~
- Updated setup configuration and automated version numbering:
- Moved contents of setup.py to setup.cfg (:pull:`240`).
- Use ``pyproject.toml`` to define the installation requirements (:pull:`240`, :pull:`247`).
- Use setuptools-scm for automatic versioning (:pull:`240`).
- Allow installing from git archives (:pull:`240`).
- Refactor ``test_defined_region`` and ``test_mask_equal_defined_regions`` - globally
define a list of all available `defined_regions` (:issue:`256`).
- In the tests: downloading naturalearth regions could run forever. Make sure this does
not happen and turn the timeout Error into a warning (:pull:`261`).
- Set ``regex=True`` in ``pd.Series.str.replace`` due to an upcoming change in pandas (:pull:`262`).
.. _whats-new.0.7.0: