Skip to content

Commit 042d9cf

Browse files
Suppressed warning on QT_VERSION
1 parent 0b3a3fb commit 042d9cf

File tree

5 files changed

+54
-29
lines changed

5 files changed

+54
-29
lines changed

demo_A_GUI_full.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,24 @@
3939
"""[s] History length of the chart"""
4040

4141
# Global flags
42-
# fmt: off
4342
TRY_USING_OPENGL = True
44-
USE_LARGER_TEXT = False # For demonstration on a beamer
45-
USE_PC_TIME = True # Use Arduino time or PC time?
46-
SIMULATE_ARDUINO = False # Simulate an Arduino, instead?
47-
# fmt: on
43+
USE_LARGER_TEXT = False
44+
"""For demonstration on a beamer"""
45+
USE_PC_TIME = True
46+
"""Use Arduino time or PC time?"""
47+
SIMULATE_ARDUINO = False
48+
"""Simulate an Arduino in software?"""
4849
if sys.argv[-1] == "simulate":
4950
SIMULATE_ARDUINO = True
5051

51-
# Show debug info in terminal? Warning: Slow! Do not leave on unintentionally.
5252
DEBUG = False
53+
"""Show debug info in terminal? Warning: Slow! Do not leave on unintentionally.
54+
"""
5355

54-
print(f"{qtpy.API_NAME:9s} {qtpy.QT_VERSION}")
56+
print(
57+
f"{qtpy.API_NAME:9s} "
58+
f"{qtpy.QT_VERSION}" # pyright: ignore[reportPrivateImportUsage]
59+
)
5560
print(f"PyQtGraph {pg.__version__}")
5661

5762
if TRY_USING_OPENGL:

demo_B_GUI_minimal.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,22 @@
3535
"""[s] History length of the chart"""
3636

3737
# Global flags
38-
# fmt: off
3938
TRY_USING_OPENGL = True
40-
USE_PC_TIME = True # Use Arduino time or PC time?
41-
SIMULATE_ARDUINO = False # Simulate an Arduino, instead?
42-
# fmt: on
39+
USE_PC_TIME = True
40+
"""Use Arduino time or PC time?"""
41+
SIMULATE_ARDUINO = False
42+
"""Simulate an Arduino in software?"""
4343
if sys.argv[-1] == "simulate":
4444
SIMULATE_ARDUINO = True
4545

46-
# Show debug info in terminal? Warning: Slow! Do not leave on unintentionally.
4746
DEBUG = False
47+
"""Show debug info in terminal? Warning: Slow! Do not leave on unintentionally.
48+
"""
4849

49-
print(f"{qtpy.API_NAME:9s} {qtpy.QT_VERSION}")
50+
print(
51+
f"{qtpy.API_NAME:9s} "
52+
f"{qtpy.QT_VERSION}" # pyright: ignore[reportPrivateImportUsage]
53+
)
5054
print(f"PyQtGraph {pg.__version__}")
5155

5256
if TRY_USING_OPENGL:

demo_C_singlethread_for_comparison.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,22 @@
4747
"""[s] History length of the chart"""
4848

4949
# Global flags
50-
# fmt: off
5150
TRY_USING_OPENGL = True
52-
USE_PC_TIME = True # Use Arduino time or PC time?
53-
SIMULATE_ARDUINO = False # Simulate an Arduino, instead?
54-
# fmt: on
51+
USE_PC_TIME = True
52+
"""Use Arduino time or PC time?"""
53+
SIMULATE_ARDUINO = False
54+
"""Simulate an Arduino in software?"""
5555
if sys.argv[-1] == "simulate":
5656
SIMULATE_ARDUINO = True
5757

58-
# Show debug info in terminal? Warning: Slow! Do not leave on unintentionally.
5958
DEBUG = False
59+
"""Show debug info in terminal? Warning: Slow! Do not leave on unintentionally.
60+
"""
6061

61-
print(f"{qtpy.API_NAME:9s} {qtpy.QT_VERSION}")
62+
print(
63+
f"{qtpy.API_NAME:9s} "
64+
f"{qtpy.QT_VERSION}" # pyright: ignore[reportPrivateImportUsage]
65+
)
6266
print(f"PyQtGraph {pg.__version__}")
6367

6468
if TRY_USING_OPENGL:

demo_D_no_GUI.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,21 @@
3131
"""[ms] Update interval for the data acquisition (DAQ)"""
3232

3333
# Global flags
34-
USE_PC_TIME = True # Use Arduino time or PC time?
35-
SIMULATE_ARDUINO = False # Simulate an Arduino, instead?
34+
USE_PC_TIME = True
35+
"""Use Arduino time or PC time?"""
36+
SIMULATE_ARDUINO = False
37+
"""Simulate an Arduino in software?"""
3638
if sys.argv[-1] == "simulate":
3739
SIMULATE_ARDUINO = True
3840

39-
# Show debug info in terminal? Warning: Slow! Do not leave on unintentionally.
4041
DEBUG = False
42+
"""Show debug info in terminal? Warning: Slow! Do not leave on unintentionally.
43+
"""
4144

42-
print(f"{qtpy.API_NAME:9s} {qtpy.QT_VERSION}")
45+
print(
46+
f"{qtpy.API_NAME:9s} "
47+
f"{qtpy.QT_VERSION}" # pyright: ignore[reportPrivateImportUsage]
48+
)
4349

4450
# ------------------------------------------------------------------------------
4551
# Main

demo_E_no_GUI.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,21 @@
3535
"""[ms] Update interval for the data acquisition (DAQ)"""
3636

3737
# Global flags
38-
USE_PC_TIME = True # Use Arduino time or PC time?
39-
SIMULATE_ARDUINO = False # Simulate an Arduino, instead?
38+
USE_PC_TIME = True
39+
"""Use Arduino time or PC time?"""
40+
SIMULATE_ARDUINO = False
41+
"""Simulate an Arduino in software?"""
4042
if sys.argv[-1] == "simulate":
4143
SIMULATE_ARDUINO = True
4244

43-
# Show debug info in terminal? Warning: Slow! Do not leave on unintentionally.
4445
DEBUG = False
46+
"""Show debug info in terminal? Warning: Slow! Do not leave on unintentionally.
47+
"""
4548

46-
print(f"{qtpy.API_NAME:9s} {qtpy.QT_VERSION}")
49+
print(
50+
f"{qtpy.API_NAME:9s} "
51+
f"{qtpy.QT_VERSION}" # pyright: ignore[reportPrivateImportUsage]
52+
)
4753

4854
# ------------------------------------------------------------------------------
4955
# WaveGeneratorArduino_qdev
@@ -137,7 +143,7 @@ def request_set_waveform_to_sawtooth(self):
137143
# Set up multithreaded communication with the Arduino
138144
# --------------------------------------------------------------------------
139145

140-
def DAQ_function() -> bool:
146+
def my_DAQ_function() -> bool:
141147
"""Perform a single data acquisition.
142148
143149
Returns: True if successful, False otherwise.
@@ -165,7 +171,7 @@ def DAQ_function() -> bool:
165171
# acting as a slave device.
166172
ard_qdev = WaveGeneratorArduino_qdev(
167173
dev=ard,
168-
DAQ_function=DAQ_function,
174+
DAQ_function=my_DAQ_function,
169175
DAQ_interval_ms=DAQ_INTERVAL_MS,
170176
debug=DEBUG,
171177
)

0 commit comments

Comments
 (0)