pysnapping 0.2.2__tar.gz → 0.2.3__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.
- {pysnapping-0.2.2 → pysnapping-0.2.3}/.gitignore +1 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/PKG-INFO +4 -3
- {pysnapping-0.2.2 → pysnapping-0.2.3}/dev-requirements.txt +1 -1
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pyproject.toml +2 -4
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/linear_referencing.py +6 -9
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/snap.py +1 -1
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/test/test_snap.py +10 -10
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping.egg-info/PKG-INFO +4 -3
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping.egg-info/SOURCES.txt +2 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping.egg-info/requires.txt +1 -1
- pysnapping-0.2.3/pysnapping.egg-info/scm_file_list.json +27 -0
- pysnapping-0.2.3/pysnapping.egg-info/scm_version.json +8 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/requirements.txt +1 -1
- {pysnapping-0.2.2 → pysnapping-0.2.3}/.editorconfig +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/.gitlab-ci.yml +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/.pre-commit-config.yaml +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/LICENSE +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/MANIFEST.in +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/README.md +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/dev-requirements.in +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/__init__.py +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/py.typed +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/stats.py +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/test/__init__.py +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/test/complex_trip.geojson +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/test/conftest.py +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/test/test_linear_referencing.py +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/test/test_util.py +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping/util.py +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping.egg-info/dependency_links.txt +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/pysnapping.egg-info/top_level.txt +0 -0
- {pysnapping-0.2.2 → pysnapping-0.2.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pysnapping
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Snap points to a line string keeping a given order or spacing intact
|
|
5
5
|
Author-email: Alexander Held | geOps <alexander.held@geops.com>
|
|
6
6
|
Maintainer-email: Alexander Held | geOps <alexander.held@geops.com>
|
|
@@ -40,8 +40,9 @@ Requires-Python: >=3.9
|
|
|
40
40
|
Description-Content-Type: text/markdown
|
|
41
41
|
License-File: LICENSE
|
|
42
42
|
Requires-Dist: shapely
|
|
43
|
-
Requires-Dist: numpy
|
|
43
|
+
Requires-Dist: numpy~=2.0
|
|
44
44
|
Requires-Dist: pyproj>=3.2.0
|
|
45
|
+
Dynamic: license-file
|
|
45
46
|
|
|
46
47
|
# PySnapping
|
|
47
48
|
|
|
@@ -4,7 +4,7 @@ description = "Snap points to a line string keeping a given order or spacing int
|
|
|
4
4
|
readme = "README.md"
|
|
5
5
|
dependencies = [
|
|
6
6
|
"shapely",
|
|
7
|
-
"numpy
|
|
7
|
+
"numpy~=2.0", # for vectorized operations
|
|
8
8
|
"pyproj>=3.2.0", # for defining custom CRS
|
|
9
9
|
]
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -60,6 +60,7 @@ select = [
|
|
|
60
60
|
"PIE", # unnecessary statements
|
|
61
61
|
"SLOT", # str, tuple, namedtuple subclasses need __slots__
|
|
62
62
|
"FIX003", # line contains XXX
|
|
63
|
+
"NPY201", # numpy 2.0 deprecations
|
|
63
64
|
]
|
|
64
65
|
ignore = [
|
|
65
66
|
"E501", # line too long
|
|
@@ -71,9 +72,6 @@ max-complexity = 12
|
|
|
71
72
|
|
|
72
73
|
[tool.mypy]
|
|
73
74
|
ignore_missing_imports = true
|
|
74
|
-
plugins = [
|
|
75
|
-
"numpy.typing.mypy_plugin",
|
|
76
|
-
]
|
|
77
75
|
install_types = true
|
|
78
76
|
non_interactive = true
|
|
79
77
|
|
|
@@ -14,9 +14,6 @@ from math import floor
|
|
|
14
14
|
|
|
15
15
|
import numpy as np
|
|
16
16
|
|
|
17
|
-
# faster than np.clip
|
|
18
|
-
from numpy.core.umath import clip # type: ignore
|
|
19
|
-
|
|
20
17
|
from . import ExtrapolationError
|
|
21
18
|
|
|
22
19
|
|
|
@@ -389,7 +386,7 @@ class LineFractions:
|
|
|
389
386
|
else:
|
|
390
387
|
high = 1.0
|
|
391
388
|
|
|
392
|
-
fractions = clip(fractions, low, high)
|
|
389
|
+
fractions = np.clip(fractions, low, high)
|
|
393
390
|
|
|
394
391
|
projected_points = fractions * segment_dirs
|
|
395
392
|
projected_points += segment_starts
|
|
@@ -527,9 +524,9 @@ class LineFractions:
|
|
|
527
524
|
i,
|
|
528
525
|
segment_indices[keep],
|
|
529
526
|
# clip to segments
|
|
530
|
-
clip(min_fractions[keep], 0, 1),
|
|
531
|
-
clip(closest_fractions[keep], 0, 1),
|
|
532
|
-
clip(max_fractions[keep], 0, 1),
|
|
527
|
+
np.clip(min_fractions[keep], 0, 1),
|
|
528
|
+
np.clip(closest_fractions[keep], 0, 1),
|
|
529
|
+
np.clip(max_fractions[keep], 0, 1),
|
|
533
530
|
)
|
|
534
531
|
ball_slices.append(slfs)
|
|
535
532
|
return ball_slices
|
|
@@ -726,14 +723,14 @@ def substrings(
|
|
|
726
723
|
frac_start_ceil = np.ceil(frac_start)
|
|
727
724
|
first = frac_start_ceil.astype(int)
|
|
728
725
|
first[frac_start == frac_start_ceil] += 1
|
|
729
|
-
clip(first, starts.from_vertices, starts.to_vertices + 1, out=first)
|
|
726
|
+
np.clip(first, starts.from_vertices, starts.to_vertices + 1, out=first)
|
|
730
727
|
|
|
731
728
|
# the last indices that are not convered by end interpolation/extrapolation
|
|
732
729
|
frac_end = ends.get_fractional_indices()
|
|
733
730
|
frac_end_floor = np.floor(frac_end)
|
|
734
731
|
last = frac_end_floor.astype(int)
|
|
735
732
|
last[frac_end == frac_end_floor] -= 1
|
|
736
|
-
clip(last, ends.from_vertices - 1, ends.to_vertices, out=last)
|
|
733
|
+
np.clip(last, ends.from_vertices - 1, ends.to_vertices, out=last)
|
|
737
734
|
|
|
738
735
|
data_length = len(data)
|
|
739
736
|
start_data = interpolate(data, starts)
|
|
@@ -593,7 +593,7 @@ class TrajectoryTrip(XYZDMixin):
|
|
|
593
593
|
)
|
|
594
594
|
# if the spacing was not ok, it can still be bad after untrusting all points
|
|
595
595
|
# since the total length can be too short for the points
|
|
596
|
-
untrusted_dists = np.full_like(self.dists, np.
|
|
596
|
+
untrusted_dists = np.full_like(self.dists, np.nan)
|
|
597
597
|
if not traj_spacing_ok(untrusted_dists):
|
|
598
598
|
raise SnappingError(
|
|
599
599
|
f"trajectory of length {self.trajectory.length:g} is too short "
|
|
@@ -56,21 +56,21 @@ def segment_lengths_to_dists(segment_lengths, start=0):
|
|
|
56
56
|
"values,d_min,d_max,min_spacing,consider_sampling_accuracy,ok",
|
|
57
57
|
[
|
|
58
58
|
([], 0, 0, 10, False, True),
|
|
59
|
-
([np.
|
|
59
|
+
([np.nan], 0, 0, 10, False, True),
|
|
60
60
|
([0], 0, 0, 10, False, True),
|
|
61
61
|
([1], 0, 1, 10, False, True),
|
|
62
62
|
([1], 0, 1 - 1e-6, 10, False, False),
|
|
63
|
-
([np.
|
|
64
|
-
([np.
|
|
65
|
-
([-1, np.
|
|
66
|
-
([-1, np.
|
|
67
|
-
([-1, np.
|
|
68
|
-
([np.
|
|
69
|
-
([np.
|
|
63
|
+
([np.nan, 1, np.nan], 0, 2, 1 - 1e-6, False, True),
|
|
64
|
+
([np.nan, 1, np.nan], 0, 1.9, 1, False, False),
|
|
65
|
+
([-1, np.nan, np.nan, 0], -10, 10, 1, False, False),
|
|
66
|
+
([-1, np.nan, np.nan, 0], -10, 10, 0.5, False, False),
|
|
67
|
+
([-1, np.nan, np.nan, 0], -10, 10, 1 / 3 - 1e-6, False, True),
|
|
68
|
+
([np.nan, np.nan, np.nan], -100, 0, 50 - 1e-6, False, True),
|
|
69
|
+
([np.nan, np.nan, np.nan], -100, 0, 50 + 1e-6, False, False),
|
|
70
70
|
([0, 0, 1, 1, 1.001, 1.001, 10, 10], 0, 10, 0, False, True),
|
|
71
71
|
([0, 0, 1, 1, 1.001, 1.001, 10, 10], 0, 10, 0, True, True),
|
|
72
|
-
([0, 0, 1, np.
|
|
73
|
-
([0, 0, 1, np.
|
|
72
|
+
([0, 0, 1, np.nan, 1, 1.001, 1.001, 10, 10], 0, 10, 0, False, True),
|
|
73
|
+
([0, 0, 1, np.nan, 1, 1.001, 1.001, 10, 10], 0, 10, 0, True, False),
|
|
74
74
|
([-1e9, 1e9], -1e9, 1e9, 0, False, True),
|
|
75
75
|
([-1e9, 1e9], -1e9, 1e9, 0, True, True),
|
|
76
76
|
([-1e9, 1e9], -1e9, 1e9, 2.01 * 5.0, False, True),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pysnapping
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Snap points to a line string keeping a given order or spacing intact
|
|
5
5
|
Author-email: Alexander Held | geOps <alexander.held@geops.com>
|
|
6
6
|
Maintainer-email: Alexander Held | geOps <alexander.held@geops.com>
|
|
@@ -40,8 +40,9 @@ Requires-Python: >=3.9
|
|
|
40
40
|
Description-Content-Type: text/markdown
|
|
41
41
|
License-File: LICENSE
|
|
42
42
|
Requires-Dist: shapely
|
|
43
|
-
Requires-Dist: numpy
|
|
43
|
+
Requires-Dist: numpy~=2.0
|
|
44
44
|
Requires-Dist: pyproj>=3.2.0
|
|
45
|
+
Dynamic: license-file
|
|
45
46
|
|
|
46
47
|
# PySnapping
|
|
47
48
|
|
|
@@ -19,6 +19,8 @@ pysnapping.egg-info/PKG-INFO
|
|
|
19
19
|
pysnapping.egg-info/SOURCES.txt
|
|
20
20
|
pysnapping.egg-info/dependency_links.txt
|
|
21
21
|
pysnapping.egg-info/requires.txt
|
|
22
|
+
pysnapping.egg-info/scm_file_list.json
|
|
23
|
+
pysnapping.egg-info/scm_version.json
|
|
22
24
|
pysnapping.egg-info/top_level.txt
|
|
23
25
|
pysnapping/test/__init__.py
|
|
24
26
|
pysnapping/test/complex_trip.geojson
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
"pyproject.toml",
|
|
4
|
+
"LICENSE",
|
|
5
|
+
"MANIFEST.in",
|
|
6
|
+
".pre-commit-config.yaml",
|
|
7
|
+
"dev-requirements.in",
|
|
8
|
+
"README.md",
|
|
9
|
+
".gitignore",
|
|
10
|
+
"requirements.txt",
|
|
11
|
+
".gitlab-ci.yml",
|
|
12
|
+
".editorconfig",
|
|
13
|
+
"dev-requirements.txt",
|
|
14
|
+
"pysnapping/__init__.py",
|
|
15
|
+
"pysnapping/linear_referencing.py",
|
|
16
|
+
"pysnapping/util.py",
|
|
17
|
+
"pysnapping/snap.py",
|
|
18
|
+
"pysnapping/py.typed",
|
|
19
|
+
"pysnapping/stats.py",
|
|
20
|
+
"pysnapping/test/__init__.py",
|
|
21
|
+
"pysnapping/test/test_snap.py",
|
|
22
|
+
"pysnapping/test/test_util.py",
|
|
23
|
+
"pysnapping/test/test_linear_referencing.py",
|
|
24
|
+
"pysnapping/test/conftest.py",
|
|
25
|
+
"pysnapping/test/complex_trip.geojson"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|