[Git][debian-gis-team/python-affine][upstream] New upstream version 2.2.2

Bas Couwenberg gitlab at salsa.debian.org
Fri Dec 21 06:17:07 GMT 2018


Bas Couwenberg pushed to branch upstream at Debian GIS Project / python-affine


Commits:
4bea7a4c by Bas Couwenberg at 2018-12-21T06:08:42Z
New upstream version 2.2.2
- - - - -


5 changed files:

- AUTHORS.txt
- CHANGES.txt
- README.rst
- affine/__init__.py
- affine/tests/test_transform.py


Changes:

=====================================
AUTHORS.txt
=====================================
@@ -7,3 +7,4 @@ Authors
 - Kevin Wurster <wursterk at gmail.com>
 - Todd Small <todd_small at icloud.com>
 - Juan Luis Cano Rodríguez <juanlu at satellogic.com>
+- Kirill Kouzoubov


=====================================
CHANGES.txt
=====================================
@@ -1,6 +1,11 @@
 CHANGES
 =======
 
+2.2.2 (2018-12-20)
+------------------
+- Affine.itransform computed the wrong results for arrays with rotation or
+  shear (#40). This is fixed (#41).
+
 2.2.1 (2018-06-04)
 ------------------
 - Docstring improvements (#37).


=====================================
README.rst
=====================================
@@ -44,8 +44,8 @@ Matrices can be created by passing the values ``a, b, c, d, e, f`` to the
   Affine(1.0, 0.9999999999999999, 0.0,
          0.9999999999999999, 1.0, 0.0)
   >>> Affine.rotation(45.0)     # decimal degrees
-  Affine(0.7071067811865476, 0.7071067811865475, 0.0,
-         -0.7071067811865475, 0.7071067811865476, 0.0)
+  Affine(0.7071067811865476, -0.7071067811865475, 0.0,
+         0.7071067811865475, 0.7071067811865476, 0.0)
 
 These matrices can be applied to ``(x, y)`` tuples to obtain transformed
 coordinates ``(x', y')``.
@@ -62,8 +62,8 @@ They may also be multiplied together to combine transformations.
 .. code-block:: pycon
 
   >>> Affine.translation(1.0, 5.0) * Affine.rotation(45.0)
-  Affine(0.7071067811865476, 0.7071067811865475, 1.0,
-         -0.7071067811865475, 0.7071067811865476, 5.0)
+  Affine(0.7071067811865476, -0.7071067811865475, 1.0,
+         0.7071067811865475, 0.7071067811865476, 5.0)
 
 Usage with GIS data packages
 ----------------------------


=====================================
affine/__init__.py
=====================================
@@ -47,7 +47,7 @@ import math
 
 __all__ = ['Affine']
 __author__ = "Sean Gillies"
-__version__ = "2.2.1"
+__version__ = "2.2.2"
 
 EPSILON = 1e-5
 
@@ -516,7 +516,7 @@ class Affine(
         if self is not identity and self != identity:
             sa, sb, sc, sd, se, sf, _, _, _ = self
             for i, (x, y) in enumerate(seq):
-                seq[i] = (x * sa + y * sd + sc, x * sb + y * se + sf)
+                seq[i] = (x * sa + y * sb + sc, x * sd + y * se + sf)
 
     def __invert__(self):
         """Return the inverse transform.


=====================================
affine/tests/test_transform.py
=====================================
@@ -388,6 +388,13 @@ class PyAffineTestCase(unittest.TestCase):
         assert r is None, r
         assert pts == [(-8, -2), (2, 0), (-6, -4)]
 
+        A = Affine.rotation(33)
+        pts = [(4, 1), (-1, 0), (3, 2)]
+        pts_expect = [A*pt for pt in pts]
+        r = A.itransform(pts)
+        assert r is None
+        assert pts == pts_expect
+
     def test_mul_wrong_type(self):
         with pytest.raises(TypeError):
             Affine(1, 2, 3, 4, 5, 6) * None



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-affine/commit/4bea7a4cedf8a8e42f30d906313d5602101e9f67

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-affine/commit/4bea7a4cedf8a8e42f30d906313d5602101e9f67
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/20181221/9883e239/attachment-0001.html>


More information about the Pkg-grass-devel mailing list