qtdraw 2.4.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.
Files changed (53) hide show
  1. qtdraw-2.4.1/LICENSE +21 -0
  2. qtdraw-2.4.1/MANIFEST.in +4 -0
  3. qtdraw-2.4.1/PKG-INFO +67 -0
  4. qtdraw-2.4.1/docs/README.md +29 -0
  5. qtdraw-2.4.1/pyproject.toml +72 -0
  6. qtdraw-2.4.1/qtdraw/__init__.py +10 -0
  7. qtdraw-2.4.1/qtdraw/core/dialog_about.py +142 -0
  8. qtdraw-2.4.1/qtdraw/core/dialog_preference.py +358 -0
  9. qtdraw-2.4.1/qtdraw/core/pyvista_widget.py +4077 -0
  10. qtdraw-2.4.1/qtdraw/core/pyvista_widget_setting.py +563 -0
  11. qtdraw-2.4.1/qtdraw/core/qtdraw.png +0 -0
  12. qtdraw-2.4.1/qtdraw/core/qtdraw_app.py +2921 -0
  13. qtdraw-2.4.1/qtdraw/multipie/dialog_info.py +398 -0
  14. qtdraw-2.4.1/qtdraw/multipie/dialog_modulation.py +209 -0
  15. qtdraw-2.4.1/qtdraw/multipie/dialog_multipie.py +1704 -0
  16. qtdraw-2.4.1/qtdraw/multipie/plugin_multipie.py +1160 -0
  17. qtdraw-2.4.1/qtdraw/multipie/plugin_multipie_setting.py +443 -0
  18. qtdraw-2.4.1/qtdraw/multipie/util.py +182 -0
  19. qtdraw-2.4.1/qtdraw/parser/converter.py +705 -0
  20. qtdraw-2.4.1/qtdraw/parser/data_group.py +239 -0
  21. qtdraw-2.4.1/qtdraw/parser/element.py +231 -0
  22. qtdraw-2.4.1/qtdraw/parser/read_material.py +40 -0
  23. qtdraw-2.4.1/qtdraw/parser/util.py +221 -0
  24. qtdraw-2.4.1/qtdraw/parser/vesta.py +130 -0
  25. qtdraw-2.4.1/qtdraw/parser/xsf.py +90 -0
  26. qtdraw-2.4.1/qtdraw/scripts/conv_qtdraw2.py +24 -0
  27. qtdraw-2.4.1/qtdraw/scripts/qtdraw.py +27 -0
  28. qtdraw-2.4.1/qtdraw/util/basic_object.py +926 -0
  29. qtdraw-2.4.1/qtdraw/util/color_selector_util.py +92 -0
  30. qtdraw-2.4.1/qtdraw/util/latex_to_png.py +47 -0
  31. qtdraw-2.4.1/qtdraw/util/latex_to_svg.py +136 -0
  32. qtdraw-2.4.1/qtdraw/util/logging_util.py +186 -0
  33. qtdraw-2.4.1/qtdraw/util/pdf_viewer.py +86 -0
  34. qtdraw-2.4.1/qtdraw/util/qt_event_util.py +153 -0
  35. qtdraw-2.4.1/qtdraw/util/util.py +259 -0
  36. qtdraw-2.4.1/qtdraw/util/util_axis.py +453 -0
  37. qtdraw-2.4.1/qtdraw/util/util_str.py +345 -0
  38. qtdraw-2.4.1/qtdraw/widget/custom_widget.py +733 -0
  39. qtdraw-2.4.1/qtdraw/widget/delegate.py +188 -0
  40. qtdraw-2.4.1/qtdraw/widget/group_model.py +688 -0
  41. qtdraw-2.4.1/qtdraw/widget/group_view.py +253 -0
  42. qtdraw-2.4.1/qtdraw/widget/message_box.py +43 -0
  43. qtdraw-2.4.1/qtdraw/widget/tab_group_view.py +80 -0
  44. qtdraw-2.4.1/qtdraw/widget/table_view.py +50 -0
  45. qtdraw-2.4.1/qtdraw/widget/validator.py +348 -0
  46. qtdraw-2.4.1/qtdraw.egg-info/PKG-INFO +67 -0
  47. qtdraw-2.4.1/qtdraw.egg-info/SOURCES.txt +51 -0
  48. qtdraw-2.4.1/qtdraw.egg-info/dependency_links.txt +1 -0
  49. qtdraw-2.4.1/qtdraw.egg-info/entry_points.txt +3 -0
  50. qtdraw-2.4.1/qtdraw.egg-info/requires.txt +16 -0
  51. qtdraw-2.4.1/qtdraw.egg-info/top_level.txt +1 -0
  52. qtdraw-2.4.1/setup.cfg +4 -0
  53. qtdraw-2.4.1/setup.py +3 -0
qtdraw-2.4.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021-2023 Hiroaki Kusunose
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ # Include docs
2
+ include LICENSE
3
+ recursive-include qtdraw *.png
4
+ recursive-include qtdraw *.py
qtdraw-2.4.1/PKG-INFO ADDED
@@ -0,0 +1,67 @@
1
+ Metadata-Version: 2.4
2
+ Name: qtdraw
3
+ Version: 2.4.1
4
+ Summary: 3D drawing tool for molecules and crystals based on Pyvista and PySide6.
5
+ Author-email: Hiroaki Kusunose <hiroaki.kusunose@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/CMT-MU/QtDraw
8
+ Project-URL: Issues, https://github.com/CMT-MU/QtDraw/issues
9
+ Keywords: pyvista,PySide6,multipie
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: Microsoft :: Windows
14
+ Classifier: Operating System :: POSIX
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: numpy
23
+ Requires-Dist: Cython
24
+ Requires-Dist: matplotlib
25
+ Requires-Dist: PySide6
26
+ Requires-Dist: pyvista
27
+ Requires-Dist: pyvistaqt
28
+ Requires-Dist: click
29
+ Requires-Dist: black
30
+ Requires-Dist: ipython
31
+ Requires-Dist: pymatgen
32
+ Requires-Dist: gcoreutils
33
+ Requires-Dist: multipie
34
+ Provides-Extra: dev
35
+ Requires-Dist: jupyter-book; extra == "dev"
36
+ Requires-Dist: ghp-import; extra == "dev"
37
+ Dynamic: license-file
38
+
39
+ # [QtDraw](https://cmt-mu.github.io/QtDraw/)
40
+
41
+ 3D drawing tool for molecules and crystals based on [PyVista](https://docs.pyvista.org/) and [PySide6](https://doc.qt.io/qtforpython-6/index.html).
42
+ Drawings are associated with crystallographic symmetry operations provided by [MultiPie](https://github.com/CMT-MU/MultiPie).
43
+
44
+ - **Authors**: Hiroaki Kusunose
45
+
46
+ - **Citing QtDraw and MultiPie**: If you are using QtDraw and/or MultiPie in your scientific research, please help our scientific visibility by citing our work:
47
+ > Hiroaki Kusunose, Rikuto Oiwa, and Satoru Hayami, Symmetry-adapted modeling for molecules and crystals, Phys. Rev. B <b>107</b>, 195118 (2023).<br>
48
+ > DOI: [https://doi.org/10.1103/PhysRevB.107.195118](https://doi.org/10.1103/PhysRevB.107.195118)
49
+
50
+ - **Installation**: QtDraw can be installed from PyPI using pip on Python >= 3.11:
51
+ ```
52
+ pip install qtdraw
53
+ ```
54
+
55
+ - **Shell commands**:
56
+ - `qtdraw [filename]` : Open QtDraw file.
57
+ - `conv_qtdraw2 [ver1_file.qtdw]` : Convert Version 1 `.qtdw` file into this version (Version 2).
58
+
59
+ - **Requirements**:
60
+ - This library requires [TeXLive](https://www.tug.org/texlive/) environment.
61
+ - Symmetry operation supports are provided by [MultiPie](https://github.com/CMT-MU/MultiPie).
62
+
63
+ - **See also**:
64
+ - [Manual](https://cmt-mu.github.io/QtDraw/src/overview.html).
65
+ - [MultiPie tutorial (in Japanese)](https://cmt-mu.github.io/MultiPieTutorial/)
66
+ - [QtDraw tutorial (in Japanese)](https://cmt-mu.github.io/QtDrawTutorial/)
67
+ - Source : [PyPI](https://pypi.org/project/qtdraw/) or [GitHub](https://github.com/CMT-MU/QtDraw)
@@ -0,0 +1,29 @@
1
+ # [QtDraw](https://cmt-mu.github.io/QtDraw/)
2
+
3
+ 3D drawing tool for molecules and crystals based on [PyVista](https://docs.pyvista.org/) and [PySide6](https://doc.qt.io/qtforpython-6/index.html).
4
+ Drawings are associated with crystallographic symmetry operations provided by [MultiPie](https://github.com/CMT-MU/MultiPie).
5
+
6
+ - **Authors**: Hiroaki Kusunose
7
+
8
+ - **Citing QtDraw and MultiPie**: If you are using QtDraw and/or MultiPie in your scientific research, please help our scientific visibility by citing our work:
9
+ > Hiroaki Kusunose, Rikuto Oiwa, and Satoru Hayami, Symmetry-adapted modeling for molecules and crystals, Phys. Rev. B <b>107</b>, 195118 (2023).<br>
10
+ > DOI: [https://doi.org/10.1103/PhysRevB.107.195118](https://doi.org/10.1103/PhysRevB.107.195118)
11
+
12
+ - **Installation**: QtDraw can be installed from PyPI using pip on Python >= 3.11:
13
+ ```
14
+ pip install qtdraw
15
+ ```
16
+
17
+ - **Shell commands**:
18
+ - `qtdraw [filename]` : Open QtDraw file.
19
+ - `conv_qtdraw2 [ver1_file.qtdw]` : Convert Version 1 `.qtdw` file into this version (Version 2).
20
+
21
+ - **Requirements**:
22
+ - This library requires [TeXLive](https://www.tug.org/texlive/) environment.
23
+ - Symmetry operation supports are provided by [MultiPie](https://github.com/CMT-MU/MultiPie).
24
+
25
+ - **See also**:
26
+ - [Manual](https://cmt-mu.github.io/QtDraw/src/overview.html).
27
+ - [MultiPie tutorial (in Japanese)](https://cmt-mu.github.io/MultiPieTutorial/)
28
+ - [QtDraw tutorial (in Japanese)](https://cmt-mu.github.io/QtDrawTutorial/)
29
+ - Source : [PyPI](https://pypi.org/project/qtdraw/) or [GitHub](https://github.com/CMT-MU/QtDraw)
@@ -0,0 +1,72 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "qtdraw"
7
+ dependencies = [
8
+ "numpy",
9
+ "Cython",
10
+ "matplotlib",
11
+ "PySide6",
12
+ "pyvista",
13
+ "pyvistaqt",
14
+ "click",
15
+ "black",
16
+ "ipython",
17
+ "pymatgen",
18
+ "gcoreutils",
19
+ "multipie",
20
+ ]
21
+ dynamic = ["version"]
22
+ requires-python = ">=3.11"
23
+ authors = [
24
+ { name="Hiroaki Kusunose", email="hiroaki.kusunose@gmail.com" },
25
+ ]
26
+ description = "3D drawing tool for molecules and crystals based on Pyvista and PySide6."
27
+ readme = "docs/README.md"
28
+ keywords = ['pyvista', 'PySide6', 'multipie']
29
+ license = {text = "MIT"}
30
+ classifiers = [
31
+ 'Intended Audience :: Science/Research',
32
+ 'Topic :: Scientific/Engineering :: Information Analysis',
33
+ 'License :: OSI Approved :: MIT License',
34
+ 'Operating System :: Microsoft :: Windows',
35
+ 'Operating System :: POSIX',
36
+ 'Operating System :: MacOS',
37
+ 'Programming Language :: Python :: 3.11',
38
+ 'Programming Language :: Python :: 3.12',
39
+ 'Programming Language :: Python :: 3.13',
40
+ ]
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/CMT-MU/QtDraw"
44
+ Issues = "https://github.com/CMT-MU/QtDraw/issues"
45
+
46
+ [project.scripts]
47
+ "qtdraw" = "qtdraw.scripts.qtdraw:cmd"
48
+ "conv_qtdraw2" = "qtdraw.scripts.conv_qtdraw2:cmd"
49
+
50
+ [project.optional-dependencies]
51
+ dev = [
52
+ "jupyter-book",
53
+ "ghp-import",
54
+ ]
55
+
56
+ [tool.setuptools.dynamic]
57
+ version = {attr = "qtdraw.__version__"}
58
+
59
+ [tool.setuptools.packages.find]
60
+ include = ['qtdraw', 'qtdraw.*']
61
+ exclude = ["build", "tests"]
62
+
63
+ [tool.black]
64
+ line-length = 130
65
+
66
+ [tool.build_sphinx]
67
+ source-dir = 'docs'
68
+ build-dir = './docs/_build'
69
+ all_files = 1
70
+
71
+ [tool.upload_sphinx]
72
+ upload-dir = 'docs/_build/html'
@@ -0,0 +1,10 @@
1
+ """
2
+ QtDraw
3
+ """
4
+
5
+ from pathlib import Path
6
+
7
+ __version__ = "2.4.1"
8
+ __date__ = "2021 - 2025"
9
+ __author__ = "Hiroaki Kusunose"
10
+ __top_dir__ = Path(__file__).parent / ".."
@@ -0,0 +1,142 @@
1
+ """
2
+ About dialog.
3
+
4
+ This module provides about dialog for PyVistaWidget.
5
+ """
6
+
7
+ from pathlib import Path
8
+ import sys
9
+ from numpy import __version__ as numpy_ver
10
+ from sympy import __version__ as sympy_ver
11
+ from matplotlib import __version__ as matplot_ver
12
+ from PySide6 import __version__ as pyside6_ver
13
+ import pyvista as pv
14
+ from pyvistaqt import __version__ as pyvistaqt_ver
15
+ from PySide6.QtWidgets import QDialog, QWidget, QDialogButtonBox, QSizePolicy
16
+ from PySide6.QtGui import QPixmap
17
+ from qtdraw.widget.custom_widget import Layout, Label, VSpacer
18
+ from qtdraw.__init__ import __version__, __date__, __author__
19
+ from qtdraw.util.util import check_multipie
20
+
21
+
22
+ # ==================================================
23
+ class AboutDialog(QDialog):
24
+ # ==================================================
25
+ def __init__(self, widget, parent=None):
26
+ """
27
+ About dialog.
28
+
29
+ Args:
30
+ widget (PyVistaWidget): widget.
31
+ parent (QWidget, optional): parent.
32
+ """
33
+ super().__init__(parent)
34
+ self.setWindowTitle("About")
35
+ self.resize(100, 100)
36
+ policy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
37
+ self.setSizePolicy(policy)
38
+
39
+ self.pvw = widget
40
+
41
+ # buttons.
42
+ button = QDialogButtonBox(QDialogButtonBox.Ok)
43
+ button.accepted.connect(self.accept)
44
+
45
+ panel = self.create_about_panel(self)
46
+
47
+ # main layout
48
+ layout = Layout(self)
49
+ layout.setContentsMargins(20, 20, 20, 20)
50
+ layout.addWidget(panel, 0, 0, 1, 1)
51
+ layout.addWidget(button, 1, 0, 1, 1)
52
+
53
+ # ==================================================
54
+ def create_about_panel(self, parent):
55
+ """
56
+ Create about panel.
57
+ """
58
+ indent = " " * 4
59
+ vtk_ver = ".".join(map(str, pv.vtk_version_info))
60
+ pyvista_ver = pv._version.__version__
61
+ python_ver = sys.version.replace(" [", f"\n{indent+indent}[")
62
+ multipie = "version" in self.pvw._status["multipie"].keys()
63
+
64
+ panel = QWidget(parent)
65
+ layout = Layout(panel)
66
+
67
+ label_icon = Label(parent)
68
+ file = str(Path(__file__).parent / "qtdraw.png")
69
+ pix = QPixmap(file)
70
+ pix = pix.scaledToHeight(int(2.5 * self.height()))
71
+ label_icon.setPixmap(pix)
72
+ label_qtdraw = Label(parent, "QtDraw", True)
73
+ label_copyright = Label(parent, self.pvw.copyright)
74
+ label_python = Label(parent, f"\n{indent}Python: Ver. {python_ver}")
75
+ label_pyvista = Label(parent, f"{indent}PyVista: Ver. {pyvista_ver}")
76
+ label_pvqt = Label(parent, f"{indent}PyVistaQt: Ver. {pyvistaqt_ver}")
77
+ label_vtk = Label(parent, f"{indent}VTK: Ver. {vtk_ver}")
78
+ label_qt = Label(parent, f"{indent}PySide6: Ver. {pyside6_ver}")
79
+ label_numpy = Label(parent, f"{indent}NumPy: Ver. {numpy_ver}")
80
+ label_sympy = Label(parent, f"{indent}SymPy: Ver. {sympy_ver}")
81
+ label_matplotlib = Label(parent, f"{indent}Matplotlib: Ver. {matplot_ver}")
82
+ multipie = check_multipie()
83
+ if multipie:
84
+ from multipie import __version__ as multipie_ver
85
+
86
+ label_multipie = Label(parent, f"{indent}MultiPie: Ver. {multipie_ver}")
87
+
88
+ panel1 = QWidget(parent)
89
+ layout1 = Layout(panel1)
90
+ layout1.setContentsMargins(10, 10, 10, 10)
91
+ layout1.addWidget(label_qtdraw, 0, 0, 1, 1)
92
+ layout1.addWidget(label_copyright, 1, 0, 1, 1)
93
+ layout1.addWidget(label_python, 2, 0, 1, 1)
94
+ layout1.addWidget(label_pyvista, 3, 0, 1, 1)
95
+ layout1.addWidget(label_pvqt, 4, 0, 1, 1)
96
+ layout1.addWidget(label_vtk, 5, 0, 1, 1)
97
+ layout1.addWidget(label_qt, 6, 0, 1, 1)
98
+ layout1.addWidget(label_numpy, 7, 0, 1, 1)
99
+ layout1.addWidget(label_sympy, 8, 0, 1, 1)
100
+ layout1.addWidget(label_matplotlib, 9, 0, 1, 1)
101
+ if multipie:
102
+ layout1.addWidget(label_multipie, 10, 0, 1, 1)
103
+ layout1.addItem(VSpacer(), 11, 0, 1, 1)
104
+ else:
105
+ layout1.addItem(VSpacer(), 10, 0, 1, 1)
106
+
107
+ layout.addWidget(label_icon, 0, 0, 1, 1)
108
+ layout.addWidget(panel1, 0, 1, 1, 1)
109
+
110
+ return panel
111
+
112
+
113
+ # ==================================================
114
+ def get_version_info():
115
+ """
116
+ Get version info.
117
+
118
+ Returns:
119
+ - (str) -- version info.
120
+ """
121
+ indent = " " * 4
122
+ vtk_ver = ".".join(map(str, pv.vtk_version_info))
123
+ pyvista_ver = pv._version.__version__
124
+ python_ver = sys.version
125
+ cr = f"Versoin {__version__}, Copyright (C) {__date__} by {__author__}"
126
+
127
+ s = "* QtDraw: " + cr + "\n"
128
+ s += f"{indent}Python: Ver. {python_ver}" + "\n"
129
+ s += f"{indent}PyVista: Ver. {pyvista_ver}" + "\n"
130
+ s += f"{indent}PyVistaQt: Ver. {pyvistaqt_ver}" + "\n"
131
+ s += f"{indent}VTK: Ver. {vtk_ver}" + "\n"
132
+ s += f"{indent}PySide6: Ver. {pyside6_ver}" + "\n"
133
+ s += f"{indent}NumPy: Ver. {numpy_ver}" + "\n"
134
+ s += f"{indent}SymPy: Ver. {sympy_ver}" + "\n"
135
+ s += f"{indent}Matplotlib: Ver. {matplot_ver}" + "\n"
136
+ if check_multipie():
137
+ from multipie import __version__ as multipie_ver
138
+
139
+ s += f"{indent}MultiPie: Ver. {multipie_ver}" + "\n"
140
+ s += "-" * 90
141
+
142
+ return s