pfc-geometry 0.2.7__tar.gz → 0.2.9__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 (35) hide show
  1. {pfc_geometry-0.2.7/pfc_geometry.egg-info → pfc_geometry-0.2.9}/PKG-INFO +1 -1
  2. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/geometry/base.py +1 -0
  3. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/geometry/point.py +1 -1
  4. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/geometry/quaternion.py +4 -2
  5. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/geometry/time.py +13 -10
  6. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/geometry/transformation.py +2 -2
  7. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9/pfc_geometry.egg-info}/PKG-INFO +1 -1
  8. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/.github/workflows/publish_pypi.yml +0 -0
  9. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/.gitignore +0 -0
  10. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/.vscode/settings.json +0 -0
  11. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/LICENSE +0 -0
  12. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/README.md +0 -0
  13. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/geometry/__init__.py +0 -0
  14. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/geometry/coordinate_frame.py +0 -0
  15. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/geometry/gps.py +0 -0
  16. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/geometry/mass.py +0 -0
  17. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/geometry/testing.py +0 -0
  18. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/pfc_geometry.egg-info/SOURCES.txt +0 -0
  19. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/pfc_geometry.egg-info/dependency_links.txt +0 -0
  20. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/pfc_geometry.egg-info/requires.txt +0 -0
  21. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/pfc_geometry.egg-info/top_level.txt +0 -0
  22. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/pyproject.toml +0 -0
  23. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/requirements-dev.txt +0 -0
  24. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/requirements.txt +0 -0
  25. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/setup.cfg +0 -0
  26. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/tests/__init__.py +0 -0
  27. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/tests/quat_body_diff_test.csv +0 -0
  28. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/tests/test_base.py +0 -0
  29. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/tests/test_coord.py +0 -0
  30. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/tests/test_gps.py +0 -0
  31. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/tests/test_mass.py +0 -0
  32. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/tests/test_point.py +0 -0
  33. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/tests/test_quaternion.py +0 -0
  34. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/tests/test_remove_outliers.csv +0 -0
  35. {pfc_geometry-0.2.7 → pfc_geometry-0.2.9}/tests/test_transform.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pfc-geometry
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: A package for handling 3D geometry with a nice interface
5
5
  Author-email: Thomas David <thomasdavid0@gmail.com>
6
6
  License: GNU GPL v3
@@ -331,3 +331,4 @@ class Base:
331
331
 
332
332
  return pd.DataFrame(np.column_stack([xf, y]), columns=['freq'] + self.cols).set_index('freq')
333
333
 
334
+
@@ -172,7 +172,7 @@ def is_perpendicular(a: Point, b: Point, tolerance=1e-6):
172
172
  @ppmeth
173
173
  def min_angle_between(p1: Point, p2: Point):
174
174
  angle = angle_between(p1, p2) % np.pi
175
- return min(angle, np.pi - angle)
175
+ return np.minimum(angle, np.pi - angle)
176
176
 
177
177
  def arbitrary_perpendicular(v: Point) -> Point:
178
178
  return Point(-v.y, v.x, 0).unit()
@@ -11,7 +11,7 @@ this program. If not, see <http://www.gnu.org/licenses/>.
11
11
  """
12
12
  from __future__ import annotations
13
13
  from .point import Point
14
- from .base import Base
14
+ from .base import Base, dprep
15
15
  from geometry import PZ
16
16
  import numpy as np
17
17
  import numpy.typing as npt
@@ -253,7 +253,9 @@ class Quaternion(Base):
253
253
  # does the rotation reverse the Z axis?
254
254
  return np.sign(self.transform_point(PZ()).z) > 0
255
255
 
256
-
256
+
257
+
258
+
257
259
 
258
260
  def Q0(count=1):
259
261
  return Quaternion.zero(count)
@@ -1,3 +1,4 @@
1
+ from __future__ import annotations
1
2
  from geometry import Base
2
3
  from numbers import Number
3
4
  from typing import Self
@@ -6,27 +7,30 @@ from time import time
6
7
 
7
8
 
8
9
  class Time(Base):
9
- cols=["t", "dt"]
10
-
10
+ cols = ["t", "dt"]
11
+
11
12
  @staticmethod
12
- def from_t(t: np.ndarray) -> Self:
13
+ def from_t(t: np.ndarray) -> Time:
13
14
  if isinstance(t, Number):
14
- return Time(t, 1/30)
15
+ return Time(t, 1 / 25)
15
16
  else:
16
17
  if len(t) == 1:
17
- dt = np.array([1/30])
18
+ dt = np.array([1 / 25])
18
19
  else:
19
20
  arr = np.diff(t)
20
21
  dt = np.concatenate([arr, [arr[-1]]])
21
22
  return Time(t, dt)
22
23
 
24
+ @staticmethod
25
+ def uniform(duration: float, npoints: int | None) -> Time:
26
+ return Time.from_t(
27
+ np.linspace(0, duration, npoints if npoints else int(np.ceil(duration * 25)))
28
+ )
29
+
23
30
  def scale(self, duration) -> Self:
24
31
  old_duration = self.t[-1] - self.t[0]
25
32
  sfac = duration / old_duration
26
- return Time(
27
- self.t[0] + (self.t - self.t[0]) * sfac,
28
- self.dt * sfac
29
- )
33
+ return Time(self.t[0] + (self.t - self.t[0]) * sfac, self.dt * sfac)
30
34
 
31
35
  def reset_zero(self):
32
36
  return Time(self.t - self.t[0], self.dt)
@@ -37,4 +41,3 @@ class Time(Base):
37
41
 
38
42
  def extend(self):
39
43
  return Time.concatenate([self, Time(self.t[-1] + self.dt[-1], self.dt[-1])])
40
-
@@ -27,11 +27,11 @@ class Transformation(Base):
27
27
  args = np.concatenate([args[0].data,Q0().data],axis=1)
28
28
  elif isinstance(args[0], Quaternion):
29
29
  args = np.concatenate([P0().data,args[0].data],axis=1)
30
- if len(args) == 2:
30
+ elif len(args) == 2:
31
31
  _q = args[0] if isinstance(args[0], Quaternion) else args[1]
32
32
  _p = args[0] if isinstance(args[0], Point) else args[1]
33
33
  assert isinstance(_q, Quaternion) and isinstance(_p, Point), f'expected a Point and a Quaternion, got a {_p.__class__.__name__} and a {_q.__class__.__name__}'
34
- args = np.concatenate([_p.data, _q.data], axis=1)
34
+ args = [np.concatenate([_p.data, _q.data], axis=1)]
35
35
  super().__init__(*args, **kwargs)
36
36
  self.p = Point(self.data[:,:3])
37
37
  self.q = Quaternion(self.data[:,3:])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pfc-geometry
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: A package for handling 3D geometry with a nice interface
5
5
  Author-email: Thomas David <thomasdavid0@gmail.com>
6
6
  License: GNU GPL v3
File without changes
File without changes
File without changes
File without changes