Skip to content
Commits on Source (4)
......@@ -7,3 +7,4 @@ Authors
- Kevin Wurster <wursterk@gmail.com>
- Todd Small <todd_small@icloud.com>
- Juan Luis Cano Rodríguez <juanlu@satellogic.com>
- Kirill Kouzoubov
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).
......
......@@ -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
----------------------------
......
......@@ -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.
......
......@@ -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
......
python-affine (2.2.1-2) UNRELEASED; urgency=medium
python-affine (2.2.2-1) unstable; urgency=medium
* New upstream release.
* Bump Standards-Version to 4.2.1, no changes.
* Drop autopkgtests to test installability & module import.
* Add lintian override for testsuite-autopkgtest-missing.
* Update watch file to limit matches to archive path.
-- Bas Couwenberg <sebastic@debian.org> Thu, 05 Jul 2018 11:04:26 +0200
-- Bas Couwenberg <sebastic@debian.org> Fri, 21 Dec 2018 07:09:24 +0100
python-affine (2.2.1-1) unstable; urgency=medium
......