pymodaq_data 5.0.6__tar.gz → 5.0.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.
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/PKG-INFO +1 -1
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/_version.py +2 -2
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/data.py +99 -13
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/plotting/plotter/plotter.py +4 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/.gitignore +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/LICENSE +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/README.rst +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/pyproject.toml +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/__init__.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/h5modules/__init__.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/h5modules/backends.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/h5modules/browsing.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/h5modules/data_saving.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/h5modules/exporter.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/h5modules/exporters/__init__.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/h5modules/exporters/base.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/h5modules/exporters/flimj.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/h5modules/exporters/hyperspy.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/h5modules/saving.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/h5modules/utils.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/icon.ico +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/numpy_func.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/plotting/__init__.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/plotting/plotter/plotters/__init__.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/plotting/plotter/plotters/matplotlib_plotters.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/post_treatment/__init__.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/post_treatment/process_to_scalar.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/slicing.py +0 -0
- {pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/splash.png +0 -0
|
@@ -101,6 +101,7 @@ class DataUnitError(Exception):
|
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
class DwaType(BaseEnum):
|
|
104
|
+
"""Different types of `DataWithAxes`."""
|
|
104
105
|
DataWithAxes = 0
|
|
105
106
|
DataRaw = 1
|
|
106
107
|
DataActuator = 2
|
|
@@ -912,7 +913,7 @@ class DataBase(DataLowLevel, NDArrayOperatorsMixin):
|
|
|
912
913
|
|
|
913
914
|
def _comparison_common(self, other, operator='__eq__'):
|
|
914
915
|
if isinstance(other, DataBase):
|
|
915
|
-
if not (# no more checking for name equality
|
|
916
|
+
if not (# no more checking for name equality but take care ot the pop/remove methods
|
|
916
917
|
len(self) == len(other) and
|
|
917
918
|
Unit(self.units).is_compatible_with(other.units)):
|
|
918
919
|
return False
|
|
@@ -1797,7 +1798,13 @@ class DataWithAxes(DataBase):
|
|
|
1797
1798
|
should match the data ndarray
|
|
1798
1799
|
"""
|
|
1799
1800
|
|
|
1800
|
-
def __init__(self,
|
|
1801
|
+
def __init__(self, name: str,
|
|
1802
|
+
source: DataSource = None, dim: DataDim = None,
|
|
1803
|
+
distribution: DataDistribution = DataDistribution.uniform,
|
|
1804
|
+
data: List[np.ndarray] = None,
|
|
1805
|
+
labels: List[str] = None, origin: str = '',
|
|
1806
|
+
units: str = '',
|
|
1807
|
+
axes: List[Axis] = [],
|
|
1801
1808
|
nav_indexes: Tuple[int] = (),
|
|
1802
1809
|
errors: Iterable[np.ndarray] = None,
|
|
1803
1810
|
**kwargs):
|
|
@@ -1812,7 +1819,13 @@ class DataWithAxes(DataBase):
|
|
|
1812
1819
|
nav_x_axis = kwargs.pop('nav_x_axis') if 'nav_x_axis' in kwargs else None
|
|
1813
1820
|
nav_y_axis = kwargs.pop('nav_y_axis') if 'nav_y_axis' in kwargs else None
|
|
1814
1821
|
|
|
1815
|
-
super().__init__(
|
|
1822
|
+
super().__init__(name, source=source, dim=dim,
|
|
1823
|
+
distribution=distribution,
|
|
1824
|
+
data=data,
|
|
1825
|
+
labels=labels,
|
|
1826
|
+
origin=origin,
|
|
1827
|
+
units=units,
|
|
1828
|
+
**kwargs)
|
|
1816
1829
|
|
|
1817
1830
|
self._axes = axes
|
|
1818
1831
|
|
|
@@ -1925,7 +1938,7 @@ class DataWithAxes(DataBase):
|
|
|
1925
1938
|
is_equal = super().__eq__(other)
|
|
1926
1939
|
if not is_equal:
|
|
1927
1940
|
return is_equal
|
|
1928
|
-
if isinstance(other,
|
|
1941
|
+
if isinstance(other, self.__class__):
|
|
1929
1942
|
for ind in list(self.nav_indexes) + list(self.sig_indexes):
|
|
1930
1943
|
axes_self = self.get_axis_from_index(ind)
|
|
1931
1944
|
axes_other = other.get_axis_from_index(ind)
|
|
@@ -2601,24 +2614,87 @@ class DataWithAxes(DataBase):
|
|
|
2601
2614
|
|
|
2602
2615
|
class DataRaw(DataWithAxes):
|
|
2603
2616
|
"""Specialized DataWithAxes set with source as 'raw'. To be used for raw data"""
|
|
2604
|
-
def __init__(self,
|
|
2617
|
+
def __init__(self, name: str,
|
|
2618
|
+
dim: DataDim = None,
|
|
2619
|
+
distribution: DataDistribution = DataDistribution.uniform,
|
|
2620
|
+
data: List[np.ndarray] = None,
|
|
2621
|
+
labels: List[str] = None, origin: str = '',
|
|
2622
|
+
units: str = '',
|
|
2623
|
+
axes: List[Axis] = [],
|
|
2624
|
+
nav_indexes: Tuple[int] = (),
|
|
2625
|
+
errors: Iterable[np.ndarray] = None,
|
|
2626
|
+
**kwargs):
|
|
2605
2627
|
if 'source' in kwargs:
|
|
2606
2628
|
kwargs.pop('source')
|
|
2607
|
-
|
|
2629
|
+
|
|
2630
|
+
super().__init__(name, source=DataSource.raw,
|
|
2631
|
+
dim=dim,
|
|
2632
|
+
distribution=distribution,
|
|
2633
|
+
data=data,
|
|
2634
|
+
labels=labels,
|
|
2635
|
+
origin=origin,
|
|
2636
|
+
units=units,
|
|
2637
|
+
axes=axes,
|
|
2638
|
+
nav_indexes=nav_indexes,
|
|
2639
|
+
errors=errors,
|
|
2640
|
+
**kwargs
|
|
2641
|
+
)
|
|
2608
2642
|
|
|
2609
2643
|
|
|
2610
2644
|
class DataCalculated(DataWithAxes):
|
|
2611
|
-
"""Specialized DataWithAxes set with source as 'calculated'. To be used for
|
|
2612
|
-
|
|
2645
|
+
"""Specialized DataWithAxes set with source as 'calculated'. To be used for
|
|
2646
|
+
processed/calculated data"""
|
|
2647
|
+
def __init__(self, name: str,
|
|
2648
|
+
dim: DataDim = None,
|
|
2649
|
+
distribution: DataDistribution = DataDistribution.uniform,
|
|
2650
|
+
data: List[np.ndarray] = None,
|
|
2651
|
+
labels: List[str] = None, origin: str = '',
|
|
2652
|
+
units: str = '',
|
|
2653
|
+
axes: List[Axis] = [],
|
|
2654
|
+
nav_indexes: Tuple[int] = (),
|
|
2655
|
+
errors: Iterable[np.ndarray] = None,
|
|
2656
|
+
**kwargs):
|
|
2657
|
+
|
|
2613
2658
|
if 'source' in kwargs:
|
|
2614
2659
|
kwargs.pop('source')
|
|
2615
|
-
super().__init__(
|
|
2660
|
+
super().__init__(name, source=DataSource.calculated,
|
|
2661
|
+
dim=dim,
|
|
2662
|
+
distribution=distribution,
|
|
2663
|
+
data=data,
|
|
2664
|
+
labels=labels,
|
|
2665
|
+
origin=origin,
|
|
2666
|
+
units=units,
|
|
2667
|
+
axes=axes,
|
|
2668
|
+
nav_indexes=nav_indexes,
|
|
2669
|
+
errors=errors,
|
|
2670
|
+
**kwargs)
|
|
2616
2671
|
|
|
2617
2672
|
|
|
2618
2673
|
class DataFromRoi(DataCalculated):
|
|
2619
|
-
"""Specialized DataWithAxes set with source as 'calculated'.
|
|
2620
|
-
|
|
2621
|
-
|
|
2674
|
+
"""Specialized DataWithAxes set with source as 'calculated'.
|
|
2675
|
+
To be used for processed data from region of interest"""
|
|
2676
|
+
def __init__(self, name: str,
|
|
2677
|
+
dim: DataDim = None,
|
|
2678
|
+
distribution: DataDistribution = DataDistribution.uniform,
|
|
2679
|
+
data: List[np.ndarray] = None,
|
|
2680
|
+
labels: List[str] = None, origin: str = '',
|
|
2681
|
+
units: str = '',
|
|
2682
|
+
axes: List[Axis] = [],
|
|
2683
|
+
nav_indexes: Tuple[int] = (),
|
|
2684
|
+
errors: Iterable[np.ndarray] = None,
|
|
2685
|
+
**kwargs):
|
|
2686
|
+
|
|
2687
|
+
super().__init__(name, source=DataSource.calculated,
|
|
2688
|
+
dim=dim,
|
|
2689
|
+
distribution=distribution,
|
|
2690
|
+
data=data,
|
|
2691
|
+
labels=labels,
|
|
2692
|
+
origin=origin,
|
|
2693
|
+
units=units,
|
|
2694
|
+
axes=axes,
|
|
2695
|
+
nav_indexes=nav_indexes,
|
|
2696
|
+
errors=errors,
|
|
2697
|
+
**kwargs)
|
|
2622
2698
|
|
|
2623
2699
|
|
|
2624
2700
|
class DataToExport(DataLowLevel):
|
|
@@ -3048,7 +3124,17 @@ class DataToExport(DataLowLevel):
|
|
|
3048
3124
|
return self.data.pop(index)
|
|
3049
3125
|
|
|
3050
3126
|
def remove(self, dwa: DataWithAxes):
|
|
3051
|
-
|
|
3127
|
+
""" Use the DataWithAxes object comparison __eq__ to retrieve the elt to remove
|
|
3128
|
+
|
|
3129
|
+
Parameters
|
|
3130
|
+
----------
|
|
3131
|
+
dwa: DataWithAxes
|
|
3132
|
+
The da to remove from the list
|
|
3133
|
+
"""
|
|
3134
|
+
for ind, dwa_tmp in enumerate(self):
|
|
3135
|
+
if dwa_tmp == dwa and dwa_tmp.name == dwa.name:
|
|
3136
|
+
return self.data.pop(ind)
|
|
3137
|
+
raise ValueError()
|
|
3052
3138
|
|
|
3053
3139
|
@property
|
|
3054
3140
|
def data(self) -> List[DataWithAxes]:
|
|
@@ -54,6 +54,10 @@ class PlotterBase(metaclass=ABCMeta):
|
|
|
54
54
|
class PlotterFactory(ObjectFactory):
|
|
55
55
|
"""Factory class registering and storing interactive plotter"""
|
|
56
56
|
|
|
57
|
+
def __init__(self):
|
|
58
|
+
if PlotterFactory.__name__ not in PlotterFactory._builders:
|
|
59
|
+
PlotterFactory._builders[PlotterFactory.__name__] = {}
|
|
60
|
+
|
|
57
61
|
@classmethod
|
|
58
62
|
def register(cls) -> Callable:
|
|
59
63
|
""" To be used as a decorator
|
|
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
|
{pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/plotting/plotter/plotters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymodaq_data-5.0.6 → pymodaq_data-5.0.8}/src/pymodaq_data/post_treatment/process_to_scalar.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|