xarray-graph 0.2.2__py3-none-any.whl → 0.2.3__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.
- xarray_graph/XarrayGraph.py +28 -6
- {xarray_graph-0.2.2.dist-info → xarray_graph-0.2.3.dist-info}/METADATA +1 -1
- xarray_graph-0.2.3.dist-info/RECORD +9 -0
- xarray_graph-0.2.2.dist-info/RECORD +0 -9
- {xarray_graph-0.2.2.dist-info → xarray_graph-0.2.3.dist-info}/WHEEL +0 -0
- {xarray_graph-0.2.2.dist-info → xarray_graph-0.2.3.dist-info}/entry_points.txt +0 -0
- {xarray_graph-0.2.2.dist-info → xarray_graph-0.2.3.dist-info}/licenses/LICENSE +0 -0
xarray_graph/XarrayGraph.py
CHANGED
|
@@ -905,8 +905,9 @@ class XarrayGraph(QMainWindow):
|
|
|
905
905
|
item.deleteLater()
|
|
906
906
|
self.add_region(region)
|
|
907
907
|
|
|
908
|
-
# stop drawing regions (draw one at a time)
|
|
909
|
-
self.
|
|
908
|
+
# stop drawing regions (draw one at a time)?
|
|
909
|
+
if self._draw_single_region_action.isChecked():
|
|
910
|
+
self._set_region_drawing_mode(False)
|
|
910
911
|
|
|
911
912
|
def _setup_ui(self) -> None:
|
|
912
913
|
self._setup_menubar()
|
|
@@ -916,11 +917,13 @@ class XarrayGraph(QMainWindow):
|
|
|
916
917
|
self._control_panel_toolbar.setStyleSheet("QToolBar{spacing:2px;}")
|
|
917
918
|
self._control_panel_toolbar.setIconSize(QSize(DEFAULT_ICON_SIZE, DEFAULT_ICON_SIZE))
|
|
918
919
|
self._control_panel_toolbar.setMovable(False)
|
|
920
|
+
self._control_panel_toolbar.setContextMenuPolicy(Qt.ContextMenuPolicy.PreventContextMenu)
|
|
919
921
|
|
|
920
922
|
self._plot_grid_toolbar = QToolBar()
|
|
921
923
|
self._plot_grid_toolbar.setStyleSheet("QToolBar{spacing:2px;}")
|
|
922
924
|
self._plot_grid_toolbar.setIconSize(QSize(DEFAULT_ICON_SIZE, DEFAULT_ICON_SIZE))
|
|
923
925
|
self._plot_grid_toolbar.setMovable(False)
|
|
926
|
+
self._plot_grid_toolbar.setContextMenuPolicy(Qt.ContextMenuPolicy.PreventContextMenu)
|
|
924
927
|
icon_button = QToolButton()
|
|
925
928
|
icon_button.setIcon(qta.icon('fa5s.cubes', options=[{'opacity': 0.5}]))
|
|
926
929
|
icon_button.pressed.connect(self.refresh)
|
|
@@ -991,6 +994,18 @@ class XarrayGraph(QMainWindow):
|
|
|
991
994
|
self._region_button.clicked.connect(self._set_region_drawing_mode)
|
|
992
995
|
self._action_after_dim_iter_things = self._plot_grid_toolbar.addWidget(self._region_button)
|
|
993
996
|
|
|
997
|
+
self._region_button_menu = QMenu()
|
|
998
|
+
self._draw_single_region_action = QAction('Draw single region', self._region_button_menu, checkable=True, checked=True)
|
|
999
|
+
self._draw_multiple_regions_action = QAction('Draw multiple regions', self._region_button_menu, checkable=True, checked=False)
|
|
1000
|
+
self._region_button_menu.addAction(self._draw_single_region_action)
|
|
1001
|
+
self._region_button_menu.addAction(self._draw_multiple_regions_action)
|
|
1002
|
+
group = QActionGroup(self._region_button_menu)
|
|
1003
|
+
group.addAction(self._draw_single_region_action)
|
|
1004
|
+
group.addAction(self._draw_multiple_regions_action)
|
|
1005
|
+
group.setExclusive(True)
|
|
1006
|
+
self._region_button.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
|
1007
|
+
self._region_button.customContextMenuRequested.connect(lambda pos: self._region_button_menu.exec_(self._region_button.mapToGlobal(pos)))
|
|
1008
|
+
|
|
994
1009
|
self._home_button = QToolButton()
|
|
995
1010
|
self._home_button.setIcon(qta.icon('mdi.home-outline', options=[{'opacity': 0.5}]))
|
|
996
1011
|
self._home_button.setToolTip('Autoscale all plots')
|
|
@@ -1497,6 +1512,13 @@ class XarrayGraph(QMainWindow):
|
|
|
1497
1512
|
|
|
1498
1513
|
self._control_panel.addWidget(scroll_area)
|
|
1499
1514
|
|
|
1515
|
+
# def _show_region_context_menu(self, pos: QPoint) -> None:
|
|
1516
|
+
# if not hasattr(self, '_region_button_menu'):
|
|
1517
|
+
# self._region_button_menu = QMenu()
|
|
1518
|
+
# menu = QMenu()
|
|
1519
|
+
# menu.addAction('Draw X-axis regions until unchecked', self.clear_regions)
|
|
1520
|
+
# menu.exec(self.sender().mapToGlobal(pos))
|
|
1521
|
+
|
|
1500
1522
|
def _set_region_drawing_mode(self, draw: bool | None = None) -> None:
|
|
1501
1523
|
if draw is None:
|
|
1502
1524
|
draw = self._region_button.isChecked()
|
|
@@ -1725,7 +1747,7 @@ class XarrayGraph(QMainWindow):
|
|
|
1725
1747
|
i = np.argpartition(x, len(x) // 2)[len(x) // 2]
|
|
1726
1748
|
return x[i]
|
|
1727
1749
|
if measure_type in ['Min', 'Max', 'AbsMax', 'Peaks']:
|
|
1728
|
-
peak_width = self.
|
|
1750
|
+
peak_width = self._peak_half_width_spinbox.value()
|
|
1729
1751
|
if peak_width > 0:
|
|
1730
1752
|
def get_peak_index_range(mask, center_index):
|
|
1731
1753
|
start, stop = center_index, center_index + 1
|
|
@@ -2010,21 +2032,21 @@ class XarrayGraph(QMainWindow):
|
|
|
2010
2032
|
dims = yarr.dims
|
|
2011
2033
|
|
|
2012
2034
|
# region mask for fit optimization and/or evaluation
|
|
2013
|
-
if regions and (self.
|
|
2035
|
+
if regions and (self._curve_fit_optimize_in_regions_checkbox.isChecked() or self._curve_fit_evaluate_in_regions_checkbox.isChecked()):
|
|
2014
2036
|
# mask for combined regions
|
|
2015
2037
|
regions_mask = np.full(xdata.shape, False)
|
|
2016
2038
|
for region in regions:
|
|
2017
2039
|
xmin, xmax = region
|
|
2018
2040
|
regions_mask[(xdata >= xmin) & (xdata <= xmax)] = True
|
|
2019
2041
|
|
|
2020
|
-
if regions and self.
|
|
2042
|
+
if regions and self._curve_fit_optimize_in_regions_checkbox.isChecked():
|
|
2021
2043
|
xinput = xdata[regions_mask]
|
|
2022
2044
|
yinput = ydata[regions_mask]
|
|
2023
2045
|
else:
|
|
2024
2046
|
xinput = xdata
|
|
2025
2047
|
yinput = ydata
|
|
2026
2048
|
|
|
2027
|
-
if regions and self.
|
|
2049
|
+
if regions and self._curve_fit_evaluate_in_regions_checkbox.isChecked():
|
|
2028
2050
|
xoutput = xdata[regions_mask]
|
|
2029
2051
|
else:
|
|
2030
2052
|
xoutput = xdata
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
xarray_graph-0.2.3.dist-info/METADATA,sha256=GaDxbjSvASvVLDl5BMk0KvQpzJHH301TgcX-OzGihFM,1488
|
|
2
|
+
xarray_graph-0.2.3.dist-info/WHEEL,sha256=vnE8JVcI2Wz7GRKorsPArnBdnW2SWKWGow5gu5tHlRU,90
|
|
3
|
+
xarray_graph-0.2.3.dist-info/entry_points.txt,sha256=aW9CKuCZREtN_3Mtg4dKrysPMmHc-tQdUCNmzQYE_vA,61
|
|
4
|
+
xarray_graph-0.2.3.dist-info/licenses/LICENSE,sha256=OE7VkhwkLeFeY8LXi86O-nMXC9B3WsBSILLfPmYGd-8,1077
|
|
5
|
+
xarray_graph/XarrayGraph.py,sha256=0fi5RZ0rt7WS6nIaYoPfEfuDg_StsJJkbpEa9_F60BY,102020
|
|
6
|
+
xarray_graph/__init__.py,sha256=1aAM-Fcno60-ou3AnSqt5HKm6UmZrtULGzg2LF34IJE,48
|
|
7
|
+
xarray_graph/__main__.py,sha256=8c74k8lpaqOuMeKlcBahOKfgo08O7xmJs_htvKKKpck,2274
|
|
8
|
+
xarray_graph/tmp/RegionsManager.py,sha256=0nnrO1e1mqvrs88doO51SJ3JvMNW5wXBKOp2nLQcUFs,1841
|
|
9
|
+
xarray_graph-0.2.3.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
xarray_graph-0.2.2.dist-info/METADATA,sha256=YnbvMx6HyGmM7juG94B0Gad3GQnBs0ecGrBdCkAmRsE,1488
|
|
2
|
-
xarray_graph-0.2.2.dist-info/WHEEL,sha256=vnE8JVcI2Wz7GRKorsPArnBdnW2SWKWGow5gu5tHlRU,90
|
|
3
|
-
xarray_graph-0.2.2.dist-info/entry_points.txt,sha256=aW9CKuCZREtN_3Mtg4dKrysPMmHc-tQdUCNmzQYE_vA,61
|
|
4
|
-
xarray_graph-0.2.2.dist-info/licenses/LICENSE,sha256=OE7VkhwkLeFeY8LXi86O-nMXC9B3WsBSILLfPmYGd-8,1077
|
|
5
|
-
xarray_graph/XarrayGraph.py,sha256=nYBqXwW92Jjsb7g4M1zq7ROttf--Pe4rGAOHrx7NT_E,100555
|
|
6
|
-
xarray_graph/__init__.py,sha256=1aAM-Fcno60-ou3AnSqt5HKm6UmZrtULGzg2LF34IJE,48
|
|
7
|
-
xarray_graph/__main__.py,sha256=8c74k8lpaqOuMeKlcBahOKfgo08O7xmJs_htvKKKpck,2274
|
|
8
|
-
xarray_graph/tmp/RegionsManager.py,sha256=0nnrO1e1mqvrs88doO51SJ3JvMNW5wXBKOp2nLQcUFs,1841
|
|
9
|
-
xarray_graph-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|