labmate 0.10.4__py3-none-any.whl → 0.10.6__py3-none-any.whl

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 (35) hide show
  1. labmate/__config__.py +1 -1
  2. labmate/acquisition/__init__.py +3 -2
  3. labmate/acquisition/acquisition_data.py +18 -0
  4. labmate/acquisition/acquisition_loop.py +11 -18
  5. labmate/acquisition/acquisition_manager.py +101 -41
  6. labmate/acquisition/analysis_data.py +15 -25
  7. labmate/acquisition/analysis_loop.py +9 -7
  8. labmate/acquisition/backend.py +24 -0
  9. labmate/acquisition/config_file.py +5 -3
  10. labmate/acquisition/custom_lint.py +2 -3
  11. labmate/acquisition_notebook/__init__.py +2 -2
  12. labmate/acquisition_notebook/acquisition_analysis_manager.py +30 -45
  13. labmate/acquisition_notebook/display_widget.py +9 -9
  14. labmate/attrdict/attrdict_class.py +4 -10
  15. labmate/display/__init__.py +2 -3
  16. labmate/display/buttons.py +1 -0
  17. labmate/display/links.py +2 -1
  18. labmate/display/main.py +3 -2
  19. labmate/display/platform_utils/__init__.py +3 -1
  20. labmate/display/platform_utils/windows_utils.py +3 -9
  21. labmate/parsing/__init__.py +3 -5
  22. labmate/parsing/parsed_value.py +30 -10
  23. labmate/parsing/saving.py +2 -6
  24. labmate/utils/async_utils.py +1 -0
  25. labmate/utils/autoreload.py +2 -0
  26. labmate/utils/file_read.py +12 -13
  27. labmate/utils/lint.py +9 -11
  28. labmate/utils/random_utils.py +1 -0
  29. labmate/utils/title_parsing.py +4 -14
  30. {labmate-0.10.4.dist-info → labmate-0.10.6.dist-info}/METADATA +13 -2
  31. labmate-0.10.6.dist-info/RECORD +41 -0
  32. {labmate-0.10.4.dist-info → labmate-0.10.6.dist-info}/WHEEL +1 -1
  33. labmate-0.10.4.dist-info/RECORD +0 -40
  34. {labmate-0.10.4.dist-info → labmate-0.10.6.dist-info/licenses}/LICENCE +0 -0
  35. {labmate-0.10.4.dist-info → labmate-0.10.6.dist-info}/top_level.txt +0 -0
labmate/utils/lint.py CHANGED
@@ -86,7 +86,7 @@ class NameVisitor(ast.NodeVisitor):
86
86
  external_vars (Set[str]): A set of external variable names.
87
87
  errors (List[str]): A list of errors encountered during traversal.
88
88
  run_on_call (Optional[Callable]): A function to run on each function call node.
89
- special_functions_db (Dict[str, Any]): A dictionary of special functions and their attributes.
89
+ special_functions_db (Dict[str, Any]): A dict of special functions and their attributes.
90
90
  """
91
91
 
92
92
  parent = None
@@ -107,9 +107,9 @@ class NameVisitor(ast.NodeVisitor):
107
107
  self.local_vars = ignore_var.copy() if ignore_var else set()
108
108
  self.builtins = set(__builtins__.keys())
109
109
  self.external_vars = set()
110
- self.errors = list()
110
+ self.errors = []
111
111
  self.run_on_call = kwargs.get("run_on_call")
112
- self.special_functions_db = dict()
112
+ self.special_functions_db = {}
113
113
  super().__init__()
114
114
 
115
115
  def visit(self, node, parent=None):
@@ -199,10 +199,9 @@ class LintResult(NamedTuple):
199
199
  errors: List[str]
200
200
 
201
201
 
202
- def find_variables_from_node(
203
- node, ignore_var: Optional[set] = None, **kwargs
204
- ) -> LintResult:
205
- """Walk through ast.node and find the variable that was never declared inside this node, but used.
202
+ def find_variables_from_node(node, ignore_var: Optional[set] = None, **kwargs) -> LintResult:
203
+ """
204
+ Walk through ast.node and find variables that were never declared inside the node, but are used.
206
205
 
207
206
  Variables from ingore_var set is allowed external variables to use.
208
207
  Returns (local_vars, external_vars)
@@ -246,8 +245,7 @@ def find_variables_from_code(
246
245
  f"Error at line {exception.lineno} in {exception.text}"
247
246
  ],
248
247
  )
249
- lint_results = find_variables_from_node(node, ignore_var, run_on_call=run_on_call)
250
- return lint_results
248
+ return find_variables_from_node(node, ignore_var, run_on_call=run_on_call)
251
249
 
252
250
 
253
251
  def find_variables_from_file(
@@ -260,12 +258,12 @@ def find_variables_from_file(
260
258
  Args:
261
259
  file: A string representing the path to the file to be analyzed.
262
260
  ignore_var: An optional set of variable names to ignore during analysis.
263
- run_on_call: An optional callable object to be run on each function call found during analysis.
261
+ run_on_call: An optional callable object to run on each function call found during analysis.
264
262
 
265
263
  Returns:
266
264
  A LintResult object containing the used and unused variables,
267
265
  and any errors encountered during analysis.
268
266
  """
269
- with open(file, "r", encoding="utf-8") as f:
267
+ with open(file, encoding="utf-8") as f:
270
268
  code = f.read()
271
269
  return find_variables_from_code(code, ignore_var, run_on_call=run_on_call)
@@ -7,6 +7,7 @@ from dh5.utils.random_utils import ( # pylint: disable=unused-import # noqa: F4
7
7
  get_timestamp,
8
8
  )
9
9
 
10
+
10
11
  _CallableWithNoArgs = Callable[[], Any]
11
12
 
12
13
 
@@ -17,13 +17,9 @@ def parse_get_format(key: str) -> Tuple[str, Optional[str], Optional[str]]:
17
17
  args = key.split("__")
18
18
  if len(args) >= 3:
19
19
  return args[0], args[1], args[2]
20
- elif (
21
- len(args) == 2
22
- and len(args[1]) > 0
23
- and (args[1][0].isdigit() or args[1][0] in (".", "_"))
24
- ):
20
+ if len(args) == 2 and len(args[1]) > 0 and (args[1][0].isdigit() or args[1][0] in (".", "_")):
25
21
  return args[0], None, args[1]
26
- elif len(args) == 2:
22
+ if len(args) == 2:
27
23
  return args[0], args[1], None
28
24
  return args[0], None, None
29
25
 
@@ -45,11 +41,7 @@ class ValueForPrint(NamedTuple):
45
41
  value_str = format(self.value, format_spec)
46
42
  number, power = value_str.split("e")
47
43
  number = number.rstrip("0_").rstrip(".") if "." in number else number
48
- power = (
49
- (power[0].lstrip("+0") + power[1:].lstrip("+0"))
50
- if len(power) > 1
51
- else power
52
- )
44
+ power = (power[0].lstrip("+0") + power[1:].lstrip("+0")) if len(power) > 1 else power
53
45
  return f"{number}e{power}"
54
46
  return format(self.value, format_spec)
55
47
 
@@ -70,9 +62,7 @@ def format_title(values: List[ValueForPrint], max_length: Optional[int] = None)
70
62
  units = f" ({value.units})" if value.units is not None else ""
71
63
  value_str = value.format_value()
72
64
  new_txt = f"{value.key} = {value_str}{units}"
73
- if not max_length or (
74
- (last_line_len + len(new_txt) < max_length) or last_line_len == 0
75
- ):
65
+ if not max_length or ((last_line_len + len(new_txt) < max_length) or last_line_len == 0):
76
66
  txt += ("; " if txt != "" else "") + new_txt
77
67
  last_line_len += len(new_txt) + 2
78
68
  else:
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: labmate
3
- Version: 0.10.4
3
+ Version: 0.10.6
4
4
  Summary: Data management library to save data and plots to hdf5 files
5
5
  Home-page: https://github.com/kyrylo-gr/labmate
6
6
  Author: kyrylo.gr | LKB-OMQ
@@ -21,6 +21,17 @@ Requires-Dist: pytest; extra == "dev"
21
21
  Requires-Dist: check-manifest; extra == "dev"
22
22
  Requires-Dist: sphinx; extra == "dev"
23
23
  Requires-Dist: sphinx_rtd_theme; extra == "dev"
24
+ Dynamic: author
25
+ Dynamic: author-email
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: home-page
30
+ Dynamic: license-file
31
+ Dynamic: provides-extra
32
+ Dynamic: requires-dist
33
+ Dynamic: requires-python
34
+ Dynamic: summary
24
35
 
25
36
  # Labmate. The mate that simplifies data management in your lab.
26
37
 
@@ -0,0 +1,41 @@
1
+ labmate/__config__.py,sha256=HlSdsabZDaLlvNW4QOT6UrUVCpaD6hP9WyC0_5tONZM,72
2
+ labmate/__init__.py,sha256=aHQiPLldCXIJqz6wwcfyFU9sGLofUR3W5sXBIRzK2n4,182
3
+ labmate/acquisition/__init__.py,sha256=PNuurN7mw-LQVCAZ1aDSc3ZFPvCXpgqOhW53yY24Jww,309
4
+ labmate/acquisition/acquisition_data.py,sha256=tPIcJFCJKCcf1fKmpU-TQyjlRVxxyV8h1ITDNoeyfr8,7203
5
+ labmate/acquisition/acquisition_loop.py,sha256=EupGt3K19AnDDyVbT5UVYvt6y0HlnvG57DgvtEstAbw,10971
6
+ labmate/acquisition/acquisition_manager.py,sha256=G3HmqmmaXZG0Wx5Gfk-cf3jdpRAwhsUen5ZRsUldNTU,13297
7
+ labmate/acquisition/analysis_data.py,sha256=TzW5_LCZ_th-T8HJuPMBGRZCOf3l7MFDRykTbhzFVWE,15822
8
+ labmate/acquisition/analysis_loop.py,sha256=GX5izMfYT7nAsr4OvbU016GyEbXyMcSqdGl8f3gC4nM,5148
9
+ labmate/acquisition/backend.py,sha256=6-aSG_bmy1xSovCqK0jDHR0vHFDV5ft5Df2rwpYxm84,642
10
+ labmate/acquisition/config_file.py,sha256=Gqn4JQxm9VFXsEhsrlbRi8vQkUogiOzPgfKNq9ZMcBk,2118
11
+ labmate/acquisition/custom_lint.py,sha256=siJ4KMryGWamXtfIlsvhq2YKjzSbS7Pgs2202VcNPGs,968
12
+ labmate/acquisition_notebook/__init__.py,sha256=KNpe5gc4ohRdhGQ6kgcROXwHlkD_dzpgaW9rRytM2YQ,251
13
+ labmate/acquisition_notebook/acquisition_analysis_manager.py,sha256=GyVbUotgL_MdpdqwG4Jl4sSENg7iA526BfVY7oVn4OU,23935
14
+ labmate/acquisition_notebook/display_widget.py,sha256=z9_iyanL8htPD6CXZ4C_ECh53dizkpiqIjLPow4WKrs,6923
15
+ labmate/attrdict/__init__.py,sha256=MvuZVe7j4a0HxGMxim_K2cv-dhqZOfzdeMiTX-SRgDg,58
16
+ labmate/attrdict/attrdict_class.py,sha256=KzZXGm9dzCA-FZUOHxo79RqYgrJN-OJAT1MCDfBQ_4I,3944
17
+ labmate/display/__init__.py,sha256=CMziMansNPqswRZVD-HOMN4TffyhLKi0EVxDU9Uo63w,937
18
+ labmate/display/buttons.py,sha256=lMmEf1snaoR1wQNWiLgA4dPWHUaaNIQOr7wsRSO68Cw,2927
19
+ labmate/display/html_output.py,sha256=aBDVzaR39PfFxchKcY9W5OpiYjIzB6t3WzNjzjubjzg,1591
20
+ labmate/display/links.py,sha256=gHbiXlPSLazBTyN75Dp4FVVbH_gFL_XnAkYCNjzkFZI,758
21
+ labmate/display/main.py,sha256=n3FzY0PvljqZ3RrMA-3KNNwU7m4qS50ZU8D9of3OKB8,2413
22
+ labmate/display/platform_utils/__init__.py,sha256=C4eXlfWEv42miE8QEu3D-1mdB27AMEoRt1hxLfAXlh0,1138
23
+ labmate/display/platform_utils/windows_utils.py,sha256=ZSbiW7x7brOkUlfokYK2UrP3n1_t4z7Ah814HStAdF0,3194
24
+ labmate/logger/__init__.py,sha256=Ks4bUNO_rNTFsw0Sh3JAfK1tZq8mqHoqXHP89xpexp0,2177
25
+ labmate/parsing/__init__.py,sha256=SiVmRbgByS0f0QXRkR-BwWwJoFPPlglAL9NRnGMx4EQ,1268
26
+ labmate/parsing/brackets_score.py,sha256=zzup7z6o57YUGeMr5FOSTo3nz9Z62s2omxqFV3M9MmI,988
27
+ labmate/parsing/parsed_value.py,sha256=aT1Frlk7mbUomJC8gDPlzgZEwW0HQqcaUH2dhsR5srY,6364
28
+ labmate/parsing/saving.py,sha256=nXwF4cs8eEeqqlJ8EcsGsh0kbqijITeJThnNGAIbNVg,2510
29
+ labmate/utils/__init__.py,sha256=g9LSaSVDFC4Uo7hbdd66aT7QewuXNRheZ8PZlMrcsNw,104
30
+ labmate/utils/async_utils.py,sha256=hb0vwCCVCaW1sEe8hb9fYfabw97t201n2WROvOuriTM,119
31
+ labmate/utils/autoreload.py,sha256=xPuE-5qQkETr2zoExJaR2mZlJ6vvzZ0GYDDhunTBNqo,307
32
+ labmate/utils/errors.py,sha256=ly7-JQStTKmPiMuT0w3eXFw1O8-1kpTsqZT2jebpJ-I,140
33
+ labmate/utils/file_read.py,sha256=x8Uy2MHN38PJ9fjsVoYYlCZk2hoFkKiLZz8wt1ROQ8A,3386
34
+ labmate/utils/lint.py,sha256=-mpGX7qnCDJVLsFv0AMh_WC-DKoQHbrT40jSByRtkEY,9301
35
+ labmate/utils/random_utils.py,sha256=yzt2xHbTWsqDANJ_-QA_k1zPmt-KBqb-VCdWGty_yxE,691
36
+ labmate/utils/title_parsing.py,sha256=Ypalo2DSI7e-8pfGwkcDWeky6guCmR7Au6dT9zoYDGA,2522
37
+ labmate-0.10.6.dist-info/licenses/LICENCE,sha256=J9XIxdJExlWYZuxhhKtk4oYILvUz8-JM0y_leRQCKUE,7488
38
+ labmate-0.10.6.dist-info/METADATA,sha256=oCM1MjwifuqwCrn1wBisYz1lQWwJbCDkssqkxYGKs84,3447
39
+ labmate-0.10.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
40
+ labmate-0.10.6.dist-info/top_level.txt,sha256=WWAn6t2zNWsp02gRq6f5cSsGebcs-4L6HBFk0XrcY0o,8
41
+ labmate-0.10.6.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,40 +0,0 @@
1
- labmate/__config__.py,sha256=hzFUnYJXx9HqUGa1RXeAC5Jv6jEpLTjzm6R7rJ7HAfg,72
2
- labmate/__init__.py,sha256=aHQiPLldCXIJqz6wwcfyFU9sGLofUR3W5sXBIRzK2n4,182
3
- labmate/acquisition/__init__.py,sha256=8q3dy18lL32A9y_Du8GggpLgJqDMFcFKddHrySMavrM,269
4
- labmate/acquisition/acquisition_data.py,sha256=UcpUaT1SkmnqGMyzP8cgH2JjLRtWZZdTk5S0JHf-v9c,6681
5
- labmate/acquisition/acquisition_loop.py,sha256=fiiseV21GB7pczHSEJrlLPiTSQ2u9y5VMDyCO7Hn0vY,11106
6
- labmate/acquisition/acquisition_manager.py,sha256=mcgYtKfoB4UIHeh-OcZMUEi5iGvBy8DPaguPTtt-48w,11365
7
- labmate/acquisition/analysis_data.py,sha256=TCFT1djOtL9Lwuc2g8R6KMmbQud6EC5wgSXRt_WojTA,15995
8
- labmate/acquisition/analysis_loop.py,sha256=1Y8lyPkTCNwskM8DkwrMXSOt0hNmBHcWJaQjdVZ81Hs,5075
9
- labmate/acquisition/config_file.py,sha256=1WwqaKTM-R5xZQHqqqGUi2QCF0PC1ag2mFgPOJuEdWI,2212
10
- labmate/acquisition/custom_lint.py,sha256=x4vNoOnbH3A4Odu2DQVtBsuSPo5JfvRpo8_EP0EOmgM,1005
11
- labmate/acquisition_notebook/__init__.py,sha256=ZtOGQtmPqEM1IRrL-_JYo4xYA87lFQ5JY5GmKcZz9z0,251
12
- labmate/acquisition_notebook/acquisition_analysis_manager.py,sha256=3Z0iRRz_Cln6lFxjinVbYSXH5Jg4N-fr47uFRZcXSJU,23822
13
- labmate/acquisition_notebook/display_widget.py,sha256=yS7KeZ362djhHYFldQMpz8keVT7G2MgHsCmGMlXT81s,6858
14
- labmate/attrdict/__init__.py,sha256=MvuZVe7j4a0HxGMxim_K2cv-dhqZOfzdeMiTX-SRgDg,58
15
- labmate/attrdict/attrdict_class.py,sha256=4lKXe7oZo_lLHefmf5vAOKhibWgGDffJcxMhaWLvGs4,4047
16
- labmate/display/__init__.py,sha256=u6HL38LpkeiGDkcIqE4GVvsEGF8OgZ776cSOHG5dmLA,966
17
- labmate/display/buttons.py,sha256=ReFLn5KD-KOlxjZPCoT32lt1jNMN8Xka3K35oh17ZLo,2926
18
- labmate/display/html_output.py,sha256=aBDVzaR39PfFxchKcY9W5OpiYjIzB6t3WzNjzjubjzg,1591
19
- labmate/display/links.py,sha256=YgCNxowca-oHxqozGWbe4oGLzwltnZ-C0v3E5fQnK0U,746
20
- labmate/display/main.py,sha256=tQWUdbO68Fu70Q3G7MtL8Rx6RA6PgWWUTRUbWqdo1N8,2400
21
- labmate/display/platform_utils/__init__.py,sha256=GOWB9vXF-wxGZfdHQJlQWy-hy2V2KXUP3JwxgN91Fq4,1136
22
- labmate/display/platform_utils/windows_utils.py,sha256=4Z_avuJIZ_KoXkuRZOH2667t2wEljzNBMP6fbNDknuk,3268
23
- labmate/logger/__init__.py,sha256=Ks4bUNO_rNTFsw0Sh3JAfK1tZq8mqHoqXHP89xpexp0,2177
24
- labmate/parsing/__init__.py,sha256=AHNB502jlm6PGd49_PJjvSxt97fxJeXnIfXYh8HV5x0,1312
25
- labmate/parsing/brackets_score.py,sha256=zzup7z6o57YUGeMr5FOSTo3nz9Z62s2omxqFV3M9MmI,988
26
- labmate/parsing/parsed_value.py,sha256=KZ2ratig5iOxcgjBaxEQFcK-MHHrX9pSOMJT20FsDTI,5788
27
- labmate/parsing/saving.py,sha256=pwCdYI9shrpKyFceRPNbPcbEfJbNQ7Xj0AMsDOr5qLA,2548
28
- labmate/utils/__init__.py,sha256=g9LSaSVDFC4Uo7hbdd66aT7QewuXNRheZ8PZlMrcsNw,104
29
- labmate/utils/async_utils.py,sha256=mSfmpF7I3M5KePkPtoS-OcuoCkFDHPKjf-RVF0P3R48,118
30
- labmate/utils/autoreload.py,sha256=wKi1GgWyRu1h101OguVRpO3zQXZ8qsFj-K-1P8PKuq8,305
31
- labmate/utils/errors.py,sha256=ly7-JQStTKmPiMuT0w3eXFw1O8-1kpTsqZT2jebpJ-I,140
32
- labmate/utils/file_read.py,sha256=2SqCwjkNeYD_AAt0lPZKZyEKGDHPg2JQ08GOozHvhkc,3417
33
- labmate/utils/lint.py,sha256=Rp6Rsga3hNe0WYIx8tA1D7pF0Gt-QTuyL9AFM4WXCzs,9355
34
- labmate/utils/random_utils.py,sha256=ZA3gK9P-eTcd_a3BTS_ZeJI5A0GM_GXL7X3yUqnPTO4,690
35
- labmate/utils/title_parsing.py,sha256=5csdqiD6w6pzyqRon38V2WeGA00CifSrMMtoWZmk0Ok,2644
36
- labmate-0.10.4.dist-info/LICENCE,sha256=J9XIxdJExlWYZuxhhKtk4oYILvUz8-JM0y_leRQCKUE,7488
37
- labmate-0.10.4.dist-info/METADATA,sha256=YaxwAmFkfvKWqB5-WqxcqeLrQyRSRpnQoMJO1E1G4_Q,3204
38
- labmate-0.10.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
39
- labmate-0.10.4.dist-info/top_level.txt,sha256=WWAn6t2zNWsp02gRq6f5cSsGebcs-4L6HBFk0XrcY0o,8
40
- labmate-0.10.4.dist-info/RECORD,,