pymodaq_data 5.2.0a4__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.
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/PKG-INFO +1 -1
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/data.py +11 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/backends.py +43 -15
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/.gitignore +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/LICENSE +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/README.rst +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/pyproject.toml +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/__init__.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/config.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/__init__.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/browsing.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/data_saving.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporter.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporters/__init__.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporters/base.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporters/flimj.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporters/hyperspy.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/saving.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/swmr.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/utils.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/icon.ico +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/numpy_func.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/plotting/__init__.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/plotting/plotter/plotter.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/plotting/plotter/plotters/__init__.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/plotting/plotter/plotters/matplotlib_plotters.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/plotting/utils.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/post_treatment/__init__.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/post_treatment/process_to_scalar.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/resources/__init__.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/resources/config_template.toml +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/slicing.py +0 -0
- {pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/splash.png +0 -0
|
@@ -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.
|
|
905
|
-
|
|
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
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
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
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/h5modules/exporters/hyperspy.py
RENAMED
|
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.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/plotting/plotter/plotters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pymodaq_data-5.2.0a4 → pymodaq_data-5.2.2}/src/pymodaq_data/post_treatment/process_to_scalar.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|