discopop-gui 0.0.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.
- discopop_gui-0.0.1/LICENSE +29 -0
- discopop_gui-0.0.1/PKG-INFO +78 -0
- discopop_gui-0.0.1/README.md +22 -0
- discopop_gui-0.0.1/VERSION +1 -0
- discopop_gui-0.0.1/discopop_gui/ClassMaps/Frames.py +15 -0
- discopop_gui-0.0.1/discopop_gui/ClassMaps/ViewableCanvases.py +14 -0
- discopop_gui-0.0.1/discopop_gui/ClassMaps/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Constants.py +10 -0
- discopop_gui-0.0.1/discopop_gui/Enums/EdgeType.py +14 -0
- discopop_gui-0.0.1/discopop_gui/Enums/FrameType.py +15 -0
- discopop_gui-0.0.1/discopop_gui/Enums/ViewableCanvasTypes.py +14 -0
- discopop_gui-0.0.1/discopop_gui/Enums/ViewerMode.py +14 -0
- discopop_gui-0.0.1/discopop_gui/Enums/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Exceptions/VisualizerNotDefined.py +11 -0
- discopop_gui-0.0.1/discopop_gui/Exceptions/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Extendables/Plottable.py +150 -0
- discopop_gui-0.0.1/discopop_gui/Extendables/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Objects/CanvasItems/Popup.py +73 -0
- discopop_gui-0.0.1/discopop_gui/Objects/CanvasItems/TreeEdges/Base.py +30 -0
- discopop_gui-0.0.1/discopop_gui/Objects/CanvasItems/TreeEdges/Dependency.py +84 -0
- discopop_gui-0.0.1/discopop_gui/Objects/CanvasItems/TreeEdges/Main.py +30 -0
- discopop_gui-0.0.1/discopop_gui/Objects/CanvasItems/TreeEdges/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Objects/CanvasItems/TreeNode.py +945 -0
- discopop_gui-0.0.1/discopop_gui/Objects/CanvasItems/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Canvases/RoundedSquareButtons/Cross.py +45 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Canvases/RoundedSquareButtons/Magnifier.py +21 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Canvases/RoundedSquareButtons/Mouse.py +31 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Canvases/RoundedSquareButtons/Panner.py +29 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Canvases/RoundedSquareButtons/Plus.py +44 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Canvases/RoundedSquareButtons/RoundedSquareButton.py +69 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Canvases/RoundedSquareButtons/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Canvases/Viewables/Base.py +235 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Canvases/Viewables/WithTrees.py +311 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Canvases/Viewables/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Canvases/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Frames/Base.py +22 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Frames/CanvasViewerWithTrees.py +343 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Frames/MultiFrame.py +81 -0
- discopop_gui-0.0.1/discopop_gui/Objects/Frames/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Objects/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Types/FrameT.py +13 -0
- discopop_gui-0.0.1/discopop_gui/Types/T.py +11 -0
- discopop_gui-0.0.1/discopop_gui/Types/ViewableCanvasT.py +13 -0
- discopop_gui-0.0.1/discopop_gui/Types/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/Visualizers/Base.py +116 -0
- discopop_gui-0.0.1/discopop_gui/Visualizers/WithSidebar.py +212 -0
- discopop_gui-0.0.1/discopop_gui/Visualizers/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui/py.typed +0 -0
- discopop_gui-0.0.1/discopop_gui/utils/TreeNode.py +47 -0
- discopop_gui-0.0.1/discopop_gui/utils/__init__.py +0 -0
- discopop_gui-0.0.1/discopop_gui.egg-info/PKG-INFO +78 -0
- discopop_gui-0.0.1/discopop_gui.egg-info/SOURCES.txt +57 -0
- discopop_gui-0.0.1/discopop_gui.egg-info/dependency_links.txt +1 -0
- discopop_gui-0.0.1/discopop_gui.egg-info/requires.txt +11 -0
- discopop_gui-0.0.1/discopop_gui.egg-info/top_level.txt +1 -0
- discopop_gui-0.0.1/discopop_gui.egg-info/zip-safe +1 -0
- discopop_gui-0.0.1/pyproject.toml +54 -0
- discopop_gui-0.0.1/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,78 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: discopop-gui
|
|
3
|
+
Version: 0.0.1
|
|
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.11
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
License-File: LICENSE
|
|
46
|
+
Requires-Dist: matplotlib
|
|
47
|
+
Requires-Dist: networkx
|
|
48
|
+
Provides-Extra: dev
|
|
49
|
+
Requires-Dist: mypy; extra == "dev"
|
|
50
|
+
Requires-Dist: black; extra == "dev"
|
|
51
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
52
|
+
Provides-Extra: ci
|
|
53
|
+
Requires-Dist: mypy; extra == "ci"
|
|
54
|
+
Requires-Dist: black; extra == "ci"
|
|
55
|
+
Dynamic: license-file
|
|
56
|
+
|
|
57
|
+
<!--
|
|
58
|
+
/*
|
|
59
|
+
* This file is part of the DiscoPoP software (http://www.discopop.tu-darmstadt.de)
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) 2020, Technische Universitaet Darmstadt, Germany
|
|
62
|
+
*
|
|
63
|
+
* This software may be modified and distributed under the terms of
|
|
64
|
+
* the 3-Clause BSD License. See the LICENSE file in the package base
|
|
65
|
+
* directory for details.
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
-->
|
|
69
|
+
|
|
70
|
+
# DiscoPoP GUI
|
|
71
|
+
This package (`discopop-gui`) holds GUI components of DiscoPoP, for example graph visualizers based on matplotlib and networkx. It declares no console script.
|
|
72
|
+
|
|
73
|
+
The graphical user interface itself, started with `discopop_gui`, ships with `discopop-library` (`library/discopop_library/ProjectManager/gui`). `pip install discopop` installs both packages, as `discopop` depends on `discopop-gui` and `discopop-library`.
|
|
74
|
+
|
|
75
|
+
Documentation: [Graphical user interface](https://tuda-hpclab.github.io/discopop/tools/GUI/) and [Getting started](https://tuda-hpclab.github.io/discopop/getting_started/).
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
© DiscoPoP is available under the terms of the BSD-3-Clause license, as specified in the LICENSE file.
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
This package (`discopop-gui`) holds GUI components of DiscoPoP, for example graph visualizers based on matplotlib and networkx. It declares no console script.
|
|
16
|
+
|
|
17
|
+
The graphical user interface itself, started with `discopop_gui`, ships with `discopop-library` (`library/discopop_library/ProjectManager/gui`). `pip install discopop` installs both packages, as `discopop` depends on `discopop-gui` and `discopop-library`.
|
|
18
|
+
|
|
19
|
+
Documentation: [Graphical user interface](https://tuda-hpclab.github.io/discopop/tools/GUI/) and [Getting started](https://tuda-hpclab.github.io/discopop/getting_started/).
|
|
20
|
+
|
|
21
|
+
## License
|
|
22
|
+
© DiscoPoP is available under the terms of the BSD-3-Clause license, as specified in the LICENSE file.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.0.1
|
|
@@ -0,0 +1,15 @@
|
|
|
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 discopop_gui.Enums.FrameType import FrameType
|
|
10
|
+
|
|
11
|
+
FramesMap = {
|
|
12
|
+
"Base": FrameType.BASE,
|
|
13
|
+
"MultiFrame": FrameType.MULTI_FRAME,
|
|
14
|
+
"CanvasViewerWithTrees": FrameType.CANVAS_VIEWER_WITH_TREES,
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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 discopop_gui.Enums.ViewableCanvasTypes import ViewableCanvasTypes
|
|
10
|
+
|
|
11
|
+
ViewableCanvasesMap = {
|
|
12
|
+
"Base": ViewableCanvasTypes.BASE,
|
|
13
|
+
"WithTrees": ViewableCanvasTypes.WITH_TREES,
|
|
14
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
TREE_NODES_SPACING: float = 100
|
|
10
|
+
TREE_NODE_RADIUS: float = 40
|
|
@@ -0,0 +1,14 @@
|
|
|
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 enum import Enum, auto
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class EdgeType(Enum):
|
|
13
|
+
MAIN = auto()
|
|
14
|
+
DEPENDENCY = auto()
|
|
@@ -0,0 +1,15 @@
|
|
|
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 enum import Enum, auto
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FrameType(Enum):
|
|
13
|
+
BASE = auto()
|
|
14
|
+
MULTI_FRAME = auto()
|
|
15
|
+
CANVAS_VIEWER_WITH_TREES = auto()
|
|
@@ -0,0 +1,14 @@
|
|
|
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 enum import Enum, auto
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ViewableCanvasTypes(Enum):
|
|
13
|
+
BASE = auto()
|
|
14
|
+
WITH_TREES = auto()
|
|
@@ -0,0 +1,14 @@
|
|
|
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 enum import Enum, auto
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ViewerMode(Enum):
|
|
13
|
+
MAIN = auto()
|
|
14
|
+
ZOOM = auto()
|
|
File without changes
|
|
@@ -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,150 @@
|
|
|
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 Any, Callable, Dict, List
|
|
10
|
+
|
|
11
|
+
from matplotlib.axes import Axes
|
|
12
|
+
from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg, NavigationToolbar2QT # type: ignore
|
|
13
|
+
from matplotlib.figure import Figure
|
|
14
|
+
from PySide6.QtWidgets import QVBoxLayout, QWidget
|
|
15
|
+
|
|
16
|
+
from discopop_gui.Visualizers.Base import Base
|
|
17
|
+
from discopop_gui.Objects.Frames.Base import Base as BaseFrame
|
|
18
|
+
from discopop_gui.Objects.Frames.MultiFrame import MultiFrame
|
|
19
|
+
from discopop_gui.Objects.Frames.CanvasViewerWithTrees import CanvasViewerWithTrees
|
|
20
|
+
from discopop_gui.Exceptions.VisualizerNotDefined import VisualizerNotDefined
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Plottable:
|
|
24
|
+
def __init__(self, visualizer: Base | None = None) -> None:
|
|
25
|
+
self._visualizer = visualizer
|
|
26
|
+
|
|
27
|
+
def __getstate__(self) -> Dict[str, Any]:
|
|
28
|
+
# The visualizer holds Qt widgets it draws on; a pickled or dumped graph (detection_result_dump.json)
|
|
29
|
+
# must not carry them, the copy is not plottable.
|
|
30
|
+
state = self.__dict__.copy()
|
|
31
|
+
state["_visualizer"] = None
|
|
32
|
+
return state
|
|
33
|
+
|
|
34
|
+
def __setstate__(self, state: Dict[str, Any]) -> None:
|
|
35
|
+
self.__dict__.update(state)
|
|
36
|
+
self.__dict__.setdefault("_visualizer", None)
|
|
37
|
+
|
|
38
|
+
def plottable(self) -> bool:
|
|
39
|
+
if self._visualizer is None:
|
|
40
|
+
return False
|
|
41
|
+
|
|
42
|
+
return True
|
|
43
|
+
|
|
44
|
+
def create_frame(self, name: str) -> BaseFrame:
|
|
45
|
+
if self._visualizer is None:
|
|
46
|
+
raise VisualizerNotDefined()
|
|
47
|
+
|
|
48
|
+
return self._visualizer.create_frame(name, BaseFrame)
|
|
49
|
+
|
|
50
|
+
def create_multi_frame(self, name: str, rows: int, columns: int) -> MultiFrame:
|
|
51
|
+
if self._visualizer is None:
|
|
52
|
+
raise VisualizerNotDefined()
|
|
53
|
+
|
|
54
|
+
if rows < 1 or columns < 1:
|
|
55
|
+
raise ValueError("Rows and columns must be >= 1")
|
|
56
|
+
|
|
57
|
+
def frame_builder(parent: QWidget) -> MultiFrame:
|
|
58
|
+
return MultiFrame(parent)
|
|
59
|
+
|
|
60
|
+
frame = self._visualizer.create_frame(name, frame_builder)
|
|
61
|
+
|
|
62
|
+
for row in range(rows):
|
|
63
|
+
frame._layout.setRowStretch(row, 1)
|
|
64
|
+
|
|
65
|
+
for column in range(columns):
|
|
66
|
+
frame._layout.setColumnStretch(column, 1)
|
|
67
|
+
|
|
68
|
+
inner_frames: List[BaseFrame] = []
|
|
69
|
+
|
|
70
|
+
for i in range(rows * columns):
|
|
71
|
+
row = i // columns
|
|
72
|
+
column = i % columns
|
|
73
|
+
|
|
74
|
+
inner_frame = frame.create_frame(row, column, lambda parent: BaseFrame(parent))
|
|
75
|
+
inner_frames.append(inner_frame)
|
|
76
|
+
|
|
77
|
+
frame.initialize(inner_frames)
|
|
78
|
+
return frame
|
|
79
|
+
|
|
80
|
+
def set_filter_callback(self, callback: Callable[[str], None]) -> None:
|
|
81
|
+
if self._visualizer is None:
|
|
82
|
+
raise VisualizerNotDefined()
|
|
83
|
+
|
|
84
|
+
self._visualizer.set_filter_callback(callback)
|
|
85
|
+
|
|
86
|
+
def delete_frame(self, frame_id: int) -> None:
|
|
87
|
+
if self._visualizer is None:
|
|
88
|
+
raise VisualizerNotDefined()
|
|
89
|
+
|
|
90
|
+
self._visualizer.delete_frame(frame_id)
|
|
91
|
+
|
|
92
|
+
def create_plot(self, name: str) -> Axes:
|
|
93
|
+
if self._visualizer is None:
|
|
94
|
+
raise VisualizerNotDefined()
|
|
95
|
+
|
|
96
|
+
frame: BaseFrame = self._visualizer.create_frame(name, BaseFrame)
|
|
97
|
+
layout = QVBoxLayout(frame)
|
|
98
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
99
|
+
|
|
100
|
+
figure = Figure()
|
|
101
|
+
axes = figure.add_subplot(111)
|
|
102
|
+
axes.set_title("Task graph")
|
|
103
|
+
canvas = FigureCanvasQTAgg(figure)
|
|
104
|
+
canvas.draw()
|
|
105
|
+
toolbar = NavigationToolbar2QT(canvas, frame)
|
|
106
|
+
|
|
107
|
+
layout.addWidget(canvas, 1)
|
|
108
|
+
layout.addWidget(toolbar)
|
|
109
|
+
return axes
|
|
110
|
+
|
|
111
|
+
def create_plottable(self, name: str) -> CanvasViewerWithTrees:
|
|
112
|
+
if self._visualizer is None:
|
|
113
|
+
raise VisualizerNotDefined()
|
|
114
|
+
|
|
115
|
+
def frame_builder(parent: QWidget) -> CanvasViewerWithTrees:
|
|
116
|
+
return CanvasViewerWithTrees(parent)
|
|
117
|
+
|
|
118
|
+
frame = self._visualizer.create_frame(name, frame_builder)
|
|
119
|
+
|
|
120
|
+
return frame
|
|
121
|
+
|
|
122
|
+
def create_multi_plot(self, name: str, inner_plot_titles: list[str], rows: int, columns: int) -> list[Axes]:
|
|
123
|
+
frame = self.create_multi_frame(name, rows, columns)
|
|
124
|
+
axeses = []
|
|
125
|
+
|
|
126
|
+
for index in range(rows * columns):
|
|
127
|
+
inner_frame = frame.get_from_inner(index)
|
|
128
|
+
layout = QVBoxLayout(inner_frame)
|
|
129
|
+
layout.setContentsMargins(0, 0, 0, 0)
|
|
130
|
+
|
|
131
|
+
figure = Figure()
|
|
132
|
+
axes = figure.add_subplot(111)
|
|
133
|
+
axes.set_title(inner_plot_titles[index])
|
|
134
|
+
canvas = FigureCanvasQTAgg(figure)
|
|
135
|
+
canvas.draw()
|
|
136
|
+
toolbar = NavigationToolbar2QT(canvas, inner_frame)
|
|
137
|
+
|
|
138
|
+
layout.addWidget(canvas, 1)
|
|
139
|
+
layout.addWidget(toolbar)
|
|
140
|
+
axeses.append(axes)
|
|
141
|
+
|
|
142
|
+
return axeses
|
|
143
|
+
|
|
144
|
+
def run_visualizer(self) -> None:
|
|
145
|
+
if self._visualizer is not None:
|
|
146
|
+
self._visualizer.run()
|
|
147
|
+
|
|
148
|
+
def clear_visualizer(self) -> None:
|
|
149
|
+
if self._visualizer is not None:
|
|
150
|
+
self._visualizer.clear()
|
|
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 __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from typing import Callable
|
|
12
|
+
|
|
13
|
+
from PySide6.QtCore import QPoint
|
|
14
|
+
from PySide6.QtWidgets import QFrame, QPushButton, QVBoxLayout, QWidget
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Popup(QFrame):
|
|
18
|
+
def __init__(self, parent: QWidget, minimum_width: int = 150) -> None:
|
|
19
|
+
super().__init__(parent)
|
|
20
|
+
self._minimum_width = minimum_width
|
|
21
|
+
self._button_height = 30
|
|
22
|
+
self._buttons: dict[str, QPushButton] = {}
|
|
23
|
+
|
|
24
|
+
self.setFrameShape(QFrame.Shape.Box)
|
|
25
|
+
|
|
26
|
+
self.setStyleSheet(
|
|
27
|
+
"QFrame { background: #f2f2f2; border: 1px solid #999999; }"
|
|
28
|
+
"QPushButton { background: #ffffff; border: 0px; text-align: left; padding: 0 8px; }"
|
|
29
|
+
"QPushButton:hover { background: #cfe8ff; }"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
self._layout = QVBoxLayout(self)
|
|
33
|
+
self._layout.setContentsMargins(2, 2, 2, 2)
|
|
34
|
+
self._layout.setSpacing(0)
|
|
35
|
+
self.hide()
|
|
36
|
+
|
|
37
|
+
def _update_layout(self) -> None:
|
|
38
|
+
for button in self._buttons.values():
|
|
39
|
+
button.setFixedHeight(self._button_height)
|
|
40
|
+
|
|
41
|
+
self.setMinimumWidth(self._minimum_width)
|
|
42
|
+
self.adjustSize()
|
|
43
|
+
|
|
44
|
+
def add_button(self, button_id: str, callback: Callable[[], None]) -> None:
|
|
45
|
+
button = QPushButton(button_id, self)
|
|
46
|
+
|
|
47
|
+
def on_click() -> None:
|
|
48
|
+
if self.isVisible():
|
|
49
|
+
self.hide()
|
|
50
|
+
callback()
|
|
51
|
+
|
|
52
|
+
button.clicked.connect(on_click)
|
|
53
|
+
self._layout.addWidget(button)
|
|
54
|
+
self._buttons[button_id] = button
|
|
55
|
+
self._update_layout()
|
|
56
|
+
|
|
57
|
+
def remove_button(self, button_id: str) -> None:
|
|
58
|
+
button = self._buttons.pop(button_id, None)
|
|
59
|
+
|
|
60
|
+
if button is not None:
|
|
61
|
+
self._layout.removeWidget(button)
|
|
62
|
+
button.deleteLater()
|
|
63
|
+
self._update_layout()
|
|
64
|
+
|
|
65
|
+
def clear_buttons(self) -> None:
|
|
66
|
+
for button_id in list(self._buttons):
|
|
67
|
+
self.remove_button(button_id)
|
|
68
|
+
|
|
69
|
+
def show_at(self, position: QPoint) -> None:
|
|
70
|
+
self._update_layout()
|
|
71
|
+
self.move(position)
|
|
72
|
+
self.raise_()
|
|
73
|
+
self.show()
|
|
@@ -0,0 +1,30 @@
|
|
|
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 Generic, Callable, Dict, Any
|
|
10
|
+
|
|
11
|
+
from discopop_gui.Types.T import T
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Base(Generic[T]):
|
|
15
|
+
def __init__(self, source_node_id: T, target_node_id: T):
|
|
16
|
+
self._source_node_id = source_node_id
|
|
17
|
+
self._target_node_id = target_node_id
|
|
18
|
+
|
|
19
|
+
def get_source_node_id(self) -> T:
|
|
20
|
+
return self._source_node_id
|
|
21
|
+
|
|
22
|
+
def get_target_node_id(self) -> T:
|
|
23
|
+
return self._target_node_id
|
|
24
|
+
|
|
25
|
+
def serialize(self) -> Dict[str, Any]:
|
|
26
|
+
return {"source_node_id": str(self._source_node_id), "target_node_id": str(self._target_node_id)}
|
|
27
|
+
|
|
28
|
+
def deserialize(self, data: Dict[str, Any], converter: Callable[[str], T]) -> None:
|
|
29
|
+
self._source_node_id = converter(data["source_node_id"])
|
|
30
|
+
self._target_node_id = converter(data["target_node_id"])
|
|
@@ -0,0 +1,84 @@
|
|
|
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 collections import deque
|
|
10
|
+
from typing import Generic, Callable, Dict, Any
|
|
11
|
+
|
|
12
|
+
from discopop_gui.Types.T import T
|
|
13
|
+
from discopop_gui.Objects.CanvasItems.TreeEdges.Base import Base
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Dependency(Base[T], Generic[T]):
|
|
17
|
+
def __init__(self, source_node_id: T, target_node_id: T, highest_common_node_id: T | None = None):
|
|
18
|
+
super().__init__(source_node_id, target_node_id)
|
|
19
|
+
|
|
20
|
+
self._highest_common_node_id = highest_common_node_id
|
|
21
|
+
self._climbed_source_node_ids: deque[T] = deque()
|
|
22
|
+
self._climbed_target_node_ids: deque[T] = deque()
|
|
23
|
+
|
|
24
|
+
def get_highest_common_node_id(self) -> T | None:
|
|
25
|
+
return self._highest_common_node_id
|
|
26
|
+
|
|
27
|
+
def climb_source_node_id(self, node_id: T) -> bool:
|
|
28
|
+
if node_id == self._highest_common_node_id:
|
|
29
|
+
return False
|
|
30
|
+
|
|
31
|
+
self._climbed_source_node_ids.append(self._source_node_id)
|
|
32
|
+
self._source_node_id = node_id
|
|
33
|
+
return True
|
|
34
|
+
|
|
35
|
+
def climb_target_node_id(self, node_id: T) -> bool:
|
|
36
|
+
if node_id == self._highest_common_node_id:
|
|
37
|
+
return False
|
|
38
|
+
|
|
39
|
+
self._climbed_target_node_ids.append(self._target_node_id)
|
|
40
|
+
self._target_node_id = node_id
|
|
41
|
+
return True
|
|
42
|
+
|
|
43
|
+
def pop_climbed_source_node_id(self) -> T | None:
|
|
44
|
+
if not self._climbed_source_node_ids:
|
|
45
|
+
return None
|
|
46
|
+
|
|
47
|
+
self._source_node_id = self._climbed_source_node_ids.pop()
|
|
48
|
+
return self._source_node_id
|
|
49
|
+
|
|
50
|
+
def pop_climbed_target_node_id(self) -> T | None:
|
|
51
|
+
if not self._climbed_target_node_ids:
|
|
52
|
+
return None
|
|
53
|
+
|
|
54
|
+
self._target_node_id = self._climbed_target_node_ids.pop()
|
|
55
|
+
return self._target_node_id
|
|
56
|
+
|
|
57
|
+
def copy(self) -> "Dependency[T]":
|
|
58
|
+
dependency = Dependency(
|
|
59
|
+
self._source_node_id,
|
|
60
|
+
self._target_node_id,
|
|
61
|
+
self._highest_common_node_id,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
dependency._climbed_source_node_ids = self._climbed_source_node_ids.copy()
|
|
65
|
+
dependency._climbed_target_node_ids = self._climbed_target_node_ids.copy()
|
|
66
|
+
|
|
67
|
+
return dependency
|
|
68
|
+
|
|
69
|
+
def serialize(self) -> Dict[str, Any]:
|
|
70
|
+
output = super().serialize()
|
|
71
|
+
output["highest_common_node_id"] = (
|
|
72
|
+
str(self._highest_common_node_id) if self._highest_common_node_id is not None else None
|
|
73
|
+
)
|
|
74
|
+
output["climbed_source_node_ids"] = [str(node_id) for node_id in self._climbed_source_node_ids]
|
|
75
|
+
output["climbed_target_node_ids"] = [str(node_id) for node_id in self._climbed_target_node_ids]
|
|
76
|
+
return output
|
|
77
|
+
|
|
78
|
+
def deserialize(self, data: Dict[str, Any], converter: Callable[[str], T]) -> None:
|
|
79
|
+
super().deserialize(data, converter)
|
|
80
|
+
self._highest_common_node_id = (
|
|
81
|
+
converter(data["highest_common_node_id"]) if data["highest_common_node_id"] is not None else None
|
|
82
|
+
)
|
|
83
|
+
self._climbed_source_node_ids = deque(converter(node_id) for node_id in data["climbed_source_node_ids"])
|
|
84
|
+
self._climbed_target_node_ids = deque(converter(node_id) for node_id in data["climbed_target_node_ids"])
|
|
@@ -0,0 +1,30 @@
|
|
|
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 Generic, Callable, Dict, Any
|
|
10
|
+
|
|
11
|
+
from PySide6.QtWidgets import QGraphicsLineItem
|
|
12
|
+
|
|
13
|
+
from discopop_gui.Types.T import T
|
|
14
|
+
from discopop_gui.Objects.CanvasItems.TreeEdges.Base import Base
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Main(Base[T], Generic[T]):
|
|
18
|
+
def __init__(self, canvas_edge: QGraphicsLineItem, source_node_id: T, target_node_id: T):
|
|
19
|
+
super().__init__(source_node_id, target_node_id)
|
|
20
|
+
self._canvas_edge = canvas_edge
|
|
21
|
+
|
|
22
|
+
def get_canvas_edge(self) -> QGraphicsLineItem:
|
|
23
|
+
return self._canvas_edge
|
|
24
|
+
|
|
25
|
+
def serialize(self) -> Dict[str, Any]:
|
|
26
|
+
output = super().serialize()
|
|
27
|
+
return output
|
|
28
|
+
|
|
29
|
+
def deserialize(self, data: Dict[str, Any], converter: Callable[[str], T]) -> None:
|
|
30
|
+
super().deserialize(data, converter)
|
|
File without changes
|