pymodaq_data 5.0.8__tar.gz → 5.0.9__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.8 → pymodaq_data-5.0.9}/PKG-INFO +1 -2
  2. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/_version.py +2 -2
  3. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/h5modules/data_saving.py +23 -5
  4. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/.gitignore +0 -0
  5. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/LICENSE +0 -0
  6. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/README.rst +0 -0
  7. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/pyproject.toml +0 -0
  8. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/__init__.py +0 -0
  9. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/data.py +0 -0
  10. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/h5modules/__init__.py +0 -0
  11. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/h5modules/backends.py +0 -0
  12. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/h5modules/browsing.py +0 -0
  13. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/h5modules/exporter.py +0 -0
  14. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/h5modules/exporters/__init__.py +0 -0
  15. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/h5modules/exporters/base.py +0 -0
  16. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/h5modules/exporters/flimj.py +0 -0
  17. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/h5modules/exporters/hyperspy.py +0 -0
  18. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/h5modules/saving.py +0 -0
  19. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/h5modules/utils.py +0 -0
  20. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/icon.ico +0 -0
  21. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/numpy_func.py +0 -0
  22. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/plotting/__init__.py +0 -0
  23. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/plotting/plotter/plotter.py +0 -0
  24. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/plotting/plotter/plotters/__init__.py +0 -0
  25. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/plotting/plotter/plotters/matplotlib_plotters.py +0 -0
  26. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/post_treatment/__init__.py +0 -0
  27. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/post_treatment/process_to_scalar.py +0 -0
  28. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/src/pymodaq_data/slicing.py +0 -0
  29. {pymodaq_data-5.0.8 → pymodaq_data-5.0.9}/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.8
3
+ Version: 5.0.9
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
@@ -27,7 +27,6 @@ License: The MIT License (MIT)
27
27
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
28
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
29
  THE SOFTWARE.
30
- License-File: LICENSE
31
30
  Classifier: Development Status :: 5 - Production/Stable
32
31
  Classifier: Environment :: Other Environment
33
32
  Classifier: Intended Audience :: Science/Research
@@ -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.8'
16
- __version_tuple__ = version_tuple = (5, 0, 8)
15
+ __version__ = version = '5.0.9'
16
+ __version_tuple__ = version_tuple = (5, 0, 9)
@@ -58,8 +58,12 @@ class DataManagement(metaclass=ABCMeta):
58
58
  self.close_file()
59
59
 
60
60
  def close_file(self):
61
+ self._h5saver.flush()
61
62
  self._h5saver.close_file()
62
63
 
64
+ def close(self):
65
+ self.close_file()
66
+
63
67
  def _get_next_node_name(self, where: Union[str, Node]) -> str:
64
68
  """Get the formatted next node name given the ones already saved
65
69
 
@@ -600,7 +604,7 @@ class DataEnlargeableSaver(DataSaverLoader):
600
604
  self._axis_saver.add_axis(where, axis)
601
605
 
602
606
  def add_data(self, where: Union[Node, str], data: DataWithAxes,
603
- axis_values: Iterable[float] = None):
607
+ axis_values: Iterable[float] = None, **kwargs):
604
608
  """ Append data to an enlargeable array node
605
609
 
606
610
  Data of dim (0, 1 or 2) will be just appended to the enlargeable array.
@@ -624,17 +628,31 @@ class DataEnlargeableSaver(DataSaverLoader):
624
628
  if self.get_last_node_name(where) is None:
625
629
  if len(data.nav_indexes) == 0:
626
630
  data_init = data
631
+ elif len(data.nav_indexes) == 1: # special case of DataND data
632
+ data_init = data.inav[0]
633
+ add_enl_axes = True
634
+ axis = data.get_axis_from_index(data.nav_indexes[0])[0]
635
+ axis_values = (axis.get_data(),)
636
+ self._enl_axis_names = (axis.label,)
637
+ self._enl_axis_units = (axis.units,)
627
638
  else:
628
639
  raise DataDimError('It is not possible to append DataND')
629
640
  self._create_data_arrays(where, data_init, save_axes=True, add_enl_axes=add_enl_axes)
641
+ elif len(data.nav_indexes) == 1: # special case of DataND data
642
+ add_enl_axes = True
643
+ axis = data.get_axis_from_index(data.nav_indexes[0])[0]
644
+ axis_values = (axis.get_data(),)
630
645
 
631
646
  for ind_data in range(len(data)):
632
647
  array: EARRAY = self.get_node_from_index(where, ind_data)
633
648
  array.append(data[ind_data])
634
- if add_enl_axes and axis_values is not None:
649
+ if add_enl_axes:
635
650
  for ind_axis in range(self._n_enl_axes):
636
651
  axis_array: EARRAY = self._axis_saver.get_node_from_index(where, ind_axis)
637
- axis_array.append(np.array([axis_values[ind_axis]]))
652
+ if not isinstance(axis_values[ind_axis], np.ndarray):
653
+ axis_array.append(np.array([axis_values[ind_axis]]))
654
+ else:
655
+ axis_array.append(axis_values[ind_axis], expand=False)
638
656
  axis_array.attrs['size'] += 1
639
657
 
640
658
 
@@ -862,7 +880,7 @@ class DataToExportEnlargeableSaver(DataToExportSaver):
862
880
  def add_data(self, where: Union[Node, str], data: DataToExport,
863
881
  axis_values: List[Union[float, np.ndarray]] = None,
864
882
  axis_value: Union[float, np.ndarray] = None,
865
- settings_as_xml='', metadata=None,
883
+ settings_as_xml='', metadata=None, **kwargs
866
884
  ):
867
885
  """
868
886
 
@@ -885,7 +903,7 @@ class DataToExportEnlargeableSaver(DataToExportSaver):
885
903
  if axis_values is None and axis_value is not None:
886
904
  axis_values = [axis_value]
887
905
 
888
- super().add_data(where, data, settings_as_xml, metadata)
906
+ super().add_data(where, data, settings_as_xml, metadata, **kwargs)
889
907
  # a parent navigation group (same for all data nodes)
890
908
 
891
909
  where = self._get_node(where)
File without changes
File without changes
File without changes