qplotter 1.6.0b3__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.
- qplot/__init__.py +46 -0
- qplot/__main__.py +232 -0
- qplot/_auxiliary_paths.py +63 -0
- qplot/_metadata.py +12 -0
- qplot/_repair.py +14 -0
- qplot/_shutdown_supervisor.py +4049 -0
- qplot/_version.py +12 -0
- qplot/_windows_shutdown_job.py +1166 -0
- qplot/configuration/__init__.py +3 -0
- qplot/configuration/config.py +573 -0
- qplot/configuration/config_schema.json +319 -0
- qplot/configuration/scripts.py +255 -0
- qplot/configuration/themes/__init__.py +13 -0
- qplot/configuration/themes/_base.py +579 -0
- qplot/configuration/themes/blank.py +17 -0
- qplot/configuration/themes/dark.py +54 -0
- qplot/configuration/themes/light.py +54 -0
- qplot/datahandling/LoadFromDB.py +224 -0
- qplot/datahandling/__init__.py +47 -0
- qplot/datahandling/_trusted_live_helper.py +812 -0
- qplot/datahandling/_trusted_live_protocol.py +1745 -0
- qplot/datahandling/database.py +2330 -0
- qplot/datahandling/dimensions.py +43 -0
- qplot/datahandling/file_identity.py +461 -0
- qplot/datahandling/parameter_data.py +149 -0
- qplot/datahandling/plot_progress.py +17 -0
- qplot/datahandling/qcodes_cache.py +277 -0
- qplot/datahandling/qcodes_compat.py +14 -0
- qplot/datahandling/readSQL.py +2442 -0
- qplot/datahandling/readonly.py +2561 -0
- qplot/datahandling/source_activity.py +21 -0
- qplot/datahandling/trusted_array_preview.py +127 -0
- qplot/datahandling/trusted_derived_cache.py +1605 -0
- qplot/datahandling/trusted_derived_rendering.py +868 -0
- qplot/datahandling/trusted_heatmap.py +241 -0
- qplot/datahandling/trusted_live.py +2808 -0
- qplot/datahandling/trusted_live_queries.py +5907 -0
- qplot/datahandling/trusted_live_service.py +1894 -0
- qplot/datahandling/trusted_live_supervisor.py +2161 -0
- qplot/datahandling/trusted_plot.py +283 -0
- qplot/datahandling/trusted_presentation.py +1065 -0
- qplot/datahandling/trusted_snapshot.py +1132 -0
- qplot/datahandling/trusted_work_coordinator.py +2157 -0
- qplot/datahandling/trusted_work_scheduler.py +1204 -0
- qplot/diagnostics.py +241 -0
- qplot/resources/testdata/qplot_test_db_01_10mb.csv +11 -0
- qplot/resources/testdata/qplot_test_db_02_25mb.csv +14 -0
- qplot/resources/testdata/qplot_test_db_03_50mb.csv +17 -0
- qplot/resources/testdata/qplot_test_db_04_100mb.csv +20 -0
- qplot/resources/testdata/qplot_test_db_05_250mb.csv +23 -0
- qplot/resources/testdata/qplot_test_db_06_500mb.csv +26 -0
- qplot/resources/testdata/qplot_test_db_07_1gb.csv +29 -0
- qplot/resources/testdata/qplot_test_db_08_5gb.csv +32 -0
- qplot/resources/testdata/qplot_test_db_09_10gb.csv +35 -0
- qplot/resources/testdata/qplot_test_db_10_30gb.csv +38 -0
- qplot/testdata.py +1733 -0
- qplot/tools/__init__.py +13 -0
- qplot/tools/finite_means.py +114 -0
- qplot/tools/general.py +134 -0
- qplot/tools/heatmap_geometry.py +381 -0
- qplot/tools/operation_registry.py +179 -0
- qplot/tools/plot_tools.py +625 -0
- qplot/tools/sample_statistics.py +56 -0
- qplot/tools/worker.py +2787 -0
- qplot/windows/__init__.py +9 -0
- qplot/windows/_colorbar.py +422 -0
- qplot/windows/_commands.py +523 -0
- qplot/windows/_config_persistence.py +123 -0
- qplot/windows/_database_actions.py +4904 -0
- qplot/windows/_dataset_handle.py +221 -0
- qplot/windows/_dragdrop.py +71 -0
- qplot/windows/_export_paths.py +1167 -0
- qplot/windows/_help.py +169 -0
- qplot/windows/_native_averaging.py +173 -0
- qplot/windows/_native_transforms.py +389 -0
- qplot/windows/_plot1d_snap.py +608 -0
- qplot/windows/_plot1d_traces.py +2183 -0
- qplot/windows/_plot2d_colorbar.py +1126 -0
- qplot/windows/_plot2d_colorbar_dialog.py +786 -0
- qplot/windows/_plot2d_layers.py +2197 -0
- qplot/windows/_plot2d_sweeps.py +712 -0
- qplot/windows/_plotWin.py +1993 -0
- qplot/windows/_plot_actions.py +2695 -0
- qplot/windows/_plot_appearance.py +276 -0
- qplot/windows/_plot_axis_scaling.py +1485 -0
- qplot/windows/_plot_export.py +1445 -0
- qplot/windows/_plot_feedback.py +110 -0
- qplot/windows/_plot_marquee.py +656 -0
- qplot/windows/_plot_refresh.py +942 -0
- qplot/windows/_plot_state.py +239 -0
- qplot/windows/_plot_transform_labels.py +60 -0
- qplot/windows/_preferences.py +635 -0
- qplot/windows/_refresh_interval.py +70 -0
- qplot/windows/_run_controls.py +828 -0
- qplot/windows/_shortcuts.py +47 -0
- qplot/windows/_subplots/__init__.py +8 -0
- qplot/windows/_subplots/subplot1d.py +531 -0
- qplot/windows/_subplots/subplot2d.py +918 -0
- qplot/windows/_svg_export.py +209 -0
- qplot/windows/_trusted_derived_qt.py +1759 -0
- qplot/windows/_widgets/__init__.py +23 -0
- qplot/windows/_widgets/_run_formatting.py +387 -0
- qplot/windows/_widgets/details_tables.py +1119 -0
- qplot/windows/_widgets/dropbox.py +290 -0
- qplot/windows/_widgets/operations.py +460 -0
- qplot/windows/_widgets/preview.py +2997 -0
- qplot/windows/_widgets/run_list_items.py +488 -0
- qplot/windows/_widgets/toolbar.py +111 -0
- qplot/windows/_widgets/treeWidgets.py +2572 -0
- qplot/windows/_window_controls.py +413 -0
- qplot/windows/main.py +1635 -0
- qplot/windows/plot1d.py +311 -0
- qplot/windows/plot2d.py +1901 -0
- qplotter-1.6.0b3.dist-info/METADATA +318 -0
- qplotter-1.6.0b3.dist-info/RECORD +119 -0
- qplotter-1.6.0b3.dist-info/WHEEL +5 -0
- qplotter-1.6.0b3.dist-info/entry_points.txt +4 -0
- qplotter-1.6.0b3.dist-info/licenses/LICENSE +21 -0
- qplotter-1.6.0b3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Any
|
|
2
|
+
|
|
3
|
+
from PyQt6 import QtGui
|
|
4
|
+
from PyQt6 import QtWidgets as qtw
|
|
5
|
+
from PyQt6.QtGui import QKeySequence
|
|
6
|
+
|
|
7
|
+
from qplot.diagnostics import log_user_error
|
|
8
|
+
|
|
9
|
+
from ._commands import CommandSpec, configure_action
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
class _PlotWindowFeedbackBase(qtw.QMainWindow):
|
|
13
|
+
visible: bool
|
|
14
|
+
else:
|
|
15
|
+
class _PlotWindowFeedbackBase:
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
_Shortcut = str | QKeySequence | list[QKeySequence] | tuple[QKeySequence, ...]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class PlotWindowFeedbackMixin(_PlotWindowFeedbackBase):
|
|
23
|
+
"""
|
|
24
|
+
Status-bar, overlay, error-dialog, and shortcut helpers for plot windows.
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def show_status(self, message: str, timeout: int = 5000) -> None:
|
|
29
|
+
"""
|
|
30
|
+
Shows a short message in the plot window status bar.
|
|
31
|
+
|
|
32
|
+
"""
|
|
33
|
+
if self.visible:
|
|
34
|
+
status_bar = self.statusBar()
|
|
35
|
+
if status_bar is not None:
|
|
36
|
+
status_bar.showMessage(message, timeout)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def show_plot_state(
|
|
40
|
+
self,
|
|
41
|
+
title: object,
|
|
42
|
+
detail: object | None = None,
|
|
43
|
+
kind: str = "info",
|
|
44
|
+
) -> None:
|
|
45
|
+
"""
|
|
46
|
+
Shows a prominent state message inside the plot area.
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
overlay: Any | None = self.__dict__.get("plot_state_overlay")
|
|
50
|
+
if overlay is not None:
|
|
51
|
+
overlay.show(title, detail=detail, kind=kind)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def hide_plot_state(self) -> None:
|
|
55
|
+
"""
|
|
56
|
+
Hides the plot-area state message when renderable data is available.
|
|
57
|
+
|
|
58
|
+
"""
|
|
59
|
+
overlay: Any | None = self.__dict__.get("plot_state_overlay")
|
|
60
|
+
if overlay is not None:
|
|
61
|
+
overlay.hide()
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def show_error(
|
|
65
|
+
self,
|
|
66
|
+
title: str,
|
|
67
|
+
message: str,
|
|
68
|
+
details: str | None = None,
|
|
69
|
+
) -> None:
|
|
70
|
+
"""
|
|
71
|
+
Shows an error both in the status bar and, for visible windows, in a
|
|
72
|
+
message box.
|
|
73
|
+
|
|
74
|
+
"""
|
|
75
|
+
log_user_error(title, message, details, __name__)
|
|
76
|
+
self.show_status(message, 10_000)
|
|
77
|
+
|
|
78
|
+
if not self.visible:
|
|
79
|
+
return
|
|
80
|
+
|
|
81
|
+
box = qtw.QMessageBox(qtw.QMessageBox.Icon.Warning, title, message, parent=self)
|
|
82
|
+
if details:
|
|
83
|
+
box.setDetailedText(details)
|
|
84
|
+
box.exec()
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def register_shortcut(
|
|
88
|
+
self,
|
|
89
|
+
action: QtGui.QAction,
|
|
90
|
+
shortcut: _Shortcut | CommandSpec,
|
|
91
|
+
status_tip: str | None = None,
|
|
92
|
+
) -> None:
|
|
93
|
+
"""
|
|
94
|
+
Registers a QAction shortcut on the plot window.
|
|
95
|
+
|
|
96
|
+
"""
|
|
97
|
+
if isinstance(shortcut, CommandSpec):
|
|
98
|
+
configure_action(action, shortcut, add_to=self)
|
|
99
|
+
return
|
|
100
|
+
|
|
101
|
+
configure_action(
|
|
102
|
+
action,
|
|
103
|
+
CommandSpec(
|
|
104
|
+
"",
|
|
105
|
+
action.text(),
|
|
106
|
+
status_tip or "",
|
|
107
|
+
shortcut,
|
|
108
|
+
),
|
|
109
|
+
add_to=self,
|
|
110
|
+
)
|