labmate 0.10.2__tar.gz → 0.10.4__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.
- {labmate-0.10.2/labmate.egg-info → labmate-0.10.4}/PKG-INFO +1 -1
- {labmate-0.10.2 → labmate-0.10.4}/labmate/__config__.py +1 -1
- {labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition/acquisition_manager.py +11 -3
- {labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition/analysis_data.py +14 -5
- {labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition_notebook/acquisition_analysis_manager.py +43 -11
- {labmate-0.10.2 → labmate-0.10.4}/labmate/display/main.py +3 -3
- {labmate-0.10.2 → labmate-0.10.4}/labmate/parsing/parsed_value.py +24 -5
- {labmate-0.10.2 → labmate-0.10.4}/labmate/utils/file_read.py +1 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/utils/lint.py +2 -1
- {labmate-0.10.2 → labmate-0.10.4/labmate.egg-info}/PKG-INFO +1 -1
- {labmate-0.10.2 → labmate-0.10.4}/LICENCE +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/MANIFEST.in +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/README.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/about.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/acquisition_notebook.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/code/acquisition_loop.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/code/acquisition_manager.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/code/acquisition_notebook_manager.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/code/analysis_data.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/code/linting.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/code/parsing_config.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/examples/acquisition_and_analysis_notebook.ipynb +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/examples/aqm_simple_example.ipynb +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/examples/files/cfg.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/examples/files/dummy_config1.txt +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/examples/files/dummy_config2.txt +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/examples/files/dummy_config3.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/examples/files/init_analyse.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/examples/more/acquisition_and_analysis_notebook_with_magic.ipynb +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/examples/more/h5nparray.ipynb +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/examples/more/loop_example.ipynb +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/h5nparray.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/index.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/releases/0.4.0.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/releases/0.5.0.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/releases/0.6.0.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/releases/0.6.1.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/releases/0.7.0.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/releases/0.8.0.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/releases/index.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/starting_guide/advanced_examples.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/starting_guide/fine_tune.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/starting_guide/first_steps.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/docs/starting_guide/install.md +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/__init__.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition/__init__.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition/acquisition_data.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition/acquisition_loop.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition/analysis_loop.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition/config_file.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition/custom_lint.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition_notebook/__init__.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition_notebook/display_widget.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/attrdict/__init__.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/attrdict/attrdict_class.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/display/__init__.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/display/buttons.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/display/html_output.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/display/links.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/display/platform_utils/__init__.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/display/platform_utils/windows_utils.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/logger/__init__.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/parsing/__init__.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/parsing/brackets_score.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/parsing/saving.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/utils/__init__.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/utils/async_utils.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/utils/autoreload.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/utils/errors.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/utils/random_utils.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate/utils/title_parsing.py +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate.egg-info/SOURCES.txt +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate.egg-info/dependency_links.txt +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate.egg-info/requires.txt +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/labmate.egg-info/top_level.txt +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/requirements-docs.txt +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/requirements.txt +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/setup.cfg +0 -0
- {labmate-0.10.2 → labmate-0.10.4}/setup.py +0 -0
|
@@ -167,18 +167,22 @@ class AcquisitionManager:
|
|
|
167
167
|
experiment_path = Path(data_directory) / str(dic.experiment_name)
|
|
168
168
|
if not experiment_path.exists():
|
|
169
169
|
experiment_path.makedirs()
|
|
170
|
+
# Copy init_analyses code to the experiment directory if it does not exist
|
|
170
171
|
if self._init_code and not os.path.exists(experiment_path / "init_analyse.py"):
|
|
171
172
|
with open(
|
|
172
173
|
experiment_path / "init_analyse.py", "w", encoding="utf-8"
|
|
173
174
|
) as file:
|
|
174
175
|
file.write(self._init_code)
|
|
176
|
+
|
|
175
177
|
filepath_original = filepath = (
|
|
176
178
|
experiment_path / f"{dic.time_stamp}__{dic.experiment_name}"
|
|
177
179
|
)
|
|
180
|
+
|
|
181
|
+
# If ignore existence is True, no check is required
|
|
178
182
|
if ignore_existence:
|
|
179
183
|
return filepath
|
|
180
|
-
|
|
181
|
-
index =
|
|
184
|
+
# If the file already exists, add a suffix to the name
|
|
185
|
+
index = 1
|
|
182
186
|
while os.path.exists(filepath + ".h5"):
|
|
183
187
|
filepath = filepath_original + f"__{index}"
|
|
184
188
|
index += 1
|
|
@@ -307,7 +311,7 @@ class AcquisitionManager:
|
|
|
307
311
|
experiment_name=acquisition_tmp_data.experiment_name,
|
|
308
312
|
)
|
|
309
313
|
|
|
310
|
-
def save_acquisition(self, **kwds) -> "AcquisitionManager":
|
|
314
|
+
def save_acquisition(self, update_: bool = True, /, **kwds) -> "AcquisitionManager":
|
|
311
315
|
acq_data = self.current_acquisition
|
|
312
316
|
if acq_data is None:
|
|
313
317
|
raise ValueError(
|
|
@@ -315,6 +319,10 @@ class AcquisitionManager:
|
|
|
315
319
|
Possibly because you have never run `acquisition_cell(..)` or it's an old data"
|
|
316
320
|
""
|
|
317
321
|
)
|
|
322
|
+
if update_ is False:
|
|
323
|
+
for key in list(kwds.keys()):
|
|
324
|
+
if key in acq_data:
|
|
325
|
+
del kwds[key]
|
|
318
326
|
|
|
319
327
|
acq_data.update(**kwds)
|
|
320
328
|
acq_data.save_additional_info()
|
|
@@ -81,6 +81,7 @@ class AnalysisData(DH5):
|
|
|
81
81
|
save_files: bool = False,
|
|
82
82
|
save_on_edit: bool = True,
|
|
83
83
|
save_fig_inside_h5: bool = False,
|
|
84
|
+
open_on_init: Optional[bool] = None,
|
|
84
85
|
):
|
|
85
86
|
"""Load data from a filepath and lock it to prevent any changes.
|
|
86
87
|
|
|
@@ -106,6 +107,7 @@ class AnalysisData(DH5):
|
|
|
106
107
|
overwrite=False,
|
|
107
108
|
read_only=False,
|
|
108
109
|
save_on_edit=save_on_edit,
|
|
110
|
+
open_on_init=open_on_init,
|
|
109
111
|
)
|
|
110
112
|
|
|
111
113
|
self.lock_data()
|
|
@@ -305,16 +307,16 @@ class AnalysisData(DH5):
|
|
|
305
307
|
key_value, filename, key_units, key_format
|
|
306
308
|
)
|
|
307
309
|
)
|
|
308
|
-
elif key_value in
|
|
310
|
+
elif key_value in self:
|
|
309
311
|
keys_with_values.append(
|
|
310
312
|
utils.title_parsing.ValueForPrint(
|
|
311
|
-
key_value,
|
|
313
|
+
key_value, self[key_value], key_units, key_format
|
|
312
314
|
)
|
|
313
315
|
)
|
|
314
|
-
elif key_value in
|
|
316
|
+
elif key_value in config_data:
|
|
315
317
|
keys_with_values.append(
|
|
316
318
|
utils.title_parsing.ValueForPrint(
|
|
317
|
-
key_value,
|
|
319
|
+
key_value, config_data[key_value], key_units, key_format
|
|
318
320
|
)
|
|
319
321
|
)
|
|
320
322
|
else:
|
|
@@ -382,7 +384,11 @@ class AnalysisData(DH5):
|
|
|
382
384
|
)
|
|
383
385
|
|
|
384
386
|
def get_analysis_code(
|
|
385
|
-
self,
|
|
387
|
+
self,
|
|
388
|
+
name: str = "default",
|
|
389
|
+
/,
|
|
390
|
+
update_code: bool = True,
|
|
391
|
+
replace: Optional[dict] = None,
|
|
386
392
|
) -> str:
|
|
387
393
|
code: Optional[dict] = self.get("analysis_cells")
|
|
388
394
|
if code is None:
|
|
@@ -403,6 +409,9 @@ class AnalysisData(DH5):
|
|
|
403
409
|
code_str = code_str.replace(
|
|
404
410
|
"aqm.analysis_cell()", f"aqm.analysis_cell('{self.filepath}')"
|
|
405
411
|
)
|
|
412
|
+
if replace is not None:
|
|
413
|
+
for key, value in replace.items():
|
|
414
|
+
code_str = code_str.replace(key, value)
|
|
406
415
|
return code_str
|
|
407
416
|
|
|
408
417
|
def open_figs(self) -> list:
|
{labmate-0.10.2 → labmate-0.10.4}/labmate/acquisition_notebook/acquisition_analysis_manager.py
RENAMED
|
@@ -240,9 +240,11 @@ class AcquisitionAnalysisManager(AcquisitionManager):
|
|
|
240
240
|
"Cannot save data to acquisition as current acquisition is None."
|
|
241
241
|
"Possibly because you have never run `acquisition_cell(..)` or it's an old data"
|
|
242
242
|
)
|
|
243
|
-
acq_data[__key] = __value
|
|
243
|
+
acq_data[__key] = __value # pylint: disable=E1137
|
|
244
244
|
|
|
245
|
-
def save_acquisition(
|
|
245
|
+
def save_acquisition(
|
|
246
|
+
self, update_: bool = True, /, file_suffix: Optional[str] = None, **kwds
|
|
247
|
+
) -> "AcquisitionAnalysisManager":
|
|
246
248
|
acquisition_finished = time.time()
|
|
247
249
|
if not self._once_saved:
|
|
248
250
|
additional_info: Dict[str, Any] = {
|
|
@@ -255,10 +257,9 @@ class AcquisitionAnalysisManager(AcquisitionManager):
|
|
|
255
257
|
additional_info.update(
|
|
256
258
|
{"default_config_files": self._default_config_files}
|
|
257
259
|
)
|
|
258
|
-
|
|
259
260
|
kwds.update({"info": additional_info})
|
|
260
261
|
|
|
261
|
-
super().save_acquisition(**kwds)
|
|
262
|
+
super().save_acquisition(update_, file_suffix=file_suffix, **kwds)
|
|
262
263
|
self._load_analysis_data()
|
|
263
264
|
return self
|
|
264
265
|
|
|
@@ -273,6 +274,23 @@ class AcquisitionAnalysisManager(AcquisitionManager):
|
|
|
273
274
|
return self._analysis_data
|
|
274
275
|
|
|
275
276
|
def load_file(self, filename) -> "AnalysisData":
|
|
277
|
+
"""
|
|
278
|
+
Loads an analysis data file.
|
|
279
|
+
|
|
280
|
+
Args:
|
|
281
|
+
filename (str): The name of the file to load.
|
|
282
|
+
|
|
283
|
+
Returns:
|
|
284
|
+
AnalysisData: An instance of AnalysisData containing the loaded data.
|
|
285
|
+
|
|
286
|
+
Raises:
|
|
287
|
+
ValueError: If the file cannot be found.
|
|
288
|
+
|
|
289
|
+
Notes:
|
|
290
|
+
- The method checks if the file exists with a ".h5" extension.
|
|
291
|
+
- If the data does not have a "useful" attribute set to True, it updates this attribute.
|
|
292
|
+
- If default configuration files are provided, they are set in the loaded data.
|
|
293
|
+
"""
|
|
276
294
|
filename = self._get_full_filename(filename)
|
|
277
295
|
if not os.path.exists(
|
|
278
296
|
filename if filename.endswith(".h5") else filename + ".h5"
|
|
@@ -284,6 +302,7 @@ class AcquisitionAnalysisManager(AcquisitionManager):
|
|
|
284
302
|
save_files=self._save_files,
|
|
285
303
|
save_on_edit=self._save_on_edit_analysis,
|
|
286
304
|
save_fig_inside_h5=self._save_fig_inside_h5,
|
|
305
|
+
open_on_init=False,
|
|
287
306
|
)
|
|
288
307
|
|
|
289
308
|
if not data.get("useful", True):
|
|
@@ -308,7 +327,16 @@ class AcquisitionAnalysisManager(AcquisitionManager):
|
|
|
308
327
|
self._acquisition_started = time.time()
|
|
309
328
|
|
|
310
329
|
cell = cell or get_current_cell(self.shell)
|
|
311
|
-
if step
|
|
330
|
+
if step == 1:
|
|
331
|
+
self.logger.reset()
|
|
332
|
+
self.new_acquisition(name=name, cell=cell, save_on_edit=save_on_edit)
|
|
333
|
+
elif self._current_acquisition is None:
|
|
334
|
+
raise ValueError("Acquisition should start from step 1")
|
|
335
|
+
elif self._current_acquisition.current_step == step:
|
|
336
|
+
raise ValueError(
|
|
337
|
+
"This step was already run. Please run the next step or restart from step 1"
|
|
338
|
+
)
|
|
339
|
+
else:
|
|
312
340
|
if self._current_acquisition.experiment_name != name:
|
|
313
341
|
raise ValueError(
|
|
314
342
|
f"Current acquisition ('{self.current_experiment_name}') "
|
|
@@ -326,9 +354,6 @@ class AcquisitionAnalysisManager(AcquisitionManager):
|
|
|
326
354
|
"Please rerun the acquisition from the first step."
|
|
327
355
|
)
|
|
328
356
|
self.logger.stdout_flush()
|
|
329
|
-
else:
|
|
330
|
-
self.logger.reset()
|
|
331
|
-
self.new_acquisition(name=name, cell=cell, save_on_edit=save_on_edit)
|
|
332
357
|
|
|
333
358
|
self.logger.info( # pylint: disable=W1203
|
|
334
359
|
f"{step}:{self.current_filepath.basename}"
|
|
@@ -571,6 +596,7 @@ class AcquisitionAnalysisManager(AcquisitionManager):
|
|
|
571
596
|
def display_cfg_link(
|
|
572
597
|
self,
|
|
573
598
|
parameters: Dict[str, Any],
|
|
599
|
+
update_button: bool = False,
|
|
574
600
|
):
|
|
575
601
|
from labmate.display import html_output
|
|
576
602
|
|
|
@@ -589,9 +615,15 @@ class AcquisitionAnalysisManager(AcquisitionManager):
|
|
|
589
615
|
def update_value(param, value):
|
|
590
616
|
self.update_config_params_on_disk({param: value})
|
|
591
617
|
|
|
592
|
-
buttons =
|
|
593
|
-
|
|
594
|
-
|
|
618
|
+
buttons = (
|
|
619
|
+
[
|
|
620
|
+
display.buttons.create_button(
|
|
621
|
+
update_value, param, value, name="Update"
|
|
622
|
+
)
|
|
623
|
+
]
|
|
624
|
+
if update_button
|
|
625
|
+
else None
|
|
626
|
+
)
|
|
595
627
|
|
|
596
628
|
link = html_output.create_link_row(
|
|
597
629
|
link_text=f"{param} = ",
|
|
@@ -24,7 +24,7 @@ try:
|
|
|
24
24
|
|
|
25
25
|
display = display.display_functions.display
|
|
26
26
|
|
|
27
|
-
except ImportError:
|
|
27
|
+
except (ImportError, AttributeError):
|
|
28
28
|
# For testing purposes every IPython function should have a simpler version.
|
|
29
29
|
# pylint: disable=C0115, C0103, R0903
|
|
30
30
|
|
|
@@ -56,8 +56,8 @@ except ImportError:
|
|
|
56
56
|
class CoreWidget: # noqa: D106
|
|
57
57
|
pass
|
|
58
58
|
|
|
59
|
-
class Layout:
|
|
60
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
59
|
+
class Layout: # noqa: D106
|
|
60
|
+
def __init__(self, *args, **kwargs) -> None: # noqa: D107
|
|
61
61
|
del args, kwargs
|
|
62
62
|
|
|
63
63
|
# pylint: enable=C0115, C0103, R0903
|
|
@@ -84,6 +84,9 @@ class ParsedValue:
|
|
|
84
84
|
def __float__(self) -> float:
|
|
85
85
|
return float(self.value) # type: ignore
|
|
86
86
|
|
|
87
|
+
def __neg__(self) -> float:
|
|
88
|
+
return -self.value # type: ignore
|
|
89
|
+
|
|
87
90
|
def __add__(self, other):
|
|
88
91
|
other = self._convert_other(other)
|
|
89
92
|
return self.value + other
|
|
@@ -112,45 +115,61 @@ class ParsedValue:
|
|
|
112
115
|
other = self._convert_other(other)
|
|
113
116
|
return self.value / other # type: ignore
|
|
114
117
|
|
|
118
|
+
def __rtruediv__(self, other):
|
|
119
|
+
other = self._convert_other(other)
|
|
120
|
+
return other / self.value # type: ignore
|
|
121
|
+
|
|
115
122
|
def __floordiv__(self, other):
|
|
116
123
|
other = self._convert_other(other)
|
|
117
124
|
return self.value // other # type: ignore
|
|
118
125
|
|
|
126
|
+
def __rfloordiv__(self, other):
|
|
127
|
+
other = self._convert_other(other)
|
|
128
|
+
return other // self.value # type: ignore
|
|
129
|
+
|
|
119
130
|
def __mod__(self, other):
|
|
120
131
|
other = self._convert_other(other)
|
|
121
132
|
return self.value % other
|
|
122
133
|
|
|
134
|
+
def __rmod__(self, other):
|
|
135
|
+
other = self._convert_other(other)
|
|
136
|
+
return other % self.value
|
|
137
|
+
|
|
123
138
|
def __pow__(self, other):
|
|
124
139
|
other = self._convert_other(other)
|
|
125
140
|
return self.value**other
|
|
126
141
|
|
|
142
|
+
def __rpow__(self, other):
|
|
143
|
+
other = self._convert_other(other)
|
|
144
|
+
return other**self.value
|
|
145
|
+
|
|
127
146
|
def __lt__(self, other):
|
|
128
147
|
other = self._convert_other(other)
|
|
129
148
|
if isinstance(self.value, complex):
|
|
130
149
|
raise TypeError("Cannot compare complex values")
|
|
131
|
-
return self.value
|
|
150
|
+
return self.value < other
|
|
132
151
|
|
|
133
152
|
def __gt__(self, other):
|
|
134
153
|
other = self._convert_other(other)
|
|
135
154
|
if isinstance(self.value, complex):
|
|
136
155
|
raise TypeError("Cannot compare complex values")
|
|
137
|
-
return self.value
|
|
156
|
+
return self.value > other
|
|
138
157
|
|
|
139
158
|
def __le__(self, other):
|
|
140
159
|
other = self._convert_other(other)
|
|
141
160
|
if isinstance(self.value, complex):
|
|
142
161
|
raise TypeError("Cannot compare complex values")
|
|
143
|
-
return self.value
|
|
162
|
+
return self.value <= other
|
|
144
163
|
|
|
145
164
|
def __ge__(self, other):
|
|
146
165
|
other = self._convert_other(other)
|
|
147
166
|
if isinstance(self.value, complex):
|
|
148
167
|
raise TypeError("Cannot compare complex values")
|
|
149
|
-
return self.value
|
|
168
|
+
return self.value >= other
|
|
150
169
|
|
|
151
170
|
def __ne__(self, other):
|
|
152
171
|
other = self._convert_other(other)
|
|
153
|
-
return self.value
|
|
172
|
+
return self.value != other
|
|
154
173
|
|
|
155
174
|
@property
|
|
156
175
|
def is_complex(self):
|
|
@@ -137,6 +137,7 @@ class NameVisitor(ast.NodeVisitor):
|
|
|
137
137
|
|
|
138
138
|
if isinstance(node, ast.FunctionDef):
|
|
139
139
|
variables = get_all_args_from_def(node.args)
|
|
140
|
+
self.local_vars.add(node.name)
|
|
140
141
|
node.dont_parse = variables # type: ignore
|
|
141
142
|
|
|
142
143
|
if isinstance(node, ast.Lambda):
|
|
@@ -241,7 +242,7 @@ def find_variables_from_code(
|
|
|
241
242
|
set(),
|
|
242
243
|
[
|
|
243
244
|
"Syntax error is found during linting. Probably because #noqa is used. "
|
|
244
|
-
"#noqa removes line from the
|
|
245
|
+
"#noqa removes line from the analysis, so don't use it with line breaks.\n"
|
|
245
246
|
f"Error at line {exception.lineno} in {exception.text}"
|
|
246
247
|
],
|
|
247
248
|
)
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|