timelined_array 1.1.5__tar.gz → 1.1.8__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.
- {timelined_array-1.1.5 → timelined_array-1.1.8}/PKG-INFO +1 -1
- {timelined_array-1.1.5 → timelined_array-1.1.8}/pyproject.toml +2 -2
- {timelined_array-1.1.5 → timelined_array-1.1.8}/pyproject.toml.orig +2 -2
- {timelined_array-1.1.5 → timelined_array-1.1.8}/src/timelined_array/__init__.py +1 -1
- {timelined_array-1.1.5 → timelined_array-1.1.8}/src/timelined_array/time.py +9 -5
- {timelined_array-1.1.5 → timelined_array-1.1.8}/README.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: timelined_array
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.8
|
|
4
4
|
Summary: Manage easily 1 or multidimensionnal samples numpy arrays that are time related. Extends numpy without removing any of it's abilities on such arrays.
|
|
5
5
|
Author: Timothe Jost
|
|
6
6
|
Author-email: Timothe Jost <44769559+JostTim@users.noreply.github.com>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "timelined_array"
|
|
3
3
|
description = "Manage easily 1 or multidimensionnal samples numpy arrays that are time related. Extends numpy without removing any of it's abilities on such arrays."
|
|
4
|
-
version = "1.1.
|
|
4
|
+
version = "1.1.8"
|
|
5
5
|
dependencies = ["numpy>=2"]
|
|
6
6
|
requires-python = ">=3.12"
|
|
7
7
|
readme = "README.md"
|
|
@@ -54,7 +54,7 @@ omit = [
|
|
|
54
54
|
]
|
|
55
55
|
|
|
56
56
|
[tool.bumpversion]
|
|
57
|
-
current_version = "1.1.
|
|
57
|
+
current_version = "1.1.8"
|
|
58
58
|
parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)'
|
|
59
59
|
serialize = ["{major}.{minor}.{patch}"]
|
|
60
60
|
search = "{current_version}"
|
|
@@ -4,7 +4,7 @@ description = "Manage easily 1 or multidimensionnal samples numpy arrays that ar
|
|
|
4
4
|
authors = [
|
|
5
5
|
{ name = "Timothe Jost", email = "44769559+JostTim@users.noreply.github.com" },
|
|
6
6
|
]
|
|
7
|
-
version = "1.1.
|
|
7
|
+
version = "1.1.8"
|
|
8
8
|
dependencies = ["numpy>=2"]
|
|
9
9
|
requires-python = ">=3.12"
|
|
10
10
|
readme = "README.md"
|
|
@@ -45,7 +45,7 @@ testpaths = ["tests"]
|
|
|
45
45
|
omit = [".vscode/*", ".tests/*"]
|
|
46
46
|
|
|
47
47
|
[tool.bumpversion]
|
|
48
|
-
current_version = "1.1.
|
|
48
|
+
current_version = "1.1.8"
|
|
49
49
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
|
50
50
|
serialize = ["{major}.{minor}.{patch}"]
|
|
51
51
|
search = "{current_version}"
|
|
@@ -374,7 +374,10 @@ class TimeIndexer[A: "BaseTimeArray"]:
|
|
|
374
374
|
# use : (wich is equivalent to None in the slice.stop object)
|
|
375
375
|
stop = len(self.array.timeline)
|
|
376
376
|
|
|
377
|
-
|
|
377
|
+
# we make stop - 1 here because : array[3:5] for an array of size 5 is allowed,
|
|
378
|
+
# but array[5] for an array of size 5 is not, and hence, yould raise an error.
|
|
379
|
+
# (on top of the value being wrong by one element for any non terminal value)
|
|
380
|
+
self.check_step_size_below_maximum(stop - 1, time_stop)
|
|
378
381
|
return stop
|
|
379
382
|
|
|
380
383
|
def get_step_index(self, time_step: float | None) -> int:
|
|
@@ -771,14 +774,15 @@ class BaseTimeArray(np.ndarray): # All time arrays are numpy arrays
|
|
|
771
774
|
def max_time(self) -> float:
|
|
772
775
|
"""Return the maximum time (in time units) from the timeline."""
|
|
773
776
|
|
|
774
|
-
|
|
775
|
-
return self.timeline.max()
|
|
777
|
+
return float(self.timeline.max())
|
|
776
778
|
|
|
777
779
|
def min_time(self) -> float:
|
|
778
780
|
"""Get the minimum time (in time units) from the timeline."""
|
|
779
781
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
+
return float(self.timeline.min())
|
|
783
|
+
|
|
784
|
+
def duration(self) -> float:
|
|
785
|
+
return self.max_time() - self.min_time()
|
|
782
786
|
|
|
783
787
|
def rebase_timeline(self: Self, at: float = 0.0) -> Self:
|
|
784
788
|
"""Rebases the timeline of the array.
|
|
File without changes
|