pymodaq_data 5.0.6__tar.gz → 5.0.7__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.6 → pymodaq_data-5.0.7}/PKG-INFO +1 -1
  2. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/_version.py +2 -2
  3. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/data.py +99 -13
  4. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/plotting/plotter/plotter.py +4 -0
  5. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/.gitignore +0 -0
  6. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/LICENSE +0 -0
  7. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/README.rst +0 -0
  8. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/pyproject.toml +0 -0
  9. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/__init__.py +0 -0
  10. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/h5modules/__init__.py +0 -0
  11. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/h5modules/backends.py +0 -0
  12. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/h5modules/browsing.py +0 -0
  13. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/h5modules/data_saving.py +0 -0
  14. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/h5modules/exporter.py +0 -0
  15. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/h5modules/exporters/__init__.py +0 -0
  16. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/h5modules/exporters/base.py +0 -0
  17. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/h5modules/exporters/flimj.py +0 -0
  18. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/h5modules/exporters/hyperspy.py +0 -0
  19. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/h5modules/saving.py +0 -0
  20. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/h5modules/utils.py +0 -0
  21. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/icon.ico +0 -0
  22. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/numpy_func.py +0 -0
  23. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/plotting/__init__.py +0 -0
  24. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/plotting/plotter/plotters/__init__.py +0 -0
  25. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/plotting/plotter/plotters/matplotlib_plotters.py +0 -0
  26. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/post_treatment/__init__.py +0 -0
  27. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/post_treatment/process_to_scalar.py +0 -0
  28. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/slicing.py +0 -0
  29. {pymodaq_data-5.0.6 → pymodaq_data-5.0.7}/src/pymodaq_data/splash.png +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pymodaq_data
3
- Version: 5.0.6
3
+ Version: 5.0.7
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
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '5.0.6'
16
- __version_tuple__ = version_tuple = (5, 0, 6)
15
+ __version__ = version = '5.0.7'
16
+ __version_tuple__ = version_tuple = (5, 0, 7)
@@ -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, *args, axes: List[Axis] = [],
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__(*args, **kwargs)
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, DataWithAxes):
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, *args, **kwargs):
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
- super().__init__(*args, source=DataSource['raw'], **kwargs)
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 processed/calculated data"""
2612
- def __init__(self, *args, axes=[], **kwargs):
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__(*args, source=DataSource['calculated'], axes=axes, **kwargs)
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'.To be used for processed data from region of interest"""
2620
- def __init__(self, *args, axes=[], **kwargs):
2621
- super().__init__(*args, axes=axes, **kwargs)
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
- return self.pop(self.data.index(dwa))
3127
+ """ Use the DataWithAxes object comparison __eq__ to retrieve the elt to remove
3128
+
3129
+ If strict is True will also check for the real type and name of the object
3130
+
3131
+ Parameters
3132
+ ----------
3133
+ """
3134
+ for dwa_tmp in self:
3135
+ if dwa_tmp == dwa and dwa_tmp.name == dwa.name:
3136
+ return dwa_tmp
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