discopop-gui 0.0.1a1__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.
- discopop_gui-0.0.1a1/LICENSE +29 -0
- discopop_gui-0.0.1a1/PKG-INFO +73 -0
- discopop_gui-0.0.1a1/README.md +18 -0
- discopop_gui-0.0.1a1/VERSION +1 -0
- discopop_gui-0.0.1a1/discopop_gui/Exceptions/VisualizerNotDefined.py +11 -0
- discopop_gui-0.0.1a1/discopop_gui/Exceptions/__init__.py +0 -0
- discopop_gui-0.0.1a1/discopop_gui/Extendables/Plottable.py +128 -0
- discopop_gui-0.0.1a1/discopop_gui/Extendables/__init__.py +0 -0
- discopop_gui-0.0.1a1/discopop_gui/Objects/Frames/MultiFrame.py +22 -0
- discopop_gui-0.0.1a1/discopop_gui/Objects/Frames/__init__.py +0 -0
- discopop_gui-0.0.1a1/discopop_gui/Objects/__init__.py +0 -0
- discopop_gui-0.0.1a1/discopop_gui/Types/FrameT.py +12 -0
- discopop_gui-0.0.1a1/discopop_gui/Types/__init__.py +0 -0
- discopop_gui-0.0.1a1/discopop_gui/Visualizers/Base.py +73 -0
- discopop_gui-0.0.1a1/discopop_gui/Visualizers/WithSidebar.py +146 -0
- discopop_gui-0.0.1a1/discopop_gui/Visualizers/__init__.py +0 -0
- discopop_gui-0.0.1a1/discopop_gui/__init__.py +0 -0
- discopop_gui-0.0.1a1/discopop_gui.egg-info/PKG-INFO +73 -0
- discopop_gui-0.0.1a1/discopop_gui.egg-info/SOURCES.txt +23 -0
- discopop_gui-0.0.1a1/discopop_gui.egg-info/dependency_links.txt +1 -0
- discopop_gui-0.0.1a1/discopop_gui.egg-info/requires.txt +10 -0
- discopop_gui-0.0.1a1/discopop_gui.egg-info/top_level.txt +1 -0
- discopop_gui-0.0.1a1/discopop_gui.egg-info/zip-safe +1 -0
- discopop_gui-0.0.1a1/pyproject.toml +50 -0
- discopop_gui-0.0.1a1/setup.cfg +4 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Copyright © 2015-2020 Technische Universitaet Darmstadt, Darmstadt, Germany
|
|
2
|
+
Copyright © 2018-2020 Iowa State University, Ames, USA
|
|
3
|
+
Copyright © 2012-2015 German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the names of the copyright holders nor the names of their
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: discopop-gui
|
|
3
|
+
Version: 0.0.1a1
|
|
4
|
+
Summary: DiscoPoP GUI: graphical user interface components for the DiscoPoP parallelization framework.
|
|
5
|
+
Author-email: TU Darmstadt and Iowa State University <discopop@lists.parallel.informatik.tu-darmstadt.de>
|
|
6
|
+
License: Copyright © 2015-2020 Technische Universitaet Darmstadt, Darmstadt, Germany
|
|
7
|
+
Copyright © 2018-2020 Iowa State University, Ames, USA
|
|
8
|
+
Copyright © 2012-2015 German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
|
|
9
|
+
All rights reserved.
|
|
10
|
+
|
|
11
|
+
Redistribution and use in source and binary forms, with or without
|
|
12
|
+
modification, are permitted provided that the following conditions are met:
|
|
13
|
+
|
|
14
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
15
|
+
list of conditions and the following disclaimer.
|
|
16
|
+
|
|
17
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
18
|
+
this list of conditions and the following disclaimer in the documentation
|
|
19
|
+
and/or other materials provided with the distribution.
|
|
20
|
+
|
|
21
|
+
3. Neither the names of the copyright holders nor the names of their
|
|
22
|
+
contributors may be used to endorse or promote products derived from
|
|
23
|
+
this software without specific prior written permission.
|
|
24
|
+
|
|
25
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
26
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
27
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
28
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
29
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
30
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
31
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
32
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
33
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
34
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35
|
+
|
|
36
|
+
Project-URL: Homepage, https://www.discopop.tu-darmstadt.de/
|
|
37
|
+
Classifier: Development Status :: 4 - Beta
|
|
38
|
+
Classifier: Environment :: X11 Applications
|
|
39
|
+
Classifier: Intended Audience :: Developers
|
|
40
|
+
Classifier: Operating System :: OS Independent
|
|
41
|
+
Classifier: Programming Language :: Python :: 3
|
|
42
|
+
Classifier: Topic :: Software Development
|
|
43
|
+
Requires-Python: >=3.6
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
License-File: LICENSE
|
|
46
|
+
Requires-Dist: matplotlib
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: mypy; extra == "dev"
|
|
49
|
+
Requires-Dist: black; extra == "dev"
|
|
50
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
51
|
+
Provides-Extra: ci
|
|
52
|
+
Requires-Dist: mypy; extra == "ci"
|
|
53
|
+
Requires-Dist: black; extra == "ci"
|
|
54
|
+
Dynamic: license-file
|
|
55
|
+
|
|
56
|
+
<!--
|
|
57
|
+
/*
|
|
58
|
+
* This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
|
|
59
|
+
*
|
|
60
|
+
* Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
|
|
61
|
+
*
|
|
62
|
+
* This software may be modified and distributed under the terms of
|
|
63
|
+
* the 3-Clause BSD License. See the LICENSE file in the package base
|
|
64
|
+
* directory for details.
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
-->
|
|
68
|
+
|
|
69
|
+
# DiscoPoP GUI
|
|
70
|
+
TODO add description here!
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
© DiscoPoP is available under the terms of the BSD-3-Clause license, as specified in the LICENSE file.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
/*
|
|
3
|
+
* This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
|
|
6
|
+
*
|
|
7
|
+
* This software may be modified and distributed under the terms of
|
|
8
|
+
* the 3-Clause BSD License. See the LICENSE file in the package base
|
|
9
|
+
* directory for details.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
-->
|
|
13
|
+
|
|
14
|
+
# DiscoPoP GUI
|
|
15
|
+
TODO add description here!
|
|
16
|
+
|
|
17
|
+
## License
|
|
18
|
+
© DiscoPoP is available under the terms of the BSD-3-Clause license, as specified in the LICENSE file.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.0.1a1
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
|
|
4
|
+
#
|
|
5
|
+
# This software may be modified and distributed under the terms of
|
|
6
|
+
# the 3-Clause BSD License. See the LICENSE file in the package base
|
|
7
|
+
# directory for details.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class VisualizerNotDefined(Exception):
|
|
11
|
+
pass
|
|
File without changes
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
|
|
4
|
+
#
|
|
5
|
+
# This software may be modified and distributed under the terms of
|
|
6
|
+
# the 3-Clause BSD License. See the LICENSE file in the package base
|
|
7
|
+
# directory for details.
|
|
8
|
+
|
|
9
|
+
from typing import Callable
|
|
10
|
+
import tkinter as tk
|
|
11
|
+
from matplotlib.axes import Axes
|
|
12
|
+
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk # type: ignore
|
|
13
|
+
from matplotlib.figure import Figure
|
|
14
|
+
from discopop_gui.Visualizers.Base import Base
|
|
15
|
+
from discopop_gui.Objects.Frames.MultiFrame import MultiFrame
|
|
16
|
+
from discopop_gui.Exceptions.VisualizerNotDefined import VisualizerNotDefined
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Plottable:
|
|
20
|
+
def __init__(self, visualizer: Base | None = None) -> None:
|
|
21
|
+
self._visualizer = visualizer
|
|
22
|
+
|
|
23
|
+
def plottable(self) -> bool:
|
|
24
|
+
if self._visualizer == None:
|
|
25
|
+
return False
|
|
26
|
+
|
|
27
|
+
return True
|
|
28
|
+
|
|
29
|
+
def create_frame(self, name: str) -> tk.Frame:
|
|
30
|
+
if self._visualizer is None:
|
|
31
|
+
raise VisualizerNotDefined()
|
|
32
|
+
|
|
33
|
+
return self._visualizer.create_frame(name, tk.Frame)
|
|
34
|
+
|
|
35
|
+
def create_multi_frame(self, name: str, rows: int, columns: int) -> MultiFrame:
|
|
36
|
+
if self._visualizer is None:
|
|
37
|
+
raise VisualizerNotDefined()
|
|
38
|
+
|
|
39
|
+
if rows < 1 or columns < 1:
|
|
40
|
+
raise ValueError("Rows and columns must be >= 1")
|
|
41
|
+
|
|
42
|
+
frame: MultiFrame = self._visualizer.create_frame(name, MultiFrame)
|
|
43
|
+
|
|
44
|
+
for row in range(rows):
|
|
45
|
+
frame.grid_rowconfigure(row, weight=1)
|
|
46
|
+
|
|
47
|
+
for column in range(columns):
|
|
48
|
+
frame.grid_columnconfigure(column, weight=1)
|
|
49
|
+
|
|
50
|
+
inner_frames = []
|
|
51
|
+
|
|
52
|
+
for i in range(rows * columns):
|
|
53
|
+
row = i // columns
|
|
54
|
+
column = i % columns
|
|
55
|
+
|
|
56
|
+
inner_frame = tk.Frame(frame, borderwidth=1, relief="solid")
|
|
57
|
+
inner_frame.grid(row=row, column=column, sticky="nsew", padx=5, pady=5)
|
|
58
|
+
inner_frames.append(inner_frame)
|
|
59
|
+
|
|
60
|
+
frame.initialize(inner_frames)
|
|
61
|
+
return frame
|
|
62
|
+
|
|
63
|
+
def get_from_multi_frame(self, name: str, index: int) -> tk.Frame:
|
|
64
|
+
if self._visualizer is None:
|
|
65
|
+
raise VisualizerNotDefined()
|
|
66
|
+
|
|
67
|
+
frame = self._visualizer.get_frame(name)
|
|
68
|
+
|
|
69
|
+
if isinstance(frame, MultiFrame):
|
|
70
|
+
return frame.get_from_inner(index)
|
|
71
|
+
else:
|
|
72
|
+
raise KeyError(f"No multi frame named '{name}'.")
|
|
73
|
+
|
|
74
|
+
def set_filter_callback(self, callback: Callable[[str], None]) -> None:
|
|
75
|
+
if self._visualizer is None:
|
|
76
|
+
raise VisualizerNotDefined()
|
|
77
|
+
|
|
78
|
+
self._visualizer.set_filter_callback(callback)
|
|
79
|
+
|
|
80
|
+
def delete_frame(self, name: str) -> None:
|
|
81
|
+
if self._visualizer is None:
|
|
82
|
+
raise VisualizerNotDefined()
|
|
83
|
+
|
|
84
|
+
self._visualizer.delete_frame(name)
|
|
85
|
+
|
|
86
|
+
def create_plot(self, name: str) -> Axes:
|
|
87
|
+
if self._visualizer is None:
|
|
88
|
+
raise VisualizerNotDefined()
|
|
89
|
+
|
|
90
|
+
frame: tk.Frame = self._visualizer.create_frame(name, tk.Frame)
|
|
91
|
+
figure = Figure()
|
|
92
|
+
axes = figure.add_subplot(111)
|
|
93
|
+
axes.set_title("Task graph")
|
|
94
|
+
canvas = FigureCanvasTkAgg(figure, master=frame)
|
|
95
|
+
canvas.draw()
|
|
96
|
+
canvas.get_tk_widget().grid(row=0, sticky="nsew")
|
|
97
|
+
toolbar = NavigationToolbar2Tk(canvas, pack_toolbar=False)
|
|
98
|
+
toolbar.update()
|
|
99
|
+
toolbar.grid(row=1)
|
|
100
|
+
frame.grid_rowconfigure(0, weight=1)
|
|
101
|
+
frame.grid_columnconfigure(0, weight=1)
|
|
102
|
+
|
|
103
|
+
return axes
|
|
104
|
+
|
|
105
|
+
def create_multi_plot(self, name: str, inner_plot_titles: list[str], rows: int, columns: int) -> list[Axes]:
|
|
106
|
+
self.create_multi_frame(name, rows, columns)
|
|
107
|
+
axeses = []
|
|
108
|
+
|
|
109
|
+
for index in range(rows * columns):
|
|
110
|
+
frame = self.get_from_multi_frame(name, index)
|
|
111
|
+
figure = Figure()
|
|
112
|
+
axes = figure.add_subplot(111)
|
|
113
|
+
axes.set_title(inner_plot_titles[index])
|
|
114
|
+
canvas = FigureCanvasTkAgg(figure, master=frame)
|
|
115
|
+
canvas.draw()
|
|
116
|
+
canvas.get_tk_widget().grid(row=0, sticky="nsew")
|
|
117
|
+
toolbar = NavigationToolbar2Tk(canvas, pack_toolbar=False)
|
|
118
|
+
toolbar.update()
|
|
119
|
+
toolbar.grid(row=1)
|
|
120
|
+
frame.grid_rowconfigure(0, weight=1)
|
|
121
|
+
frame.grid_columnconfigure(0, weight=1)
|
|
122
|
+
axeses.append(axes)
|
|
123
|
+
|
|
124
|
+
return axeses
|
|
125
|
+
|
|
126
|
+
def run_visualizer(self) -> None:
|
|
127
|
+
if self._visualizer is not None:
|
|
128
|
+
self._visualizer.run()
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
|
|
4
|
+
#
|
|
5
|
+
# This software may be modified and distributed under the terms of
|
|
6
|
+
# the 3-Clause BSD License. See the LICENSE file in the package base
|
|
7
|
+
# directory for details.
|
|
8
|
+
|
|
9
|
+
import tkinter as tk
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class MultiFrame(tk.Frame):
|
|
14
|
+
def __init__(self, parent: tk.Misc, *args: Any, **kwargs: Any) -> None:
|
|
15
|
+
super().__init__(parent, *args, **kwargs)
|
|
16
|
+
self._inner_frames: list[tk.Frame] = []
|
|
17
|
+
|
|
18
|
+
def initialize(self, inner_frames: list[tk.Frame]) -> None:
|
|
19
|
+
self._inner_frames = inner_frames
|
|
20
|
+
|
|
21
|
+
def get_from_inner(self, index: int) -> tk.Frame:
|
|
22
|
+
return self._inner_frames[index]
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
|
|
4
|
+
#
|
|
5
|
+
# This software may be modified and distributed under the terms of
|
|
6
|
+
# the 3-Clause BSD License. See the LICENSE file in the package base
|
|
7
|
+
# directory for details.
|
|
8
|
+
|
|
9
|
+
import tkinter as tk
|
|
10
|
+
from typing import TypeVar
|
|
11
|
+
|
|
12
|
+
FrameT = TypeVar("FrameT", bound=tk.Frame)
|
|
File without changes
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
|
|
4
|
+
#
|
|
5
|
+
# This software may be modified and distributed under the terms of
|
|
6
|
+
# the 3-Clause BSD License. See the LICENSE file in the package base
|
|
7
|
+
# directory for details.
|
|
8
|
+
|
|
9
|
+
from abc import abstractmethod, ABC
|
|
10
|
+
import tkinter as tk
|
|
11
|
+
from typing import Dict, Type, Callable
|
|
12
|
+
from discopop_gui.Types.FrameT import FrameT
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Base(ABC):
|
|
16
|
+
def __init__(self) -> None:
|
|
17
|
+
self._root = tk.Tk()
|
|
18
|
+
self._root.title("DiscoPoP")
|
|
19
|
+
self._root.protocol("WM_DELETE_WINDOW", self._on_close)
|
|
20
|
+
|
|
21
|
+
self._frames: Dict[str, tk.Frame] = {}
|
|
22
|
+
self._current_frame_name: str | None = None
|
|
23
|
+
|
|
24
|
+
def _on_close(self) -> None:
|
|
25
|
+
self._root.quit()
|
|
26
|
+
self._root.destroy()
|
|
27
|
+
|
|
28
|
+
@abstractmethod
|
|
29
|
+
def create_frame(self, name: str, frame_type: Type[FrameT]) -> FrameT:
|
|
30
|
+
pass
|
|
31
|
+
|
|
32
|
+
def get_frame(self, name: str) -> tk.Frame:
|
|
33
|
+
try:
|
|
34
|
+
return self._frames[name]
|
|
35
|
+
except KeyError as e:
|
|
36
|
+
raise KeyError(f"No frame named '{name}'.") from e
|
|
37
|
+
|
|
38
|
+
def show_frame(self, name: str) -> None:
|
|
39
|
+
frame = self.get_frame(name)
|
|
40
|
+
|
|
41
|
+
if frame == None:
|
|
42
|
+
raise KeyError(f"No frame named '{name}'.")
|
|
43
|
+
|
|
44
|
+
frame.tkraise()
|
|
45
|
+
self._current_frame_name = name
|
|
46
|
+
|
|
47
|
+
def delete_frame(self, name: str) -> None:
|
|
48
|
+
frame = self.get_frame(name)
|
|
49
|
+
|
|
50
|
+
if frame == None:
|
|
51
|
+
raise KeyError(f"No frame named '{name}'.")
|
|
52
|
+
|
|
53
|
+
frame.destroy()
|
|
54
|
+
|
|
55
|
+
del self._frames[name]
|
|
56
|
+
|
|
57
|
+
if self._current_frame_name == name:
|
|
58
|
+
self._current_frame_name = None
|
|
59
|
+
|
|
60
|
+
if self._frames:
|
|
61
|
+
first_name = next(iter(self._frames))
|
|
62
|
+
self.show_frame(first_name)
|
|
63
|
+
|
|
64
|
+
@abstractmethod
|
|
65
|
+
def set_filter_callback(self, callback: Callable[[str], None]) -> None:
|
|
66
|
+
pass
|
|
67
|
+
|
|
68
|
+
@abstractmethod
|
|
69
|
+
def set_filter_text(self, text: str) -> None:
|
|
70
|
+
pass
|
|
71
|
+
|
|
72
|
+
def run(self) -> None:
|
|
73
|
+
self._root.mainloop()
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
|
|
4
|
+
#
|
|
5
|
+
# This software may be modified and distributed under the terms of
|
|
6
|
+
# the 3-Clause BSD License. See the LICENSE file in the package base
|
|
7
|
+
# directory for details.
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import tkinter as tk
|
|
12
|
+
from typing import Dict, Type, Callable
|
|
13
|
+
from discopop_gui.Visualizers.Base import Base
|
|
14
|
+
from discopop_gui.Types.FrameT import FrameT
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class WithSidebar(Base):
|
|
18
|
+
def __init__(self) -> None:
|
|
19
|
+
super().__init__()
|
|
20
|
+
|
|
21
|
+
self._root.grid_rowconfigure(0, weight=1)
|
|
22
|
+
self._root.grid_columnconfigure(0, weight=1)
|
|
23
|
+
|
|
24
|
+
# Draggable split: sidebar | content | filter
|
|
25
|
+
self._pane = tk.PanedWindow(
|
|
26
|
+
self._root, orient=tk.HORIZONTAL, sashrelief=tk.RAISED, opaqueresize=False, bg="black"
|
|
27
|
+
)
|
|
28
|
+
self._pane.grid(row=0, column=0, sticky="nsew")
|
|
29
|
+
|
|
30
|
+
# Sidebar
|
|
31
|
+
self._sidebar_container = tk.Frame(self._pane)
|
|
32
|
+
self._sidebar_container.grid_rowconfigure(0, weight=1)
|
|
33
|
+
self._sidebar_container.grid_columnconfigure(0, weight=1)
|
|
34
|
+
|
|
35
|
+
self._sidebar_canvas = tk.Canvas(self._sidebar_container, highlightthickness=0, width=220)
|
|
36
|
+
|
|
37
|
+
self._sidebar_scrollbar = tk.Scrollbar(
|
|
38
|
+
self._sidebar_container, orient="vertical", command=self._sidebar_canvas.yview
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
self._sidebar_canvas.grid(row=0, column=0, sticky="nsew")
|
|
42
|
+
self._sidebar_scrollbar.grid(row=0, column=1, sticky="ns")
|
|
43
|
+
|
|
44
|
+
self._sidebar = tk.Frame(self._sidebar_canvas)
|
|
45
|
+
self._sidebar.grid_columnconfigure(0, weight=1)
|
|
46
|
+
|
|
47
|
+
self._sidebar_window = self._sidebar_canvas.create_window((0, 0), window=self._sidebar, anchor="nw")
|
|
48
|
+
|
|
49
|
+
self._sidebar_canvas.configure(yscrollcommand=self._sidebar_scrollbar.set)
|
|
50
|
+
|
|
51
|
+
self._sidebar.bind("<Configure>", self._on_sidebar_configure)
|
|
52
|
+
self._sidebar_canvas.bind("<Configure>", self._on_canvas_configure)
|
|
53
|
+
|
|
54
|
+
# Content area
|
|
55
|
+
self._frame_container = tk.Frame(self._pane)
|
|
56
|
+
self._frame_container.grid_rowconfigure(0, weight=1)
|
|
57
|
+
self._frame_container.grid_columnconfigure(0, weight=1)
|
|
58
|
+
|
|
59
|
+
# Filter area
|
|
60
|
+
self._filter_container = tk.Frame(self._pane)
|
|
61
|
+
self._filter_container.grid_rowconfigure(0, weight=1)
|
|
62
|
+
self._filter_container.grid_columnconfigure(0, weight=1)
|
|
63
|
+
|
|
64
|
+
self._filter_scrollbar = tk.Scrollbar(self._filter_container, orient="vertical")
|
|
65
|
+
|
|
66
|
+
self._filter = tk.Text(self._filter_container, wrap="word", yscrollcommand=self._filter_scrollbar.set, width=30)
|
|
67
|
+
|
|
68
|
+
self._filter_scrollbar.config(command=self._filter.yview)
|
|
69
|
+
self._filter.grid(row=0, column=0, sticky="nsew", padx=5, pady=(5, 2))
|
|
70
|
+
self._filter_scrollbar.grid(row=0, column=1, sticky="ns", pady=(5, 2))
|
|
71
|
+
|
|
72
|
+
self._filter_button = tk.Button(
|
|
73
|
+
self._filter_container, text="Apply Filter", command=self._on_filter_button_click
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
self._filter_button.grid(row=1, column=0, columnspan=2, sticky="ew", padx=5, pady=(2, 5))
|
|
77
|
+
self._filter_callback: Callable[[str], None] | None = None
|
|
78
|
+
|
|
79
|
+
# Add all panes to the PanedWindow
|
|
80
|
+
self._pane.add(self._sidebar_container, minsize=150, width=220)
|
|
81
|
+
self._pane.add(self._frame_container, minsize=300)
|
|
82
|
+
self._pane.add(self._filter_container, minsize=180, width=250)
|
|
83
|
+
|
|
84
|
+
self._frame_selectors: Dict[str, tk.Button] = {}
|
|
85
|
+
|
|
86
|
+
def _on_sidebar_configure(self, _: tk.Event[tk.Widget]) -> None:
|
|
87
|
+
self._sidebar_canvas.configure(scrollregion=self._sidebar_canvas.bbox("all"))
|
|
88
|
+
|
|
89
|
+
def _on_canvas_configure(self, event: tk.Event[tk.Widget]) -> None:
|
|
90
|
+
self._sidebar_canvas.itemconfigure(self._sidebar_window, width=event.width)
|
|
91
|
+
|
|
92
|
+
def _rebuild_selector_layout(self) -> None:
|
|
93
|
+
for row_index, frame_name in enumerate(self._frame_selectors):
|
|
94
|
+
self._frame_selectors[frame_name].grid_configure(row=row_index)
|
|
95
|
+
|
|
96
|
+
def _on_filter_button_click(self) -> None:
|
|
97
|
+
if self._filter_callback is not None:
|
|
98
|
+
filter_text = self._filter.get("1.0", tk.END).rstrip()
|
|
99
|
+
self._filter_callback(filter_text)
|
|
100
|
+
|
|
101
|
+
def create_frame(self, name: str, frame_type: Type[FrameT]) -> FrameT:
|
|
102
|
+
if name in self._frames:
|
|
103
|
+
raise ValueError(f"Frame '{name}' already exists.")
|
|
104
|
+
|
|
105
|
+
frame = frame_type(self._frame_container)
|
|
106
|
+
self._frames[name] = frame
|
|
107
|
+
frame.grid(row=0, column=0, sticky="nsew")
|
|
108
|
+
|
|
109
|
+
def on_selector_click(frame_name: str = name) -> None:
|
|
110
|
+
self.show_frame(frame_name)
|
|
111
|
+
|
|
112
|
+
frame_selector = tk.Button(self._sidebar, text=name, command=on_selector_click)
|
|
113
|
+
|
|
114
|
+
self._frame_selectors[name] = frame_selector
|
|
115
|
+
|
|
116
|
+
frame_selector.grid(row=len(self._frame_selectors) - 1, column=0, sticky="ew", padx=5, pady=2)
|
|
117
|
+
|
|
118
|
+
if self._current_frame_name is None:
|
|
119
|
+
self.show_frame(name)
|
|
120
|
+
else:
|
|
121
|
+
self.show_frame(self._current_frame_name)
|
|
122
|
+
|
|
123
|
+
return frame
|
|
124
|
+
|
|
125
|
+
def get_frame_selector(self, name: str) -> tk.Button:
|
|
126
|
+
try:
|
|
127
|
+
return self._frame_selectors[name]
|
|
128
|
+
except KeyError as e:
|
|
129
|
+
raise KeyError(f"No selector button for frame '{name}'.") from e
|
|
130
|
+
|
|
131
|
+
def delete_frame(self, name: str) -> None:
|
|
132
|
+
super().delete_frame(name)
|
|
133
|
+
|
|
134
|
+
selector = self.get_frame_selector(name)
|
|
135
|
+
|
|
136
|
+
selector.destroy()
|
|
137
|
+
del self._frame_selectors[name]
|
|
138
|
+
|
|
139
|
+
self._rebuild_selector_layout()
|
|
140
|
+
|
|
141
|
+
def set_filter_callback(self, callback: Callable[[str], None]) -> None:
|
|
142
|
+
self._filter_callback = callback
|
|
143
|
+
|
|
144
|
+
def set_filter_text(self, text: str) -> None:
|
|
145
|
+
self._filter.delete("1.0", tk.END)
|
|
146
|
+
self._filter.insert("1.0", text)
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: discopop-gui
|
|
3
|
+
Version: 0.0.1a1
|
|
4
|
+
Summary: DiscoPoP GUI: graphical user interface components for the DiscoPoP parallelization framework.
|
|
5
|
+
Author-email: TU Darmstadt and Iowa State University <discopop@lists.parallel.informatik.tu-darmstadt.de>
|
|
6
|
+
License: Copyright © 2015-2020 Technische Universitaet Darmstadt, Darmstadt, Germany
|
|
7
|
+
Copyright © 2018-2020 Iowa State University, Ames, USA
|
|
8
|
+
Copyright © 2012-2015 German Research School for Simulation Sciences GmbH, Juelich/Aachen, Germany
|
|
9
|
+
All rights reserved.
|
|
10
|
+
|
|
11
|
+
Redistribution and use in source and binary forms, with or without
|
|
12
|
+
modification, are permitted provided that the following conditions are met:
|
|
13
|
+
|
|
14
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
15
|
+
list of conditions and the following disclaimer.
|
|
16
|
+
|
|
17
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
18
|
+
this list of conditions and the following disclaimer in the documentation
|
|
19
|
+
and/or other materials provided with the distribution.
|
|
20
|
+
|
|
21
|
+
3. Neither the names of the copyright holders nor the names of their
|
|
22
|
+
contributors may be used to endorse or promote products derived from
|
|
23
|
+
this software without specific prior written permission.
|
|
24
|
+
|
|
25
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
26
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
27
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
28
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
29
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
30
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
31
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
32
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
33
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
34
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35
|
+
|
|
36
|
+
Project-URL: Homepage, https://www.discopop.tu-darmstadt.de/
|
|
37
|
+
Classifier: Development Status :: 4 - Beta
|
|
38
|
+
Classifier: Environment :: X11 Applications
|
|
39
|
+
Classifier: Intended Audience :: Developers
|
|
40
|
+
Classifier: Operating System :: OS Independent
|
|
41
|
+
Classifier: Programming Language :: Python :: 3
|
|
42
|
+
Classifier: Topic :: Software Development
|
|
43
|
+
Requires-Python: >=3.6
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
License-File: LICENSE
|
|
46
|
+
Requires-Dist: matplotlib
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: mypy; extra == "dev"
|
|
49
|
+
Requires-Dist: black; extra == "dev"
|
|
50
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
51
|
+
Provides-Extra: ci
|
|
52
|
+
Requires-Dist: mypy; extra == "ci"
|
|
53
|
+
Requires-Dist: black; extra == "ci"
|
|
54
|
+
Dynamic: license-file
|
|
55
|
+
|
|
56
|
+
<!--
|
|
57
|
+
/*
|
|
58
|
+
* This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
|
|
59
|
+
*
|
|
60
|
+
* Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
|
|
61
|
+
*
|
|
62
|
+
* This software may be modified and distributed under the terms of
|
|
63
|
+
* the 3-Clause BSD License. See the LICENSE file in the package base
|
|
64
|
+
* directory for details.
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
-->
|
|
68
|
+
|
|
69
|
+
# DiscoPoP GUI
|
|
70
|
+
TODO add description here!
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
© DiscoPoP is available under the terms of the BSD-3-Clause license, as specified in the LICENSE file.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
VERSION
|
|
4
|
+
pyproject.toml
|
|
5
|
+
discopop_gui/__init__.py
|
|
6
|
+
discopop_gui.egg-info/PKG-INFO
|
|
7
|
+
discopop_gui.egg-info/SOURCES.txt
|
|
8
|
+
discopop_gui.egg-info/dependency_links.txt
|
|
9
|
+
discopop_gui.egg-info/requires.txt
|
|
10
|
+
discopop_gui.egg-info/top_level.txt
|
|
11
|
+
discopop_gui.egg-info/zip-safe
|
|
12
|
+
discopop_gui/Exceptions/VisualizerNotDefined.py
|
|
13
|
+
discopop_gui/Exceptions/__init__.py
|
|
14
|
+
discopop_gui/Extendables/Plottable.py
|
|
15
|
+
discopop_gui/Extendables/__init__.py
|
|
16
|
+
discopop_gui/Objects/__init__.py
|
|
17
|
+
discopop_gui/Objects/Frames/MultiFrame.py
|
|
18
|
+
discopop_gui/Objects/Frames/__init__.py
|
|
19
|
+
discopop_gui/Types/FrameT.py
|
|
20
|
+
discopop_gui/Types/__init__.py
|
|
21
|
+
discopop_gui/Visualizers/Base.py
|
|
22
|
+
discopop_gui/Visualizers/WithSidebar.py
|
|
23
|
+
discopop_gui/Visualizers/__init__.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
discopop_gui
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
|
|
4
|
+
#
|
|
5
|
+
# This software may be modified and distributed under the terms of
|
|
6
|
+
# the 3-Clause BSD License. See the LICENSE file in the package base
|
|
7
|
+
# directory for details.
|
|
8
|
+
|
|
9
|
+
[build-system]
|
|
10
|
+
requires = ["setuptools>=61", "wheel"]
|
|
11
|
+
build-backend = "setuptools.build_meta"
|
|
12
|
+
|
|
13
|
+
[project]
|
|
14
|
+
name = "discopop-gui"
|
|
15
|
+
dynamic = ["version"]
|
|
16
|
+
description = "DiscoPoP GUI: graphical user interface components for the DiscoPoP parallelization framework."
|
|
17
|
+
readme = {file = "README.md", content-type = "text/markdown"}
|
|
18
|
+
license = {file = "LICENSE"}
|
|
19
|
+
authors = [
|
|
20
|
+
{name = "TU Darmstadt and Iowa State University", email = "discopop@lists.parallel.informatik.tu-darmstadt.de"},
|
|
21
|
+
]
|
|
22
|
+
requires-python = ">=3.6"
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Development Status :: 4 - Beta",
|
|
25
|
+
"Environment :: X11 Applications",
|
|
26
|
+
"Intended Audience :: Developers",
|
|
27
|
+
"Operating System :: OS Independent",
|
|
28
|
+
"Programming Language :: Python :: 3",
|
|
29
|
+
"Topic :: Software Development",
|
|
30
|
+
]
|
|
31
|
+
dependencies = [
|
|
32
|
+
"matplotlib",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
dev = ["mypy", "black", "pre-commit"]
|
|
37
|
+
ci = ["mypy", "black"]
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Homepage = "https://www.discopop.tu-darmstadt.de/"
|
|
41
|
+
|
|
42
|
+
[tool.setuptools.dynamic]
|
|
43
|
+
version = {file = "VERSION"}
|
|
44
|
+
|
|
45
|
+
[tool.setuptools.packages.find]
|
|
46
|
+
where = ["."]
|
|
47
|
+
include = ["discopop_gui*"]
|
|
48
|
+
|
|
49
|
+
[tool.setuptools]
|
|
50
|
+
zip-safe = true
|