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.
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/PKG-INFO +1 -1
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/_version.py +2 -2
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/data.py +8 -6
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/numpy_func.py +9 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/.gitignore +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/LICENSE +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/README.rst +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/pyproject.toml +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/__init__.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/__init__.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/backends.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/browsing.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/data_saving.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporter.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporters/__init__.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporters/base.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporters/flimj.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporters/hyperspy.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/saving.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/utils.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/icon.ico +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/plotting/__init__.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/plotting/plotter/plotter.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/plotting/plotter/plotters/__init__.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/plotting/plotter/plotters/matplotlib_plotters.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/post_treatment/__init__.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/post_treatment/process_to_scalar.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/slicing.py +0 -0
- {pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/splash.png +0 -0
|
@@ -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:
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/h5modules/exporters/hyperspy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/plotting/plotter/plotters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymodaq_data-5.0.22 → pymodaq_data-5.0.24}/src/pymodaq_data/post_treatment/process_to_scalar.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|