pfc-geometry 0.2.16__py3-none-any.whl → 0.2.17__py3-none-any.whl

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.
geometry/utils.py CHANGED
@@ -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 = np.sign(np.diff(arr).mean())
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]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pfc-geometry
3
- Version: 0.2.16
3
+ Version: 0.2.17
4
4
  Summary: A library for working with 3D geometry.
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -9,8 +9,8 @@ geometry/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  geometry/quaternion.py,sha256=J7Yk7qAUsH8SfjhcqQAF7Lw5hk_LGfpotVaVRyJnmeQ,12137
10
10
  geometry/time.py,sha256=VTfMHLxhcws8YESYvxxP8W_vSePvl4lwKRXHxFWhJeA,2695
11
11
  geometry/transformation.py,sha256=pEJXS7JYxu-f05ELTUUU4w7swcQPAgAxQNI6vPp5VCg,5242
12
- geometry/utils.py,sha256=N9AQsd1ZOYnOy5QdzpvaKIPRmzMlKsD6KTQersgEUFE,3278
13
- pfc_geometry-0.2.16.dist-info/METADATA,sha256=a8Vx72oxtR3fod_PGVtThklknv6ECqJ1cNINGSO8Wxo,1629
14
- pfc_geometry-0.2.16.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
- pfc_geometry-0.2.16.dist-info/licenses/LICENSE,sha256=z72U6pv-bQgJ_Svr4uCXnMjemsp38aSerhHEdEAOMJ4,7632
16
- pfc_geometry-0.2.16.dist-info/RECORD,,
12
+ geometry/utils.py,sha256=q7-aaxDzRDwl78-3XzdpcJuh5iL7I8lN5agk2WNWjSY,3443
13
+ pfc_geometry-0.2.17.dist-info/METADATA,sha256=9vxRWWyYmXUu7wmjaqTtMp015ePjd4BPAOJnktIfgI4,1629
14
+ pfc_geometry-0.2.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
+ pfc_geometry-0.2.17.dist-info/licenses/LICENSE,sha256=z72U6pv-bQgJ_Svr4uCXnMjemsp38aSerhHEdEAOMJ4,7632
16
+ pfc_geometry-0.2.17.dist-info/RECORD,,