pymodaq_data 5.0.22__tar.gz → 5.0.24__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 (29) hide show
  1. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/PKG-INFO +1 -1
  2. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/_version.py +2 -2
  3. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/data.py +8 -6
  4. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/numpy_func.py +9 -0
  5. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/.gitignore +0 -0
  6. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/LICENSE +0 -0
  7. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/README.rst +0 -0
  8. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/pyproject.toml +0 -0
  9. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/__init__.py +0 -0
  10. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/__init__.py +0 -0
  11. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/backends.py +0 -0
  12. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/browsing.py +0 -0
  13. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/data_saving.py +0 -0
  14. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporter.py +0 -0
  15. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporters/__init__.py +0 -0
  16. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporters/base.py +0 -0
  17. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporters/flimj.py +0 -0
  18. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporters/hyperspy.py +0 -0
  19. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/saving.py +0 -0
  20. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/utils.py +0 -0
  21. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/icon.ico +0 -0
  22. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/plotting/__init__.py +0 -0
  23. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/plotting/plotter/plotter.py +0 -0
  24. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/plotting/plotter/plotters/__init__.py +0 -0
  25. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/plotting/plotter/plotters/matplotlib_plotters.py +0 -0
  26. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/post_treatment/__init__.py +0 -0
  27. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/post_treatment/process_to_scalar.py +0 -0
  28. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/slicing.py +0 -0
  29. {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/splash.png +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymodaq_data
3
- Version: 5.0.22
3
+ Version: 5.0.24
4
4
  Summary: Modular Data Acquisition with Python
5
5
  Project-URL: Homepage, http://pymodaq.cnrs.fr
6
6
  Project-URL: Source, https://github.com/PyMoDAQ/pymodaq_data
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '5.0.22'
21
- __version_tuple__ = version_tuple = (5, 0, 22)
20
+ __version__ = version = '5.0.24'
21
+ __version_tuple__ = version_tuple = (5, 0, 24)
@@ -166,7 +166,7 @@ class DataDistribution(BaseEnum):
166
166
 
167
167
  def _compute_slices_from_axis(axis: Axis, _slice, *ignored, is_index=True, **ignored_also):
168
168
  if not is_index:
169
- if isinstance(_slice, numbers.Number):
169
+ if isinstance(_slice, numbers.Number) or isinstance(_slice, Q_):
170
170
  if not is_index:
171
171
  _slice = axis.find_index(_slice)
172
172
  elif _slice is Ellipsis:
@@ -599,8 +599,10 @@ class Axis(SerializableBase):
599
599
  else:
600
600
  return self.offset + (self.size * self.scaling if self.scaling > 0 else 0)
601
601
 
602
- def find_index(self, threshold: float) -> int:
602
+ def find_index(self, threshold: Union[float, Q_]) -> int:
603
603
  """find the index of the threshold value within the axis"""
604
+ if isinstance(threshold, Q_):
605
+ threshold = threshold.m_as(self.units)
604
606
  if threshold < self.min():
605
607
  return 0
606
608
  elif threshold > self.max():
@@ -610,7 +612,7 @@ class Axis(SerializableBase):
610
612
  else:
611
613
  return int((threshold - self.offset) / self.scaling)
612
614
 
613
- def find_indexes(self, thresholds: IterableType[float]) -> IterableType[int]:
615
+ def find_indexes(self, thresholds: IterableType[Union[float, Q_]]) -> IterableType[int]:
614
616
  if isinstance(thresholds, numbers.Number):
615
617
  thresholds = [thresholds]
616
618
  return [self.find_index(threshold) for threshold in thresholds]
@@ -2571,7 +2573,7 @@ class DataWithAxes(DataBase, SerializableBase):
2571
2573
  list(slice): a version as index of the input argument
2572
2574
  """
2573
2575
  _slices_as_index = []
2574
- if isinstance(slices, numbers.Number) or isinstance(slices, slice):
2576
+ if isinstance(slices, numbers.Number) or isinstance(slices, Q_) or isinstance(slices, slice):
2575
2577
  slices = [slices]
2576
2578
  if is_navigation:
2577
2579
  indexes = self._am.nav_indexes
@@ -2605,7 +2607,7 @@ class DataWithAxes(DataBase, SerializableBase):
2605
2607
  total_slices = tuple(total_slices)
2606
2608
  return total_slices, _slices_as_index
2607
2609
 
2608
- def check_squeeze(self, total_slices: List[slice], is_navigation: bool):
2610
+ def check_squeeze(self, total_slices: IterableType[slice], is_navigation: bool):
2609
2611
 
2610
2612
  do_squeeze = True
2611
2613
  if 1 in self.data[0][total_slices].shape:
@@ -2625,7 +2627,7 @@ class DataWithAxes(DataBase, SerializableBase):
2625
2627
  is_navigation: bool
2626
2628
  if True apply the slices to the navigation dimension else to the signal ones
2627
2629
  is_index: bool
2628
- if True the slices are indexes otherwise the slices are axes values to be indexed first
2630
+ if True the slices are indexes otherwise the slices are axes values (float or quantities) to be indexed first
2629
2631
 
2630
2632
  Returns
2631
2633
  -------
@@ -80,6 +80,15 @@ def _min(dwa: 'DataWithAxes', *args, axis: Optional[Union[int, Iterable[int]]] =
80
80
  return process_with_reduced_dimensions(np.min, dwa, *args, axis=axis, **kwargs)
81
81
 
82
82
 
83
+ @implements('argmax')
84
+ def _argmax(dwa: 'DataWithAxes', *args, axis: Optional[Union[int, Iterable[int]]] = None, **kwargs):
85
+ return process_with_reduced_dimensions(np.argmax, dwa, *args, axis=axis, **kwargs)
86
+
87
+
88
+ @implements('argmin')
89
+ def _argmin(dwa: 'DataWithAxes', *args, axis: Optional[Union[int, Iterable[int]]] = None, **kwargs):
90
+ return process_with_reduced_dimensions(np.argmin, dwa, *args, axis=axis, **kwargs)
91
+
83
92
  @implements("std")
84
93
  def _std(dwa: 'DataWithAxes', *args, axis: Optional[Union[int, Iterable[int]]] = None, **kwargs):
85
94
  return process_with_reduced_dimensions(np.std, dwa, *args, axis=axis, **kwargs)
File without changes
File without changes
File without changes