pfc-geometry 0.2.21__tar.gz → 0.2.22__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.21 → pfc_geometry-0.2.22}/PKG-INFO +1 -1
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/pyproject.toml +1 -1
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/base.py +4 -2
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/utils.py +4 -2
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/.dockerignore +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/.github/workflows/publish_pypi.yml +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/.gitignore +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/LICENSE +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/README.md +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/__init__.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/air.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/angles.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/checks.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/coordinate_frame.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/gps.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/mass.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/point.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/py.typed +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/quaternion.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/time.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/src/geometry/transformation.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/__init__.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/test_angles.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/test_base.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/test_coord.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/test_gps.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/test_mass.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/test_point.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/test_quaternion.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/test_remove_outliers.csv +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/test_time.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/test_transform.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/tests/test_utils.py +0 -0
- {pfc_geometry-0.2.21 → pfc_geometry-0.2.22}/uv.lock +0 -0
|
@@ -265,9 +265,11 @@ class Base:
|
|
|
265
265
|
if not pd.api.types.is_list_like(dt):
|
|
266
266
|
dt = np.full(len(self), dt)
|
|
267
267
|
self, dt = Base.length_check(self, dt)
|
|
268
|
-
|
|
268
|
+
if method=="gradient":
|
|
269
|
+
data = np.gradient(self.data, axis=0) if len(self) >1 else np.zeros(self.data.shape)
|
|
270
|
+
else:
|
|
271
|
+
data = np.diff(self.data, axis=0)
|
|
269
272
|
|
|
270
|
-
data = diff_method(self.data, axis=0)
|
|
271
273
|
dt = dt if method == "gradient" else dt[:-1]
|
|
272
274
|
return self.__class__(data / np.tile(dt, (len(self.__class__.cols), 1)).T)
|
|
273
275
|
|
|
@@ -86,6 +86,8 @@ def get_value(arr: npt.NDArray, index: Number):
|
|
|
86
86
|
|
|
87
87
|
def apply_index_slice(index: npt.NDArray, value: slice | Number | npt.ArrayLike | None):
|
|
88
88
|
if isinstance(value, slice):
|
|
89
|
+
if value.start is not None and value.stop is not None and value.start >= value.stop:
|
|
90
|
+
return np.array([], dtype=index.dtype)
|
|
89
91
|
middle = pd.Index(index)[
|
|
90
92
|
int(np.ceil(value.start)) if value.start is not None else None : int(
|
|
91
93
|
np.ceil(value.stop)
|
|
@@ -93,9 +95,9 @@ def apply_index_slice(index: npt.NDArray, value: slice | Number | npt.ArrayLike
|
|
|
93
95
|
if value.stop is not None
|
|
94
96
|
else None
|
|
95
97
|
]
|
|
96
|
-
if value.start is not None and middle[0] != value.start and value.start > index[0]:
|
|
98
|
+
if value.start is not None and (len(middle) == 0 or middle[0] != value.start) and value.start > index[0]:
|
|
97
99
|
middle = np.concatenate([[get_value(index, value.start)], middle])
|
|
98
|
-
if value.stop is not None and middle[-1] != value.stop and value.stop < index[-1]:
|
|
100
|
+
if value.stop is not None and (len(middle) == 0 or middle[-1] != value.stop) and value.stop < index[-1]:
|
|
99
101
|
middle = np.concatenate([middle, [get_value(index, value.stop)]])
|
|
100
102
|
return middle
|
|
101
103
|
else:
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|