pymodaq_data 5.2.0a3__tar.gz → 5.2.2__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 (33) hide show
  1. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/PKG-INFO +3 -3
  2. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/pyproject.toml +2 -2
  3. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/data.py +11 -0
  4. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/backends.py +43 -15
  5. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/.gitignore +0 -0
  6. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/LICENSE +0 -0
  7. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/README.rst +0 -0
  8. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/__init__.py +0 -0
  9. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/config.py +0 -0
  10. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/__init__.py +0 -0
  11. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/browsing.py +0 -0
  12. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/data_saving.py +0 -0
  13. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporter.py +0 -0
  14. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporters/__init__.py +0 -0
  15. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporters/base.py +0 -0
  16. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporters/flimj.py +0 -0
  17. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporters/hyperspy.py +0 -0
  18. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/saving.py +0 -0
  19. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/swmr.py +0 -0
  20. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/utils.py +0 -0
  21. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/icon.ico +0 -0
  22. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/numpy_func.py +0 -0
  23. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/plotting/__init__.py +0 -0
  24. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/plotting/plotter/plotter.py +0 -0
  25. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/plotting/plotter/plotters/__init__.py +0 -0
  26. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/plotting/plotter/plotters/matplotlib_plotters.py +0 -0
  27. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/plotting/utils.py +0 -0
  28. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/post_treatment/__init__.py +0 -0
  29. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/post_treatment/process_to_scalar.py +0 -0
  30. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/resources/__init__.py +0 -0
  31. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/resources/config_template.toml +0 -0
  32. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/slicing.py +0 -0
  33. {pymodaq_data-5.2.0a3 → pymodaq_data-5.2.2}/src/pymodaq_data/splash.png +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pymodaq_data
3
- Version: 5.2.0a3
3
+ Version: 5.2.2
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
@@ -34,15 +34,15 @@ Classifier: Intended Audience :: Science/Research
34
34
  Classifier: License :: OSI Approved :: MIT License
35
35
  Classifier: Natural Language :: English
36
36
  Classifier: Operating System :: OS Independent
37
- Classifier: Programming Language :: Python :: 3.9
38
37
  Classifier: Programming Language :: Python :: 3.10
39
38
  Classifier: Programming Language :: Python :: 3.11
40
39
  Classifier: Programming Language :: Python :: 3.12
40
+ Classifier: Programming Language :: Python :: 3.13
41
41
  Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces
42
42
  Classifier: Topic :: Scientific/Engineering :: Visualization
43
43
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
44
44
  Classifier: Topic :: Software Development :: User Interfaces
45
- Requires-Python: >=3.8
45
+ Requires-Python: >=3.10
46
46
  Requires-Dist: h5py
47
47
  Requires-Dist: pymodaq-utils>=0.0.8
48
48
  Requires-Dist: scipy
@@ -10,7 +10,7 @@ dynamic = [
10
10
  description = "Modular Data Acquisition with Python"
11
11
  readme = "README.rst"
12
12
  license = { file="LICENSE" }
13
- requires-python = ">=3.8"
13
+ requires-python = ">=3.10"
14
14
  authors = [
15
15
  { name = "Sébastien Weber", email = "sebastien.weber@cemes.fr" },
16
16
  ]
@@ -21,10 +21,10 @@ classifiers = [
21
21
  "License :: OSI Approved :: MIT License",
22
22
  "Natural Language :: English",
23
23
  "Operating System :: OS Independent",
24
- "Programming Language :: Python :: 3.9",
25
24
  "Programming Language :: Python :: 3.10",
26
25
  "Programming Language :: Python :: 3.11",
27
26
  "Programming Language :: Python :: 3.12",
27
+ "Programming Language :: Python :: 3.13",
28
28
  "Topic :: Scientific/Engineering :: Human Machine Interfaces",
29
29
  "Topic :: Scientific/Engineering :: Visualization",
30
30
  "Topic :: Software Development :: Libraries :: Python Modules",
@@ -952,6 +952,17 @@ class DataBase(DataLowLevel, NDArrayOperatorsMixin):
952
952
  """
953
953
  return f'{self.origin}/{self.name}'
954
954
 
955
+ @staticmethod
956
+ def get_origin_name_from_full_name(full_name: str):
957
+ """ Standardize the obtention of the origin and name from the full name expression
958
+
959
+ Origin is always the first bit before the first '/' character while the name will be the remaining characters
960
+ """
961
+ name_bits = full_name.split('/')
962
+ origin = name_bits[0]
963
+ name = full_name.split(f'{origin}/')[1]
964
+ return origin, name
965
+
955
966
  def __repr__(self):
956
967
  return (f'{self.__class__.__name__} <{self.name}> '
957
968
  f'<u: {self.units}> '
@@ -901,21 +901,42 @@ class H5Backend:
901
901
  raise NodeError(f'Node {where} (name={name}) does not exist')
902
902
 
903
903
  if 'CLASS' not in self.get_attr(node):
904
- self.set_attr(node, 'CLASS', 'GROUP')
905
- return GROUP(node, self.backend)
904
+ klass = self._infer_class(node)
905
+ if self.backend == 'tables':
906
+ node._v_attrs['CLASS'] = klass
907
+ else:
908
+ node.attrs['CLASS'] = klass
906
909
  else:
907
- attr = self.get_attr(node, 'CLASS')
908
- if 'ARRAY' not in attr:
909
- return GROUP(node, self.backend)
910
- elif attr == 'CARRAY':
911
- return CARRAY(node, self.backend)
912
- elif attr == 'EARRAY':
913
- return EARRAY(node, self.backend)
914
- elif attr == 'VLARRAY':
915
- if self.get_attr(node, 'subdtype') == 'string':
916
- return StringARRAY(node, self.backend)
917
- else:
918
- return VLARRAY(node, self.backend)
910
+ klass = self.get_attr(node, 'CLASS')
911
+
912
+ if 'ARRAY' not in klass:
913
+ return GROUP(node, self.backend)
914
+ elif klass == 'CARRAY':
915
+ return CARRAY(node, self.backend)
916
+ elif klass == 'EARRAY':
917
+ return EARRAY(node, self.backend)
918
+ elif klass == 'VLARRAY':
919
+ if self.get_attr(node, 'subdtype') == 'string':
920
+ return StringARRAY(node, self.backend)
921
+ else:
922
+ return VLARRAY(node, self.backend)
923
+
924
+ def _infer_class(self, node) -> str:
925
+ """Infer the CLASS attribute of a node that is missing it
926
+
927
+ PyTables always writes a CLASS attribute on every node, but a node written
928
+ through h5py/h5pyd can be missing it (for instance an interrupted write).
929
+ Falling back to 'GROUP' regardless of the actual object type would mislabel
930
+ datasets and break further tree traversal, so infer the class from the
931
+ underlying object instead.
932
+ """
933
+ if self.backend == 'tables' or isinstance(node, self.h5_library.Group):
934
+ return 'GROUP'
935
+ if node.dtype.kind == 'O':
936
+ return 'VLARRAY'
937
+ if node.maxshape and node.maxshape[0] is None:
938
+ return 'EARRAY'
939
+ return 'CARRAY'
919
940
 
920
941
  def get_node_name(self, node):
921
942
  """return node name
@@ -990,7 +1011,11 @@ class H5Backend:
990
1011
  children[child_name] = _cls(child, self.backend)
991
1012
  else:
992
1013
  for child_name, child in where.items():
993
- klass = get_attr(child, 'CLASS', self.backend)
1014
+ try:
1015
+ klass = get_attr(child, 'CLASS', self.backend)
1016
+ except KeyError:
1017
+ klass = self._infer_class(child)
1018
+ child.attrs['CLASS'] = klass
994
1019
  if 'ARRAY' in klass:
995
1020
  _cls = getattr(mod, klass)
996
1021
  else:
@@ -1033,6 +1058,7 @@ class H5Backend:
1033
1058
  def create_carray(self, where, name, obj=None, title=''):
1034
1059
  if isinstance(where, Node):
1035
1060
  where = where.node
1061
+ title = str(title)
1036
1062
  if obj is None:
1037
1063
  raise ValueError('Data to be saved as carray cannot be None')
1038
1064
  dtype = obj.dtype
@@ -1061,6 +1087,7 @@ class H5Backend:
1061
1087
  """
1062
1088
  if isinstance(where, Node):
1063
1089
  where = where.node
1090
+ title = str(title)
1064
1091
  dtype = np.dtype(dtype)
1065
1092
  shape = [0]
1066
1093
  if data_shape is not None:
@@ -1111,6 +1138,7 @@ class H5Backend:
1111
1138
  """
1112
1139
  if isinstance(where, Node):
1113
1140
  where = where.node
1141
+ title = str(title)
1114
1142
  if dtype == 'string':
1115
1143
  dtype = np.dtype(np.uint8)
1116
1144
  subdtype = 'string'
File without changes
File without changes
File without changes