[Git][debian-gis-team/trollimage][master] 6 commits: New upstream version 1.12.0
Antonio Valentino
gitlab at salsa.debian.org
Wed Mar 4 07:03:57 GMT 2020
Antonio Valentino pushed to branch master at Debian GIS Project / trollimage
Commits:
7c34756c by Antonio Valentino at 2020-03-04T06:47:17+00:00
New upstream version 1.12.0
- - - - -
84b43ddd by Antonio Valentino at 2020-03-04T06:47:24+00:00
Update upstream source from tag 'upstream/1.12.0'
Update to upstream version '1.12.0'
with Debian dir bcb2a33ee77c463aba26adf2a2400ba57ff79752
- - - - -
ef2cd098 by Antonio Valentino at 2020-03-04T06:48:13+00:00
New upstream release
- - - - -
6258102e by Antonio Valentino at 2020-03-04T06:49:20+00:00
Refresh all patches
- - - - -
df33fb63 by Antonio Valentino at 2020-03-04T06:56:15+00:00
Drop python3-six dependency
- - - - -
bb60f6ea by Antonio Valentino at 2020-03-04T06:56:50+00:00
Set distribution to unstable
- - - - -
15 changed files:
- .travis.yml
- CHANGELOG.md
- appveyor.yml
- debian/changelog
- debian/control
- debian/patches/0001-No-display.patch
- rtd_requirements.txt
- setup.py
- trollimage/image.py
- trollimage/tests/__init__.py
- trollimage/tests/test_colormap.py
- trollimage/tests/test_image.py
- trollimage/utilities.py
- trollimage/version.py
- trollimage/xrimage.py
Changes:
=====================================
.travis.yml
=====================================
@@ -5,30 +5,50 @@ env:
- PYTHON_VERSION=$TRAVIS_PYTHON_VERSION
- NUMPY_VERSION=stable
- MAIN_CMD='python setup.py'
- - CONDA_DEPENDENCIES='pillow gdal xarray dask toolz mock coverage coveralls codecov rasterio'
+ - CONDA_DEPENDENCIES='pillow gdal xarray dask coverage coveralls codecov rasterio pytest pytest-cov'
- SETUP_XVFB=False
- EVENT_TYPE='push pull_request'
- SETUP_CMD='test'
- CONDA_CHANNELS='conda-forge'
- CONDA_CHANNEL_PRIORITY=True
+ - UNSTABLE_DEPS=False
matrix:
include:
- - env:
- - PYTHON_VERSION=2.7
- - NUMPY_VERSION=1.16
+ - env: PYTHON_VERSION=3.7
os: linux
- - env: PYTHON_VERSION=3.6
+ - env: PYTHON_VERSION=3.8
os: linux
- - env: PYTHON_VERSION=3.7
+ - env:
+ - PYTHON_VERSION=3.8
+ - UNSTABLE_DEPS=True
os: linux
+ allow_failures:
+ - env:
+ - PYTHON_VERSION=3.8
+ - UNSTABLE_DEPS=True
+ os: linux
install:
- - git clone --depth 1 git://github.com/astropy/ci-helpers.git
- - source ci-helpers/travis/setup_conda.sh
-script: coverage run --source=trollimage setup.py test
+ - git clone --depth 1 git://github.com/astropy/ci-helpers.git
+ - source ci-helpers/travis/setup_conda.sh
+ - if [ "$UNSTABLE_DEPS" == "True" ]; then
+ python -m pip install
+ -f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com
+ --no-deps --pre --upgrade
+ numpy
+ pandas;
+ python -m pip install
+ --no-deps --upgrade
+ git+https://github.com/dask/dask
+ git+https://github.com/mapbox/rasterio
+ git+https://github.com/pydata/xarray;
+ fi
+ - pip install -e . --no-deps
+script:
+ - pytest --cov=trollimage trollimage/tests
after_success:
- - if [[ $PYTHON_VERSION == 3.6 ]]; then coveralls; fi
+ - if [[ $PYTHON_VERSION == 3.8 ]]; then coveralls; fi
deploy:
- provider: pypi
user: dhoese
=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,14 @@
+## Version 1.12.0 (2020/03/02)
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 64](https://github.com/pytroll/trollimage/pull/64) - Add long description for display by PyPI
+* [PR 63](https://github.com/pytroll/trollimage/pull/63) - Fix XRImage producing read-only data arrays and switch to pytest
+
+In this release 2 pull requests were closed.
+
## Version 1.11.0 (2019/10/24)
### Pull Requests Merged
=====================================
appveyor.yml
=====================================
@@ -3,23 +3,18 @@ environment:
PYTHON: "C:\\conda"
MINICONDA_VERSION: "latest"
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers\\appveyor\\windows_sdk.cmd"
- CONDA_DEPENDENCIES: "pillow gdal xarray dask toolz mock coverage coveralls codecov rasterio"
+ CONDA_DEPENDENCIES: "pillow gdal xarray dask coverage coveralls codecov rasterio pytest pytest-cov"
CONDA_CHANNELS: "conda-forge"
CONDA_CHANNEL_PRIORITY: "True"
matrix:
- - PYTHON: "C:\\Python27_64"
- PYTHON_VERSION: "2.7"
- PYTHON_ARCH: "64"
- NUMPY_VERSION: "stable"
-
- - PYTHON: "C:\\Python36_64"
- PYTHON_VERSION: "3.6"
+ - PYTHON: "C:\\Python37_64"
+ PYTHON_VERSION: "3.7"
PYTHON_ARCH: "64"
NUMPY_VERSION: "stable"
- - PYTHON: "C:\\Python37_64"
- PYTHON_VERSION: "3.7"
+ - PYTHON: "C:\\Python38_64"
+ PYTHON_VERSION: "3.8"
PYTHON_ARCH: "64"
NUMPY_VERSION: "stable"
@@ -27,11 +22,12 @@ install:
- "git clone --depth 1 git://github.com/astropy/ci-helpers.git"
- "powershell ci-helpers/appveyor/install-miniconda.ps1"
- "conda activate test"
+ - "pip install -e ."
build: false # Not a C# project, build stuff at the test step instead.
test_script:
- - "%CMD_IN_ENV% python setup.py test"
+ - "%CMD_IN_ENV% pytest --cov=trollimage trollimage/tests"
after_test:
# If tests are successful, create a whl package for the project.
=====================================
debian/changelog
=====================================
@@ -1,8 +1,11 @@
-trollimage (1.11.0-2) UNRELEASED; urgency=medium
+trollimage (1.12.0-1) unstable; urgency=medium
+ * New upstream release.
* Bump Standards-Version to 4.5.0, no changes.
+ * Refresh all patches.
+ * Remove dependency on python3-six (upstream dropped to Python 2).
- -- Antonio Valentino <antonio.valentino at tiscali.it> Sat, 25 Jan 2020 11:17:30 +0100
+ -- Antonio Valentino <antonio.valentino at tiscali.it> Wed, 04 Mar 2020 06:56:32 +0000
trollimage (1.11.0-1) unstable; urgency=medium
=====================================
debian/control
=====================================
@@ -13,7 +13,6 @@ Build-Depends: debhelper-compat (= 12),
python3-pil,
python3-rasterio,
python3-setuptools,
- python3-six,
python3-xarray
Standards-Version: 4.5.0
Vcs-Browser: https://salsa.debian.org/debian-gis-team/trollimage
@@ -24,7 +23,6 @@ Package: python3-trollimage
Architecture: all
Depends: python3-numpy (>= 1:1.13),
python3-pil,
- python3-six,
${python3:Depends},
${misc:Depends}
Recommends: python3-dask,
=====================================
debian/patches/0001-No-display.patch
=====================================
@@ -8,10 +8,10 @@ Skip tests that require display.
1 file changed, 1 insertion(+)
diff --git a/trollimage/tests/test_image.py b/trollimage/tests/test_image.py
-index 83538e5..2b6cbe6 100644
+index 97328bb..5d6b775 100644
--- a/trollimage/tests/test_image.py
+++ b/trollimage/tests/test_image.py
-@@ -1916,6 +1916,7 @@ class TestXRImage(unittest.TestCase):
+@@ -1927,6 +1927,7 @@ class TestXRImage(unittest.TestCase):
"""Test putalpha."""
pass
=====================================
rtd_requirements.txt
=====================================
@@ -1,5 +1,4 @@
pillow
-six
rasterio
xarray
dask[array]
\ No newline at end of file
=====================================
setup.py
=====================================
@@ -28,10 +28,14 @@
from setuptools import setup
import versioneer
+with open('README.rst', 'r') as readme_file:
+ long_description = readme_file.read()
+
setup(name="trollimage",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='Pytroll imaging library',
+ long_description=long_description,
author='Martin Raspaud',
author_email='martin.raspaud at smhi.se',
classifiers=["Development Status :: 5 - Production/Stable",
@@ -44,10 +48,10 @@ setup(name="trollimage",
url="https://github.com/pytroll/trollimage",
packages=['trollimage'],
zip_safe=False,
- install_requires=['numpy >=1.13', 'pillow', 'six'],
+ install_requires=['numpy >=1.13', 'pillow'],
+ python_requires='>=3.6',
extras_require={
'geotiff': ['rasterio'],
'xarray': ['xarray', 'dask[array]'],
},
- test_suite='trollimage.tests.suite',
)
=====================================
trollimage/image.py
=====================================
@@ -33,7 +33,6 @@ import re
from copy import deepcopy
import numpy as np
-import six
from PIL import Image as Pil
try:
@@ -377,7 +376,7 @@ class Image(object):
if self.is_empty():
raise IOError("Cannot save an empty image")
- if isinstance(filename, (str, six.text_type)):
+ if isinstance(filename, str):
ensure_dir(filename)
fformat = fformat or os.path.splitext(filename)[1][1:4]
=====================================
trollimage/tests/__init__.py
=====================================
@@ -19,33 +19,4 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-"""The tests package.
-"""
-
-from trollimage import image, colormap
-from trollimage.tests import test_image, test_colormap
-import unittest
-import doctest
-
-
-def suite():
- """The global test suite.
- """
- mysuite = unittest.TestSuite()
- # Test the documentation strings
- mysuite.addTests(doctest.DocTestSuite(image))
- # Use the unittests also
- mysuite.addTests(test_image.suite())
-
- mysuite.addTests(doctest.DocTestSuite(colormap))
- mysuite.addTests(test_colormap.suite())
-
- return mysuite
-
-
-def load_tests(loader, tests, pattern):
- return suite()
-
-if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite())
+"""The tests package."""
=====================================
trollimage/tests/test_colormap.py
=====================================
@@ -19,9 +19,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-"""Test colormap.py
-"""
+"""Test colormap.py."""
import unittest
from trollimage import colormap
@@ -173,13 +171,3 @@ class TestColormapClass(unittest.TestCase):
3: (255, 255, 255), 4: (0, 0, 0)}
self.assertEqual(d, exp)
-
-
-def suite():
- """The suite for test_colormap.
- """
- loader = unittest.TestLoader()
- mysuite = unittest.TestSuite()
- mysuite.addTest(loader.loadTestsFromTestCase(TestColormapClass))
-
- return mysuite
=====================================
trollimage/tests/test_image.py
=====================================
@@ -27,18 +27,13 @@ import random
import sys
import tempfile
import unittest
+from unittest import mock
from collections import OrderedDict
from tempfile import NamedTemporaryFile
import numpy as np
-
from trollimage import image
-try:
- from unittest import mock
-except ImportError:
- import mock
-
EPSILON = 0.0001
@@ -755,6 +750,22 @@ class TestXRImage(unittest.TestCase):
img = xrimage.XRImage(data)
self.assertEqual(img.mode, 'YCbCrA')
+ def test_init_writability(self):
+ """Test data is writable after init.
+
+ Xarray >0.15 makes data read-only after expand_dims.
+
+ """
+ import xarray as xr
+ import numpy as np
+ from trollimage import xrimage
+ data = xr.DataArray([[0, 0.5, 0.5], [0.5, 0.25, 0.25]], dims=['y', 'x'])
+ img = xrimage.XRImage(data)
+ self.assertEqual(img.mode, 'L')
+ n_arr = np.asarray(img.data)
+ # if this succeeds then its writable
+ n_arr[n_arr == 0.5] = 1
+
def test_regression_double_format_save(self):
"""Test that double format information isn't passed to save."""
import xarray as xr
@@ -1963,21 +1974,3 @@ class TestXRImage(unittest.TestCase):
self.assertEqual(dummy_args, [({}, ), {}])
res.data.data.compute()
self.assertEqual(dummy_args, [(OrderedDict(), 'Hey', 'Jude'), {'chorus': "La lala lalalala"}])
-
-
-def suite():
- """Create the suite for test_image."""
- loader = unittest.TestLoader()
- mysuite = unittest.TestSuite()
- mysuite.addTest(loader.loadTestsFromTestCase(TestEmptyImage))
- mysuite.addTest(loader.loadTestsFromTestCase(TestImageCreation))
- mysuite.addTest(loader.loadTestsFromTestCase(TestRegularImage))
- mysuite.addTest(loader.loadTestsFromTestCase(TestFlatImage))
- mysuite.addTest(loader.loadTestsFromTestCase(TestNoDataImage))
- mysuite.addTest(loader.loadTestsFromTestCase(TestXRImage))
-
- return mysuite
-
-
-if __name__ == '__main__':
- unittest.main()
=====================================
trollimage/utilities.py
=====================================
@@ -1,21 +1,11 @@
+"""Simple utilities functions to handle colormaps and other use cases."""
+
from __future__ import division
-import matplotlib.pyplot as plt
import numpy as np
-import numpy.ma as ma
-import pickle
-import matplotlib.cm as cm
-import matplotlib as mpl
import sys
-from scipy import misc
-from trollimage.colormap import rdbu, spectral, greys, Colormap
+from trollimage.colormap import Colormap
from trollimage.image import Image
from PIL import Image as Pimage
-import matplotlib.colors as mcolors
-import matplotlib
-
-"""Some simple utilities functions to handle colormaps
-and to convert PIL image to GeoImage.
-"""
def _hex_to_rgb(value):
'''
=====================================
trollimage/version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
- git_refnames = " (HEAD -> master, tag: v1.11.0)"
- git_full = "103b269144d33bbcf106c8afa20de95618d5a890"
- git_date = "2019-10-24 20:12:03 +0200"
+ git_refnames = " (HEAD -> master, tag: v1.12.0)"
+ git_full = "19eb077dce183fafc5be452efd5022c1378ccb48"
+ git_date = "2020-03-02 13:11:54 -0600"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
=====================================
trollimage/xrimage.py
=====================================
@@ -294,10 +294,6 @@ class XRImage(object):
if not hasattr(data, 'dims'):
raise TypeError("Data must have a 'dims' attribute.")
- # doesn't actually copy the data underneath
- # we don't want our operations to change the user's data
- data = data.copy()
-
if 'y' not in data.dims or 'x' not in data.dims:
if data.ndim != 2:
raise ValueError("Data must have a 'y' and 'x' dimension")
@@ -320,6 +316,11 @@ class XRImage(object):
else:
raise ValueError("No 'bands' dimension provided.")
+ # doesn't actually copy the data underneath
+ # we don't want our operations to change the user's data
+ # we do this last in case `expand_dims` made the data read only
+ data = data.copy()
+
return data
@property
View it on GitLab: https://salsa.debian.org/debian-gis-team/trollimage/-/compare/2c8b615bbc13a0473d55d212a031c7abfdb6a08d...bb60f6eaa05fb9a03e0ebfa2ae1199e64073f0ba
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/trollimage/-/compare/2c8b615bbc13a0473d55d212a031c7abfdb6a08d...bb60f6eaa05fb9a03e0ebfa2ae1199e64073f0ba
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20200304/eba1460c/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list