pfc-geometry 0.2.15__tar.gz → 0.2.17__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.
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/PKG-INFO +1 -1
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/pyproject.toml +1 -1
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/base.py +0 -1
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/utils.py +5 -2
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/.dockerignore +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/.github/workflows/publish_pypi.yml +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/.gitignore +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/LICENSE +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/README.md +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/__init__.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/checks.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/coordinate_frame.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/gps.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/mass.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/point.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/py.typed +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/quaternion.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/time.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/src/geometry/transformation.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/tests/__init__.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/tests/test_base.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/tests/test_coord.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/tests/test_gps.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/tests/test_mass.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/tests/test_point.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/tests/test_quaternion.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/tests/test_remove_outliers.csv +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/tests/test_time.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/tests/test_transform.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/tests/test_utils.py +0 -0
- {pfc_geometry-0.2.15 → pfc_geometry-0.2.17}/uv.lock +0 -0
|
@@ -36,12 +36,15 @@ def get_index(
|
|
|
36
36
|
value: Number,
|
|
37
37
|
missing: float | Literal["throw"] = "throw",
|
|
38
38
|
direction: Literal["forward", "backward"] = "forward",
|
|
39
|
+
increasing: bool = None
|
|
39
40
|
):
|
|
40
41
|
"""given a value, find the index of the first location in the aray,
|
|
41
42
|
if no exact match, linearly interpolate in the index
|
|
42
43
|
assumes arr is monotonic increasing
|
|
43
|
-
raise value error outside of bounds and missing == "throw", else return missing
|
|
44
|
-
increasing
|
|
44
|
+
raise value error outside of bounds and missing == "throw", else return missing
|
|
45
|
+
increasing, is the array going up or down, if not given it will be inferred from the data
|
|
46
|
+
"""
|
|
47
|
+
increasing = np.sign(np.diff(arr).mean()) if increasing is None else increasing
|
|
45
48
|
res = np.argwhere(arr == value)
|
|
46
49
|
if len(res):
|
|
47
50
|
return res[0 if direction == "forward" else -1, 0]
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|