transformnd 0.4.0__tar.gz → 0.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {transformnd-0.4.0 → transformnd-0.4.2}/PKG-INFO +18 -5
  2. {transformnd-0.4.0 → transformnd-0.4.2}/README.md +2 -2
  3. {transformnd-0.4.0 → transformnd-0.4.2}/pyproject.toml +13 -3
  4. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/transforms/affine.py +2 -2
  5. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/__init__.py +0 -0
  6. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/adapters/__init__.py +0 -0
  7. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/adapters/base.py +0 -0
  8. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/adapters/bounding_box.py +0 -0
  9. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/adapters/pandas.py +0 -0
  10. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/adapters/polars.py +0 -0
  11. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/adapters/shapely.py +0 -0
  12. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/base.py +0 -0
  13. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/constants.py +0 -0
  14. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/extents/__init__.py +0 -0
  15. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/extents/base.py +0 -0
  16. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/extents/bounding_box.py +0 -0
  17. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/graph.py +0 -0
  18. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/py.typed +0 -0
  19. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/transforms/__init__.py +0 -0
  20. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/transforms/bijection.py +0 -0
  21. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/transforms/by_dimension.py +0 -0
  22. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/transforms/map_axis.py +0 -0
  23. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/transforms/moving_least_squares.py +0 -0
  24. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/transforms/reflection.py +0 -0
  25. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/transforms/simple.py +0 -0
  26. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/transforms/thinplate.py +0 -0
  27. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/transforms/vector_field.py +0 -0
  28. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/types.py +0 -0
  29. {transformnd-0.4.0 → transformnd-0.4.2}/src/transformnd/util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: transformnd
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: ND coordinate transformations
5
5
  Author: Chris Barnes
6
6
  Author-email: Chris Barnes <chris.barnes@gerbi-gmb.de>
@@ -20,24 +20,37 @@ Requires-Dist: numpy>=2
20
20
  Requires-Dist: networkx>=3
21
21
  Requires-Dist: array-api-compat>=1.14
22
22
  Requires-Dist: typing-extensions>=4.15.0
23
- Requires-Dist: dask[dask]>=2026.3.0
24
- Requires-Dist: dask-image[dask]>=2026.5.0
23
+ Requires-Dist: transformnd[pandas] ; extra == 'adapters'
24
+ Requires-Dist: transformnd[shapely] ; extra == 'adapters'
25
+ Requires-Dist: transformnd[polars] ; extra == 'adapters'
26
+ Requires-Dist: transformnd[transforms] ; extra == 'all'
27
+ Requires-Dist: transformnd[adapters] ; extra == 'all'
25
28
  Requires-Dist: molesq>=0.4.0 ; extra == 'movingleastsquares'
26
29
  Requires-Dist: pandas>=3.0.2 ; extra == 'pandas'
27
30
  Requires-Dist: polars>=1.40.1 ; extra == 'polars'
28
31
  Requires-Dist: shapely>=2.1.2 ; extra == 'shapely'
29
32
  Requires-Dist: morphops>=0.1.13 ; extra == 'thinplatesplines'
33
+ Requires-Dist: transformnd[thinplatesplines] ; extra == 'transforms'
34
+ Requires-Dist: transformnd[movingleastsquares] ; extra == 'transforms'
35
+ Requires-Dist: transformnd[vectorfield] ; extra == 'transforms'
36
+ Requires-Dist: transformnd[vectorfield-dask] ; extra == 'transforms'
30
37
  Requires-Dist: scipy>=1.17.1 ; extra == 'vectorfield'
38
+ Requires-Dist: dask>=2026.3.0 ; extra == 'vectorfield-dask'
39
+ Requires-Dist: dask-image>=2026.5.0 ; extra == 'vectorfield-dask'
31
40
  Requires-Python: >=3.12, <4.0
32
41
  Project-URL: documentation, https://transformnd.readthedocs.io/en/latest/
33
42
  Project-URL: source, https://github.com/clbarnes/transformnd
34
43
  Project-URL: issues, https://github.com/clbarnes/transformnd/issues
44
+ Provides-Extra: adapters
45
+ Provides-Extra: all
35
46
  Provides-Extra: movingleastsquares
36
47
  Provides-Extra: pandas
37
48
  Provides-Extra: polars
38
49
  Provides-Extra: shapely
39
50
  Provides-Extra: thinplatesplines
51
+ Provides-Extra: transforms
40
52
  Provides-Extra: vectorfield
53
+ Provides-Extra: vectorfield-dask
41
54
  Description-Content-Type: text/markdown
42
55
 
43
56
  # transformnd
@@ -88,8 +101,8 @@ All transforms are accessed under the `transformnd.transforms` subpackage.
88
101
  | `ByDimension` | | Apply different transformations to subsets of the input coordinates' dimensions |
89
102
  | `moving_least_squares.MovingLeastSquares` | `movingleastsquares` | Landmark-based transformation. |
90
103
  | `thin_plate_splines.ThinPlateSplines` | `thinplatesplines` | Landmark-based transformation. |
91
- | `vector_field.Coordinates` | `vectorfield` | Look up output coordinates in a vector field indexed by the input coordinates |
92
- | `vector_field.Displacements` | `vectorfield` | Look up translations in a vector field indexed by the input coordinates, and add them to input coordinates |
104
+ | `vector_field.Coordinates` | `vectorfield` for in-memory, `vectorfield-dask` for chunked | Look up output coordinates in a vector field indexed by the input coordinates |
105
+ | `vector_field.Displacements` | `vectorfield`, `vectorfield-dask` for chunked | Look up translations in a vector field indexed by the input coordinates, and add them to input coordinates |
93
106
 
94
107
  Arbitrary transforms can be composed into a `TransformSequence` with `transform1 | transform2`.
95
108
  A graph of transforms between defined spaces can be traversed using the `TransformGraph`.
@@ -46,8 +46,8 @@ All transforms are accessed under the `transformnd.transforms` subpackage.
46
46
  | `ByDimension` | | Apply different transformations to subsets of the input coordinates' dimensions |
47
47
  | `moving_least_squares.MovingLeastSquares` | `movingleastsquares` | Landmark-based transformation. |
48
48
  | `thin_plate_splines.ThinPlateSplines` | `thinplatesplines` | Landmark-based transformation. |
49
- | `vector_field.Coordinates` | `vectorfield` | Look up output coordinates in a vector field indexed by the input coordinates |
50
- | `vector_field.Displacements` | `vectorfield` | Look up translations in a vector field indexed by the input coordinates, and add them to input coordinates |
49
+ | `vector_field.Coordinates` | `vectorfield` for in-memory, `vectorfield-dask` for chunked | Look up output coordinates in a vector field indexed by the input coordinates |
50
+ | `vector_field.Displacements` | `vectorfield`, `vectorfield-dask` for chunked | Look up translations in a vector field indexed by the input coordinates, and add them to input coordinates |
51
51
 
52
52
  Arbitrary transforms can be composed into a `TransformSequence` with `transform1 | transform2`.
53
53
  A graph of transforms between defined spaces can be traversed using the `TransformGraph`.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "transformnd"
3
- version = "0.4.0"
3
+ version = "0.4.2"
4
4
  description = "ND coordinate transformations"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Chris Barnes", email = "chris.barnes@gerbi-gmb.de" }]
@@ -10,8 +10,6 @@ dependencies = [
10
10
  "networkx>=3",
11
11
  "array_api_compat>=1.14",
12
12
  "typing-extensions>=4.15.0",
13
- "dask[dask]>=2026.3.0",
14
- "dask-image[dask]>=2026.5.0",
15
13
  ]
16
14
  license = "MIT"
17
15
  classifiers = [
@@ -46,6 +44,18 @@ polars = [
46
44
  vectorfield = [
47
45
  "scipy>=1.17.1",
48
46
  ]
47
+ vectorfield-dask = [
48
+ "dask>=2026.3.0",
49
+ "dask-image>=2026.5.0",
50
+ ]
51
+ transforms = [
52
+ "transformnd[thinplatesplines]",
53
+ "transformnd[movingleastsquares]",
54
+ "transformnd[vectorfield]",
55
+ "transformnd[vectorfield-dask]",
56
+ ]
57
+ adapters = ["transformnd[pandas]", "transformnd[shapely]", "transformnd[polars]"]
58
+ all = ["transformnd[transforms]", "transformnd[adapters]"]
49
59
 
50
60
  [dependency-groups]
51
61
  dev = [
@@ -15,7 +15,7 @@ from copy import copy
15
15
 
16
16
  from array_api_compat import array_namespace, device as xp_device
17
17
  from ..base import Transform, ArrayT
18
- from ..util import as_floats, none_eq
18
+ from ..util import as_floats, none_eq, is_square
19
19
  from ..types import NDims, Spaces
20
20
 
21
21
 
@@ -69,7 +69,7 @@ class Affine(Transform[ArrayT]):
69
69
  self.matrix: np.ndarray = m
70
70
 
71
71
  self._linear_map: np.ndarray | None = m[:-1, :-1]
72
- if np.allclose(
72
+ if is_square(self._linear_map) and np.allclose(
73
73
  self._linear_map, np.eye(self._linear_map.shape[0], dtype=self.matrix.dtype)
74
74
  ):
75
75
  self._linear_map = None