xarray-graph 0.2.0__tar.gz → 0.2.1__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.
- {xarray_graph-0.2.0 → xarray_graph-0.2.1}/PKG-INFO +9 -4
- {xarray_graph-0.2.0 → xarray_graph-0.2.1}/README.md +5 -0
- {xarray_graph-0.2.0 → xarray_graph-0.2.1}/pyproject.toml +5 -5
- {xarray_graph-0.2.0 → xarray_graph-0.2.1}/src/xarray_graph/XarrayGraph.py +11 -0
- xarray_graph-0.2.1/src/xarray_graph/__main__.py +76 -0
- xarray_graph-0.2.0/src/xarray_graph/__main__.py +0 -14
- {xarray_graph-0.2.0 → xarray_graph-0.2.1}/LICENSE +0 -0
- {xarray_graph-0.2.0 → xarray_graph-0.2.1}/src/xarray_graph/__init__.py +0 -0
- {xarray_graph-0.2.0/src/xarray_graph → xarray_graph-0.2.1/src/xarray_graph/tmp}/RegionsManager.py +0 -0
- {xarray_graph-0.2.0 → xarray_graph-0.2.1}/tests/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xarray-graph
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: PyQt/PySide UI for graphing (x,y) slices of Xarray datasets.
|
|
5
5
|
Keywords: PyQt,PySide,xarray,graph
|
|
6
6
|
Home-page: https://github.com/marcel-goldschen-ohm/xarray-graph
|
|
@@ -20,11 +20,11 @@ Project-URL: Repository, https://github.com/marcel-goldschen-ohm/xarray-graph
|
|
|
20
20
|
Requires-Python: >=3.9
|
|
21
21
|
Requires-Dist: numpy>=1.26.2
|
|
22
22
|
Requires-Dist: xarray>=2023.12.0
|
|
23
|
-
Requires-Dist: xarray-tree>=0.1.0
|
|
24
23
|
Requires-Dist: qtpy>=2.4.1
|
|
25
24
|
Requires-Dist: qtawesome>=1.3.0
|
|
26
|
-
Requires-Dist: pyqt-ext>=1.
|
|
27
|
-
Requires-Dist: pyqtgraph-ext>=1.
|
|
25
|
+
Requires-Dist: pyqt-ext>=1.2.0
|
|
26
|
+
Requires-Dist: pyqtgraph-ext>=1.2.0
|
|
27
|
+
Requires-Dist: xarray-treeview>=1.2.0
|
|
28
28
|
Requires-Dist: scipy>=1.11.4
|
|
29
29
|
Requires-Dist: lmfit>=1.2.2
|
|
30
30
|
Description-Content-Type: text/markdown
|
|
@@ -38,6 +38,11 @@ Should work with PySide6, PyQt6, or PyQt5.
|
|
|
38
38
|
pip install PySide6 xarray-graph
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
# Run
|
|
42
|
+
```shell
|
|
43
|
+
xarray-graph
|
|
44
|
+
```
|
|
45
|
+
|
|
41
46
|
# TODO
|
|
42
47
|
- i/o
|
|
43
48
|
- tests
|
|
@@ -9,11 +9,11 @@ requires-python = ">=3.9"
|
|
|
9
9
|
dependencies = [
|
|
10
10
|
"numpy>=1.26.2",
|
|
11
11
|
"xarray>=2023.12.0",
|
|
12
|
-
"xarray-tree>=0.1.0",
|
|
13
12
|
"qtpy>=2.4.1",
|
|
14
13
|
"qtawesome>=1.3.0",
|
|
15
|
-
"pyqt-ext>=1.
|
|
16
|
-
"pyqtgraph-ext>=1.
|
|
14
|
+
"pyqt-ext>=1.2.0",
|
|
15
|
+
"pyqtgraph-ext>=1.2.0",
|
|
16
|
+
"xarray-treeview>=1.2.0",
|
|
17
17
|
"scipy>=1.11.4",
|
|
18
18
|
"lmfit>=1.2.2",
|
|
19
19
|
]
|
|
@@ -35,7 +35,7 @@ classifiers = [
|
|
|
35
35
|
"Programming Language :: Python :: 3.12",
|
|
36
36
|
"Programming Language :: Python :: 3.13",
|
|
37
37
|
]
|
|
38
|
-
version = "0.2.
|
|
38
|
+
version = "0.2.1"
|
|
39
39
|
|
|
40
40
|
[project.license]
|
|
41
41
|
text = "MIT"
|
|
@@ -45,7 +45,7 @@ homepage = "https://github.com/marcel-goldschen-ohm/xarray-graph"
|
|
|
45
45
|
repository = "https://github.com/marcel-goldschen-ohm/xarray-graph"
|
|
46
46
|
|
|
47
47
|
[project.scripts]
|
|
48
|
-
|
|
48
|
+
xarray-graph = "xarray_graph.__main__:main"
|
|
49
49
|
|
|
50
50
|
[build-system]
|
|
51
51
|
requires = [
|
|
@@ -1034,6 +1034,17 @@ class XarrayGraph(QMainWindow):
|
|
|
1034
1034
|
if i != index:
|
|
1035
1035
|
button.setChecked(False)
|
|
1036
1036
|
|
|
1037
|
+
def _show_control_panel_at(self, index: int) -> None:
|
|
1038
|
+
actions = self._control_panel_toolbar.actions()
|
|
1039
|
+
widgets = [self._control_panel_toolbar.widgetForAction(action) for action in actions]
|
|
1040
|
+
buttons = [widget for widget in widgets if isinstance(widget, QToolButton)]
|
|
1041
|
+
buttons[index].setChecked(True)
|
|
1042
|
+
self._control_panel.setCurrentIndex(index)
|
|
1043
|
+
self._control_panel.setVisible(True)
|
|
1044
|
+
for i, button in enumerate(buttons):
|
|
1045
|
+
if i != index:
|
|
1046
|
+
button.setChecked(False)
|
|
1047
|
+
|
|
1037
1048
|
def _setup_data_control_panel(self) -> None:
|
|
1038
1049
|
button = QToolButton()
|
|
1039
1050
|
button.setIcon(qta.icon('ph.eye', options=[{'opacity': 0.5}]))
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
from xarray_graph.XarrayGraph import XarrayGraph
|
|
2
|
+
from qtpy.QtCore import QTimer
|
|
3
|
+
from qtpy.QtWidgets import QApplication
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main():
|
|
7
|
+
app = QApplication()
|
|
8
|
+
ui = XarrayGraph()
|
|
9
|
+
# ui.setWindowTitle(ui.__class__.__name__)
|
|
10
|
+
ui.setWindowTitle('xarray-graph')
|
|
11
|
+
ui.show()
|
|
12
|
+
QTimer.singleShot(100, lambda: ask_for_example(ui))
|
|
13
|
+
app.exec()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def ask_for_example(ui: XarrayGraph):
|
|
17
|
+
from qtpy.QtWidgets import QMessageBox
|
|
18
|
+
|
|
19
|
+
example = QMessageBox.question(ui, 'Example?', 'Load example data?')
|
|
20
|
+
if example == QMessageBox.StandardButton.Yes:
|
|
21
|
+
load_example(ui)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def load_example(ui: XarrayGraph):
|
|
25
|
+
import numpy as np
|
|
26
|
+
import xarray as xr
|
|
27
|
+
from datatree import DataTree
|
|
28
|
+
|
|
29
|
+
n = 100
|
|
30
|
+
raw_ds = xr.Dataset(
|
|
31
|
+
data_vars={
|
|
32
|
+
'current': (['series', 'sweep', 'time'], np.random.rand(3, 10, n) * 1e-9, {'units': 'A'}),
|
|
33
|
+
'voltage': (['series', 'sweep', 'time'], np.random.rand(3, 10, n) * 10000, {'units': 'V'}),
|
|
34
|
+
},
|
|
35
|
+
coords={
|
|
36
|
+
'series': ('series', np.arange(3)),
|
|
37
|
+
'sweep': ('sweep', np.arange(10)),
|
|
38
|
+
'time': ('time', np.arange(n) * 0.01, {'units': 's'}),
|
|
39
|
+
},
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
baselined_ds = xr.Dataset(
|
|
43
|
+
data_vars={
|
|
44
|
+
'current': (['series', 'sweep', 'time'], np.random.rand(3, 10, n) * 1e-9, {'units': 'A'}),
|
|
45
|
+
},
|
|
46
|
+
coords={
|
|
47
|
+
'series': ('series', np.arange(3)),
|
|
48
|
+
'sweep': ('sweep', np.arange(10)),
|
|
49
|
+
'time': ('time', np.arange(n) * 0.01, {'units': 's'}),
|
|
50
|
+
},
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
scaled_ds = xr.Dataset(
|
|
54
|
+
data_vars={
|
|
55
|
+
'current': (['series', 'sweep', 'time'], np.random.rand(1, 2, n) * 1e-9, {'units': 'A'}),
|
|
56
|
+
},
|
|
57
|
+
coords={
|
|
58
|
+
'series': ('series', [1]),
|
|
59
|
+
'sweep': ('sweep', [5,8]),
|
|
60
|
+
'time': ('time', np.arange(n) * 0.01, {'units': 's'}),
|
|
61
|
+
},
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
root_node = DataTree()
|
|
65
|
+
raw_node = DataTree(name='raw', data=raw_ds, parent=root_node)
|
|
66
|
+
baselined_node = DataTree(name='baselined', data=baselined_ds, parent=raw_node)
|
|
67
|
+
scaled_node = DataTree(name='scaled', data=scaled_ds, parent=baselined_node)
|
|
68
|
+
|
|
69
|
+
ui.data = root_node
|
|
70
|
+
|
|
71
|
+
ui._show_control_panel_at(0)
|
|
72
|
+
ui._data_treeview.expandAll()
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
if __name__ == '__main__':
|
|
76
|
+
main()
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
from xarray_graph.XarrayGraph import XarrayGraph
|
|
2
|
-
from qtpy.QtWidgets import QApplication
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def main():
|
|
6
|
-
app = QApplication()
|
|
7
|
-
ui = XarrayGraph()
|
|
8
|
-
ui.setWindowTitle(ui.__class__.__name__)
|
|
9
|
-
ui.show()
|
|
10
|
-
app.exec()
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if __name__ == '__main__':
|
|
14
|
-
main()
|
|
File without changes
|
|
File without changes
|
{xarray_graph-0.2.0/src/xarray_graph → xarray_graph-0.2.1/src/xarray_graph/tmp}/RegionsManager.py
RENAMED
|
File without changes
|
|
File without changes
|