pymodaq_data 5.2.2__tar.gz → 5.2.5__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.2 → pymodaq_data-5.2.5}/PKG-INFO +1 -1
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/data.py +27 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/.gitignore +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/LICENSE +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/README.rst +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/pyproject.toml +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/__init__.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/config.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/__init__.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/backends.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/browsing.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/data_saving.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/exporter.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/exporters/__init__.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/exporters/base.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/exporters/flimj.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/exporters/hyperspy.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/saving.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/swmr.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/h5modules/utils.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/icon.ico +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/numpy_func.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/plotting/__init__.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/plotting/plotter/plotter.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/plotting/plotter/plotters/__init__.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/plotting/plotter/plotters/matplotlib_plotters.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/plotting/utils.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/post_treatment/__init__.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/post_treatment/process_to_scalar.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/resources/__init__.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/resources/config_template.toml +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/slicing.py +0 -0
- {pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/src/pymodaq_data/splash.png +0 -0
|
@@ -9,6 +9,7 @@ from __future__ import annotations
|
|
|
9
9
|
from abc import ABCMeta, abstractmethod
|
|
10
10
|
from copy import deepcopy
|
|
11
11
|
import numbers
|
|
12
|
+
import re
|
|
12
13
|
|
|
13
14
|
import numpy as np
|
|
14
15
|
from numpy.lib.mixins import NDArrayOperatorsMixin
|
|
@@ -46,6 +47,32 @@ plotter_factory = PlotterFactory()
|
|
|
46
47
|
ser_factory = SerializableFactory()
|
|
47
48
|
logger = set_logger(get_module_name(__file__))
|
|
48
49
|
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def parse_quantity(quantity: str) -> Q_:
|
|
54
|
+
"""
|
|
55
|
+
Converts a string into a Pint Quantity object using
|
|
56
|
+
a regex to split it in two parts and force usage of
|
|
57
|
+
Q_(value, unit) constructor as Q_(value_unit_str)
|
|
58
|
+
induces some errors.
|
|
59
|
+
Parameters
|
|
60
|
+
----------
|
|
61
|
+
quantity: The string to convert
|
|
62
|
+
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
The Quantity object
|
|
66
|
+
|
|
67
|
+
"""
|
|
68
|
+
match = re.match(r'^([+-]?\d*\.?\d*(?:[eE][+-]?\d+)?)\s*(.*)$', quantity.strip())
|
|
69
|
+
if match:
|
|
70
|
+
value, unit = float(match.group(1)), match.group(2).strip()
|
|
71
|
+
value = float(value)
|
|
72
|
+
unit = unit.strip() or 'dimensionless'
|
|
73
|
+
return Q_(value, unit)
|
|
74
|
+
return Q_(quantity)
|
|
75
|
+
|
|
49
76
|
def dimensionless_aware_reduce_units(q: Type[Q_]) -> Type[Q_]:
|
|
50
77
|
"""
|
|
51
78
|
Take a quantity q and converts it to its reduced units.
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
{pymodaq_data-5.2.2 → pymodaq_data-5.2.5}/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.2 → pymodaq_data-5.2.5}/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
|