pymodaq_data 5.0.2__tar.gz → 5.0.3__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.2 → pymodaq_data-5.0.3}/PKG-INFO +1 -1
  2. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/_version.py +2 -2
  3. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/data.py +21 -6
  4. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/h5modules/data_saving.py +1 -1
  5. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/h5modules/saving.py +4 -1
  6. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/plotting/plotter/plotter.py +1 -1
  7. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/.gitignore +0 -0
  8. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/LICENSE +0 -0
  9. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/README.rst +0 -0
  10. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/pyproject.toml +0 -0
  11. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/__init__.py +0 -0
  12. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/h5modules/__init__.py +0 -0
  13. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/h5modules/backends.py +0 -0
  14. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/h5modules/browsing.py +0 -0
  15. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/h5modules/exporter.py +0 -0
  16. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/h5modules/exporters/__init__.py +0 -0
  17. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/h5modules/exporters/base.py +0 -0
  18. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/h5modules/exporters/flimj.py +0 -0
  19. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/h5modules/exporters/hyperspy.py +0 -0
  20. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/h5modules/utils.py +0 -0
  21. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/icon.ico +0 -0
  22. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/numpy_func.py +0 -0
  23. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/plotting/__init__.py +0 -0
  24. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/plotting/plotter/plotters/__init__.py +0 -0
  25. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/plotting/plotter/plotters/matplotlib_plotters.py +0 -0
  26. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/post_treatment/__init__.py +0 -0
  27. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/post_treatment/process_to_scalar.py +0 -0
  28. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/src/pymodaq_data/slicing.py +0 -0
  29. {pymodaq_data-5.0.2 → pymodaq_data-5.0.3}/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.2
3
+ Version: 5.0.3
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.2'
16
- __version_tuple__ = version_tuple = (5, 0, 2)
15
+ __version__ = version = '5.0.3'
16
+ __version_tuple__ = version_tuple = (5, 0, 3)
@@ -585,7 +585,7 @@ class DataBase(DataLowLevel, NDArrayOperatorsMixin):
585
585
  >>> import numpy as np
586
586
  >>> from pymodaq.utils.data import DataBase, DataSource, DataDim, DataDistribution
587
587
  >>> data = DataBase('mydata', source=DataSource['raw'], dim=DataDim['Data1D'], \
588
- distribution=DataDistribution['uniform'], data=[np.array([1.,2.,3.]), np.array([4.,5.,6.])],\
588
+ distribution=DataDistribution.uniform, data=[np.array([1.,2.,3.]), np.array([4.,5.,6.])],\
589
589
  labels=['channel1', 'channel2'], origin='docutils code')
590
590
  >>> data.dim
591
591
  <DataDim.Data1D: 1>
@@ -603,7 +603,7 @@ class DataBase(DataLowLevel, NDArrayOperatorsMixin):
603
603
 
604
604
  def __init__(self, name: str,
605
605
  source: DataSource = None, dim: DataDim = None,
606
- distribution: DataDistribution = DataDistribution['uniform'],
606
+ distribution: DataDistribution = DataDistribution.uniform,
607
607
  data: List[np.ndarray] = None,
608
608
  labels: List[str] = None, origin: str = '',
609
609
  units: str = '',
@@ -1668,6 +1668,19 @@ class DataWithAxes(DataBase):
1668
1668
  #then use get_dim_from axes
1669
1669
  self._check_errors(errors)
1670
1670
 
1671
+ def check_axes_linear(self, axes: List[Axis] = None) -> bool:
1672
+ """ Check if any axis may be non linear
1673
+
1674
+ Should trigger a spread like distribution except id dim is Data1D, in which cas, it doesn't
1675
+ matter
1676
+ """
1677
+ if axes is None:
1678
+ axes = self._axes
1679
+ are_axes_linear = True
1680
+ for axis in axes:
1681
+ are_axes_linear = are_axes_linear and axis.is_axis_linear()
1682
+ return are_axes_linear
1683
+
1671
1684
  def _check_errors(self, errors: Iterable[np.ndarray]):
1672
1685
  """ Make sure the errors object is adapted to the len/shape of the dwa object
1673
1686
 
@@ -1734,12 +1747,12 @@ class DataWithAxes(DataBase):
1734
1747
  return plotter_factory.get(plotter_backend).plot(self, *args, viewer=viewer, **kwargs)
1735
1748
 
1736
1749
  def set_axes_manager(self, data_shape, axes, nav_indexes, **kwargs):
1737
- if self.distribution.name == 'uniform' or len(nav_indexes) == 0:
1738
- self._distribution = DataDistribution['uniform']
1750
+ if self.distribution.name == DataDistribution.uniform.name or len(nav_indexes) == 0:
1751
+ self._distribution = DataDistribution.uniform
1739
1752
  self.axes_manager = AxesManagerUniform(data_shape=data_shape, axes=axes,
1740
1753
  nav_indexes=nav_indexes,
1741
1754
  **kwargs)
1742
- elif self.distribution.name == 'spread':
1755
+ elif self.distribution.name == DataDistribution.spread.name:
1743
1756
  self.axes_manager = AxesManagerSpread(data_shape=data_shape, axes=axes,
1744
1757
  nav_indexes=nav_indexes,
1745
1758
  **kwargs)
@@ -2050,6 +2063,7 @@ class DataWithAxes(DataBase):
2050
2063
  self._dim = DataDim['DataND']
2051
2064
  return self._dim
2052
2065
 
2066
+
2053
2067
  @property
2054
2068
  def n_axes(self):
2055
2069
  """Get the number of axes (even if not specified)"""
@@ -2064,6 +2078,7 @@ class DataWithAxes(DataBase):
2064
2078
  def axes(self, axes: List[Axis]):
2065
2079
  """convenience property to set attribute from axis_manager"""
2066
2080
  self.set_axes_manager(self.shape, axes=axes, nav_indexes=self.nav_indexes)
2081
+ self._axes = axes
2067
2082
 
2068
2083
  def axes_limits(self, axes_indexes: List[int] = None) -> List[Tuple[float, float]]:
2069
2084
  """Get the limits of specified axes (all if axes_indexes is None)"""
@@ -2243,7 +2258,7 @@ class DataWithAxes(DataBase):
2243
2258
  if len(nav_indexes) != 0:
2244
2259
  distribution = self.distribution
2245
2260
  else:
2246
- distribution = DataDistribution['uniform']
2261
+ distribution = DataDistribution.uniform
2247
2262
 
2248
2263
  data = DataWithAxes(self.name, data=new_arrays_data, nav_indexes=tuple(nav_indexes),
2249
2264
  axes=axes,
@@ -1001,7 +1001,7 @@ class DataLoader:
1001
1001
 
1002
1002
  if isinstance(h5saver, Path) or isinstance(h5saver, str):
1003
1003
  h5saver_tmp = H5SaverLowLevel()
1004
- h5saver_tmp.init_file(addhoc_file_path=Path(h5saver))
1004
+ h5saver_tmp.init_file(file_name=Path(h5saver))
1005
1005
  h5saver = h5saver_tmp
1006
1006
 
1007
1007
  self.h5saver = h5saver
@@ -89,7 +89,8 @@ class H5SaverLowLevel(H5Backend):
89
89
  def h5_file(self):
90
90
  return self._h5file
91
91
 
92
- def init_file(self, file_name: Path, raw_group_name='RawData', new_file=False, metadata: dict = None):
92
+ def init_file(self, file_name: Path, raw_group_name='RawData', new_file=False,
93
+ metadata: dict = None):
93
94
  """Initializes a new h5 file.
94
95
 
95
96
  Parameters
@@ -100,6 +101,8 @@ class H5SaverLowLevel(H5Backend):
100
101
  Base node name
101
102
  new_file: bool
102
103
  If True create a new file, otherwise append to a potential existing one
104
+ metadata: dict
105
+ A dictionary to be saved as attributes
103
106
 
104
107
  Returns
105
108
  -------
@@ -18,7 +18,7 @@ from pymodaq_utils.factory import ObjectFactory
18
18
  logger = set_logger(get_module_name(__file__))
19
19
 
20
20
 
21
- def register_plotter(parent_module_name: str = 'pymodaq.utils.plotting.plotter'):
21
+ def register_plotter(parent_module_name: str = 'pymodaq_data.plotting.plotter'):
22
22
  plotters = []
23
23
  try:
24
24
  plotter_module = import_module(f'{parent_module_name}.plotters')
File without changes
File without changes
File without changes