timelined_array 1.0.2__tar.gz → 1.0.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: timelined_array
3
- Version: 1.0.2
3
+ Version: 1.0.9
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>
@@ -9,6 +9,7 @@ Requires-Dist: numpy>=2
9
9
  Requires-Python: >=3.12
10
10
  Project-URL: Homepage, https://pypi.org/project/timelined_array/
11
11
  Project-URL: Source, https://github.com/JostTim/timelined_array
12
+ Project-URL: Changelog, https://github.com/JostTim/timelined_array/blob/main/CHANGELOG.md
12
13
  Description-Content-Type: text/markdown
13
14
 
14
15
  # timelined_array
@@ -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.0.2"
4
+ version = "1.0.9"
5
5
  dependencies = ["numpy>=2"]
6
6
  requires-python = ">=3.12"
7
7
  readme = "README.md"
@@ -16,6 +16,7 @@ text = "MIT"
16
16
  [project.urls]
17
17
  Homepage = "https://pypi.org/project/timelined_array/"
18
18
  Source = "https://github.com/JostTim/timelined_array"
19
+ Changelog = "https://github.com/JostTim/timelined_array/blob/main/CHANGELOG.md"
19
20
 
20
21
  [dependency-groups]
21
22
  dev = [
@@ -53,7 +54,7 @@ omit = [
53
54
  ]
54
55
 
55
56
  [tool.bumpversion]
56
- current_version = "1.0.2"
57
+ current_version = "1.0.9"
57
58
  parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)'
58
59
  serialize = ["{major}.{minor}.{patch}"]
59
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.0.2"
7
+ version = "1.0.9"
8
8
  dependencies = ["numpy>=2"]
9
9
  requires-python = ">=3.12"
10
10
  readme = "README.md"
@@ -13,6 +13,7 @@ license = { text = "MIT" }
13
13
  [project.urls]
14
14
  "Homepage" = "https://pypi.org/project/timelined_array/"
15
15
  "Source" = "https://github.com/JostTim/timelined_array"
16
+ "Changelog" = "https://github.com/JostTim/timelined_array/blob/main/CHANGELOG.md"
16
17
 
17
18
  [dependency-groups]
18
19
  dev = [
@@ -44,7 +45,7 @@ testpaths = ["tests"]
44
45
  omit = [".vscode/*", ".tests/*"]
45
46
 
46
47
  [tool.bumpversion]
47
- current_version = "1.0.2"
48
+ current_version = "1.0.9"
48
49
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
49
50
  serialize = ["{major}.{minor}.{patch}"]
50
51
  search = "{current_version}"
@@ -1,4 +1,4 @@
1
- __version__ = "1.0.2"
1
+ __version__ = "1.0.9"
2
2
  __all__ = ["BaseTimeArray", "MaskedTimelinedArray", "Timeline", "TimelinedArray"]
3
3
 
4
4
 
@@ -233,10 +233,12 @@ class TimeIndexer[A: "BaseTimeArray"]:
233
233
  Raises:
234
234
  ValueError: If the input time type is not supported.
235
235
  """
236
- # argument index may be a slice or a scalar. Units of index should be in second. Returns a slice as index
237
- # this is sort of a wrapper for get_time_slice that does the heavy lifting.
236
+ # argument index may be a slice or a scalar. Units of index should be in your time unit.
237
+ # Returns a slice as index
238
+ # this is sort of a wrapper for the different types of indices objects,
239
+ # around get_time_slice that does the heavy lifting.
238
240
  # this function just makes sure to pass arguments to it corectly depending
239
- # on if the time index is a single value or a slice.
241
+ # on the according index object type.
240
242
 
241
243
  if isinstance(time, slice):
242
244
  # if we get a slice of times, we return a slice of indices
@@ -267,8 +269,6 @@ class TimeIndexer[A: "BaseTimeArray"]:
267
269
  def max_step(self) -> np.floating:
268
270
  return abs(self.array.timeline.max_step)
269
271
 
270
- seconds_to_index = time_to_index
271
-
272
272
  def insert_time_index_into_full_index[T: "int | slice | np.ndarray"](
273
273
  self, time_index: T
274
274
  ) -> tuple[slice | T, ...]:
@@ -316,7 +316,8 @@ class TimeIndexer[A: "BaseTimeArray"]:
316
316
  if hasattr(index, "__iter__"):
317
317
  # if not isinstance(index,(int,float,slice,np.integer,np.floating)):
318
318
  raise ValueError(
319
- "Isec allow only indexing on time dimension. Index must be either int, float or slice, not iterable"
319
+ "TimeIndexer only allows indexing on time dimension. "
320
+ "Index must be either int, float or slice, not iterable"
320
321
  )
321
322
 
322
323
  index_time = self.time_to_index(index)
@@ -389,12 +390,12 @@ class TimeIndexer[A: "BaseTimeArray"]:
389
390
  time_stop: float | None = None,
390
391
  time_step: float | None = None,
391
392
  ) -> slice:
392
- """Get the index range based on the given start, stop, and step values in seconds.
393
+ """Get the index range based on the given start, stop, and step values in time unit.
393
394
 
394
395
  Args:
395
- sec_start (float): The start time, in your time units. If None, start index will be will be set to the first point of the timeline (0).
396
- sec_stop (float): The stop time, in your time units. If None, the stop index will be set to the final point of the timeline.
397
- sec_step (float): The step size, in your time units. If None, the index step size will be 1.
396
+ time_start (float): The start time, in your time units. If None, start index will be will be set to the first point of the timeline (0).
397
+ time_stop (float): The stop time, in your time units. If None, the stop index will be set to the final point of the timeline.
398
+ time_step (float): The step size, in your time units. If None, the index step size will be 1.
398
399
 
399
400
  Returns:
400
401
  slice: A slice object representing the index range based on the given start, stop, and step values.
@@ -767,14 +768,14 @@ class BaseTimeArray(np.ndarray): # All time arrays are numpy arrays
767
768
  aligned_arrays = [item.align_trace(start, maxlen) for item in iterable]
768
769
  return cls(aligned_arrays)
769
770
 
770
- def max_time(self) -> float: # was sec_max
771
- """Return the second maximum time from the timeline."""
771
+ def max_time(self) -> float:
772
+ """Return the maximum time (in time units) from the timeline."""
772
773
 
773
774
  # get maximum time
774
775
  return self.timeline.max()
775
776
 
776
- def min_time(self) -> float: # was sec_min
777
- """Get the minimum time from the timeline."""
777
+ def min_time(self) -> float:
778
+ """Get the minimum time (in time units) from the timeline."""
778
779
 
779
780
  # get minimum time
780
781
  return self.timeline.min()
@@ -1236,8 +1237,8 @@ class TimelinedArray(BaseTimeArray):
1236
1237
  timeline_step: This method returns the average time difference between each consecutive value in the timeline.
1237
1238
 
1238
1239
  TimelinedArrayIndexer class, which has several methods, including:
1239
- time_to_index: This method converts time in seconds to index value.
1240
- get_time_slice: This method converts time in seconds to a slice object representing time.
1240
+ time_to_index: This method converts time in time units, to integer index value.
1241
+ get_time_slice: This method converts time in time units, to an integer slice object representing time.
1241
1242
 
1242
1243
  __new__ : This method is used to creates a new instance of the TimelinedArray class. It takes several optional
1243
1244
  arguments: timeline, time_dimension, arange_timeline, and timeline_is_arranged.