From 0c107d7b727d249cba00e61c67e1a84bb3537c6e Mon Sep 17 00:00:00 2001 From: Sergey Sozykin Date: Tue, 19 Dec 2023 19:25:22 +0500 Subject: [PATCH 1/7] from pyside2 to qtpy --- requirements.txt | 6 +++--- src/core_gui_atomistic_qt/guiopenglbase.py | 6 +++--- src/core_gui_atomistic_qt/pyqtgraphwidget.py | 6 +++--- src/core_gui_atomistic_qt/pyqtgraphwidgetimage.py | 2 +- src/gui4dft.py | 6 +++--- src/src_gui4dft/ui/about.py | 6 +++--- src/src_gui4dft/ui/form.py | 6 +++--- src/src_gui4dft/ui/image3D.py | 4 ++-- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/requirements.txt b/requirements.txt index a9b6c40..5a2b4e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ pyopengl pyside2 -qtpy +qtpy==2.4.1 ase -numpy -scipy +numpy==1.26.2 +scipy==1.11.4 matplotlib pyqtgraph scikit-image diff --git a/src/core_gui_atomistic_qt/guiopenglbase.py b/src/core_gui_atomistic_qt/guiopenglbase.py index 2087dcc..3b933aa 100644 --- a/src/core_gui_atomistic_qt/guiopenglbase.py +++ b/src/core_gui_atomistic_qt/guiopenglbase.py @@ -4,9 +4,9 @@ import OpenGL.GL as gl import OpenGL.GLU as glu from qtpy.QtWidgets import QOpenGLWidget -from PySide2.QtCore import QEvent -from PySide2.QtCore import Qt -from PySide2.QtGui import QColor, QPainter, QFont +from qtpy.QtCore import QEvent +from qtpy.QtCore import Qt +from qtpy.QtGui import QColor, QPainter, QFont from copy import deepcopy from core_gui_atomistic.periodic_table import TPeriodTable from core_gui_atomistic.atom import Atom diff --git a/src/core_gui_atomistic_qt/pyqtgraphwidget.py b/src/core_gui_atomistic_qt/pyqtgraphwidget.py index adf85df..1b25d8a 100644 --- a/src/core_gui_atomistic_qt/pyqtgraphwidget.py +++ b/src/core_gui_atomistic_qt/pyqtgraphwidget.py @@ -4,9 +4,9 @@ # ------------------------------------------------------ # https://www.pythonguis.com/tutorials/pyside-plotting-pyqtgraph/ -from PySide2.QtWidgets import QWidget, QVBoxLayout -from PySide2.QtGui import QFont -from PySide2.QtCore import Qt +from qtpy.QtWidgets import QWidget, QVBoxLayout +from qtpy.QtGui import QFont +from qtpy.QtCore import Qt import pyqtgraph as pg # pip install pyqtgraph import numpy as np from typing import List diff --git a/src/core_gui_atomistic_qt/pyqtgraphwidgetimage.py b/src/core_gui_atomistic_qt/pyqtgraphwidgetimage.py index 466f0f5..d64a02b 100644 --- a/src/core_gui_atomistic_qt/pyqtgraphwidgetimage.py +++ b/src/core_gui_atomistic_qt/pyqtgraphwidgetimage.py @@ -4,7 +4,7 @@ # ------------------------------------------------------ # https://www.pythonguis.com/tutorials/pyside-plotting-pyqtgraph/ -from PySide2.QtWidgets import QWidget, QVBoxLayout +from qtpy.QtWidgets import QWidget, QVBoxLayout import pyqtgraph as pg # pip install pyqtgraph diff --git a/src/gui4dft.py b/src/gui4dft.py index 14fcfae..38a97d5 100644 --- a/src/gui4dft.py +++ b/src/gui4dft.py @@ -8,9 +8,9 @@ import sys from pathlib import Path -from PySide2.QtCore import QCoreApplication, Qt -from PySide2.QtGui import QIcon -from PySide2.QtWidgets import QApplication +from qtpy.QtCore import QCoreApplication, Qt +from qtpy.QtGui import QIcon +from qtpy.QtWidgets import QApplication from src_gui4dft.qtbased.mainform import MainForm diff --git a/src/src_gui4dft/ui/about.py b/src/src_gui4dft/ui/about.py index 6078eb6..3adf9ec 100644 --- a/src/src_gui4dft/ui/about.py +++ b/src/src_gui4dft/ui/about.py @@ -8,9 +8,9 @@ ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from PySide2.QtCore import * -from PySide2.QtGui import * -from PySide2.QtWidgets import * +from qtpy.QtCore import * +from qtpy.QtGui import * +from qtpy.QtWidgets import * class Ui_DialogAbout(object): diff --git a/src/src_gui4dft/ui/form.py b/src/src_gui4dft/ui/form.py index 497a890..ba55bbf 100644 --- a/src/src_gui4dft/ui/form.py +++ b/src/src_gui4dft/ui/form.py @@ -8,9 +8,9 @@ ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from PySide2.QtCore import * -from PySide2.QtGui import * -from PySide2.QtWidgets import * +from qtpy.QtCore import * +from qtpy.QtGui import * +from qtpy.QtWidgets import * from core_gui_atomistic_qt.pyqtgraphwidget import PyqtGraphWidget from core_gui_atomistic_qt.pyqtgraphwidgetimage import PyqtGraphWidgetImage diff --git a/src/src_gui4dft/ui/image3D.py b/src/src_gui4dft/ui/image3D.py index 65322e9..696121e 100644 --- a/src/src_gui4dft/ui/image3D.py +++ b/src/src_gui4dft/ui/image3D.py @@ -8,8 +8,8 @@ ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ -from PySide2.QtCore import * -from PySide2.QtWidgets import * +from qtpy.QtCore import * +from qtpy.QtWidgets import * from src_gui4dft.qtbased.guiopengl import GuiOpenGL From 4cdc6b3c01cca33e9474d50e502e6dbc74bc3366 Mon Sep 17 00:00:00 2001 From: Sozykin Sergey Date: Sat, 6 Jan 2024 16:44:53 +0500 Subject: [PATCH 2/7] separate tests --- README.md | 11 ++++--- requirements.txt | 2 +- .../atom.py | 2 +- .../atomic_model.py | 6 ++-- .../helpers.py | 0 .../periodic_table.py | 0 .../project_file.py} | 4 +-- .../guiopenglbase.py | 4 +-- .../pyqtgraphwidget.py | 0 .../pyqtgraphwidgetimage.py | 0 src/src_gui4dft/models/bint.py | 4 +-- src/src_gui4dft/models/capedswcnt.py | 4 +-- src/src_gui4dft/models/gaussiancube.py | 10 +++--- src/src_gui4dft/models/hexagonal_plane.py | 4 +-- src/src_gui4dft/models/meta_graphene.py | 2 +- src/src_gui4dft/models/swgnt.py | 8 ++--- src/src_gui4dft/models/swnt.py | 2 +- src/src_gui4dft/models/volumericdata.py | 2 +- src/src_gui4dft/models/xsf.py | 10 +++--- src/src_gui4dft/program/ase.py | 8 ++--- src/src_gui4dft/program/crystal.py | 6 ++-- src/src_gui4dft/program/dftb.py | 10 +++--- src/src_gui4dft/program/fdfdata.py | 2 +- src/src_gui4dft/program/firefly.py | 2 +- src/src_gui4dft/program/lammps.py | 2 +- src/src_gui4dft/program/qe.py | 6 ++-- src/src_gui4dft/program/siesta.py | 15 ++++----- src/src_gui4dft/program/vasp.py | 9 +++-- src/src_gui4dft/program/wien.py | 6 ++-- src/src_gui4dft/qtbased/guiopengl.py | 7 ++-- src/src_gui4dft/qtbased/image3dexporter.py | 4 +-- src/src_gui4dft/qtbased/mainform.py | 33 +++++++++---------- src/src_gui4dft/ui/form.py | 4 +-- src/src_gui4dft/utils/calculators.py | 6 ++-- .../utils/electronic_prop_reader.py | 4 +-- src/src_gui4dft/utils/importer_exporter.py | 10 +++--- tests/conftest.py | 4 +-- tests/core_gui_atomistic/conftest.py | 8 ----- tests/gui4dft/test_importer.py | 2 +- tests/gui4dft/test_siesta.py | 3 +- tests/gui4dft_opengl/conftest.py | 6 ++-- tests/gui4dft_opengl/test_guiopengl.py | 2 +- tests_core/conftest.py | 14 ++++++++ tests_core/core_atomistic/conftest.py | 21 ++++++++++++ .../core_atomistic}/test_atom.py | 2 +- .../core_atomistic}/test_atomic_model.py | 2 +- .../core_atomistic}/test_helpers.py | 2 +- .../core_atomistic}/test_periodic_table.py | 0 .../core_atomistic_qt}/conftest.py | 17 ++++++++-- .../test_pygrimagewidget.py | 0 .../core_atomistic_qt}/test_pygrwidget.py | 0 51 files changed, 166 insertions(+), 126 deletions(-) rename src/{core_gui_atomistic => core_atomistic}/atom.py (97%) rename src/{core_gui_atomistic => core_atomistic}/atomic_model.py (99%) rename src/{core_gui_atomistic => core_atomistic}/helpers.py (100%) rename src/{core_gui_atomistic => core_atomistic}/periodic_table.py (100%) rename src/{core_gui_atomistic/gui4dft_project_file.py => core_atomistic/project_file.py} (94%) rename src/{core_gui_atomistic_qt => core_atomistic_qt}/guiopenglbase.py (99%) rename src/{core_gui_atomistic_qt => core_atomistic_qt}/pyqtgraphwidget.py (100%) rename src/{core_gui_atomistic_qt => core_atomistic_qt}/pyqtgraphwidgetimage.py (100%) delete mode 100644 tests/core_gui_atomistic/conftest.py create mode 100644 tests_core/conftest.py create mode 100644 tests_core/core_atomistic/conftest.py rename {tests/core_gui_atomistic => tests_core/core_atomistic}/test_atom.py (88%) rename {tests/core_gui_atomistic => tests_core/core_atomistic}/test_atomic_model.py (98%) rename {tests/core_gui_atomistic => tests_core/core_atomistic}/test_helpers.py (96%) rename {tests/core_gui_atomistic => tests_core/core_atomistic}/test_periodic_table.py (100%) rename {tests/core_gui_atomistic_qt => tests_core/core_atomistic_qt}/conftest.py (59%) rename {tests/core_gui_atomistic_qt => tests_core/core_atomistic_qt}/test_pygrimagewidget.py (100%) rename {tests/core_gui_atomistic_qt => tests_core/core_atomistic_qt}/test_pygrwidget.py (100%) diff --git a/README.md b/README.md index 35a10f4..ecd6b34 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ GUI4dft (Graphical User Interface for support of Density Functional Theory calculations) - first free SIESTA oriented GUI. It is a cross-platform program. ## Install -GUI4DFT program is written in Python 3 (version >= 3.8). It has some dependences. To install the necessary modules, run in the terminal (command line): +GUI4DFT program is written in Python 3 (version >= 3.9). It has some dependences. To install the necessary modules, run in the terminal (in the ): pip3 install -r ./requirements.txt -To run the program, type +To run the program, type (in the /src) python3 gui4dft.py @@ -17,11 +17,12 @@ python3 gui4dft.py You have to set the variable QT_API: -export QT_API=pyside2 (in linux, or https://www.architectryan.com/2018/08/31/how-to-change-environment-variables-on-windows-10/ in Windows) +export QT_API=pyside6 (in linux, or https://www.architectryan.com/2018/08/31/how-to-change-environment-variables-on-windows-10/ in Windows) Some operating systems may require additional packages to be installed: -Xubuntu: sudo apt-get install qtbase5-dev +Ubuntu 22.04: sudo apt-get install -y libxcb-cursor-dev +Xubuntu: ? sudo apt-get install qtbase5-dev ## Explanations for the versions of the program @@ -33,7 +34,7 @@ v1.2 - Contains some additional features. For example, it allows visualizing the v1.3 - This version uses pyqtgraph instead of matplotlib and pyside2 instead of PyQt5. The colors of the atoms and covalent radii are taken from the ASE module. The project is covered with tests. -v1.4 - This is the next release in 1.x branch. Added support for exporting structural data to input files VASP, CRYSTAL, QE. +v1.4 - This is the next release in 1.x branch. Pyside6. Added support for exporting structural data to input files VASP, CRYSTAL, QE. The master branch contains more or less stable 1.x version functions. diff --git a/requirements.txt b/requirements.txt index 5a2b4e9..e21b428 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ pyopengl -pyside2 +pyside6 qtpy==2.4.1 ase numpy==1.26.2 diff --git a/src/core_gui_atomistic/atom.py b/src/core_atomistic/atom.py similarity index 97% rename from src/core_gui_atomistic/atom.py rename to src/core_atomistic/atom.py index 3024f53..aa69a1e 100644 --- a/src/core_gui_atomistic/atom.py +++ b/src/core_atomistic/atom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from core_gui_atomistic import helpers +from core_atomistic import helpers import numpy as np diff --git a/src/core_gui_atomistic/atomic_model.py b/src/core_atomistic/atomic_model.py similarity index 99% rename from src/core_gui_atomistic/atomic_model.py rename to src/core_atomistic/atomic_model.py index 520cdaa..79f825e 100644 --- a/src/core_gui_atomistic/atomic_model.py +++ b/src/core_atomistic/atomic_model.py @@ -12,9 +12,9 @@ from numpy.linalg import inv from numpy.linalg import norm -from core_gui_atomistic import helpers -from core_gui_atomistic.periodic_table import TPeriodTable -from core_gui_atomistic.atom import Atom +from core_atomistic import helpers +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic.atom import Atom from scipy.spatial.distance import cdist from scipy.optimize import fmin import scipy diff --git a/src/core_gui_atomistic/helpers.py b/src/core_atomistic/helpers.py similarity index 100% rename from src/core_gui_atomistic/helpers.py rename to src/core_atomistic/helpers.py diff --git a/src/core_gui_atomistic/periodic_table.py b/src/core_atomistic/periodic_table.py similarity index 100% rename from src/core_gui_atomistic/periodic_table.py rename to src/core_atomistic/periodic_table.py diff --git a/src/core_gui_atomistic/gui4dft_project_file.py b/src/core_atomistic/project_file.py similarity index 94% rename from src/core_gui_atomistic/gui4dft_project_file.py rename to src/core_atomistic/project_file.py index 8f37274..e975885 100644 --- a/src/core_gui_atomistic/gui4dft_project_file.py +++ b/src/core_atomistic/project_file.py @@ -1,9 +1,9 @@ import os import numpy as np -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel -class GUI4dftProjectFile(object): +class ProjectFile(object): @staticmethod def project_file_writer(model): diff --git a/src/core_gui_atomistic_qt/guiopenglbase.py b/src/core_atomistic_qt/guiopenglbase.py similarity index 99% rename from src/core_gui_atomistic_qt/guiopenglbase.py rename to src/core_atomistic_qt/guiopenglbase.py index 3b933aa..44f1636 100644 --- a/src/core_gui_atomistic_qt/guiopenglbase.py +++ b/src/core_atomistic_qt/guiopenglbase.py @@ -8,8 +8,8 @@ from qtpy.QtCore import Qt from qtpy.QtGui import QColor, QPainter, QFont from copy import deepcopy -from core_gui_atomistic.periodic_table import TPeriodTable -from core_gui_atomistic.atom import Atom +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic.atom import Atom import math import numpy as np diff --git a/src/core_gui_atomistic_qt/pyqtgraphwidget.py b/src/core_atomistic_qt/pyqtgraphwidget.py similarity index 100% rename from src/core_gui_atomistic_qt/pyqtgraphwidget.py rename to src/core_atomistic_qt/pyqtgraphwidget.py diff --git a/src/core_gui_atomistic_qt/pyqtgraphwidgetimage.py b/src/core_atomistic_qt/pyqtgraphwidgetimage.py similarity index 100% rename from src/core_gui_atomistic_qt/pyqtgraphwidgetimage.py rename to src/core_atomistic_qt/pyqtgraphwidgetimage.py diff --git a/src/src_gui4dft/models/bint.py b/src/src_gui4dft/models/bint.py index f497429..8f11cbe 100644 --- a/src/src_gui4dft/models/bint.py +++ b/src/src_gui4dft/models/bint.py @@ -2,8 +2,8 @@ import math -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel as TAtomicModel +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel as TAtomicModel class BiNT(TAtomicModel): diff --git a/src/src_gui4dft/models/capedswcnt.py b/src/src_gui4dft/models/capedswcnt.py index 5cf881f..5cb0dbe 100644 --- a/src/src_gui4dft/models/capedswcnt.py +++ b/src/src_gui4dft/models/capedswcnt.py @@ -5,8 +5,8 @@ import numpy as np from pathlib import Path -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel as TAtomicModel +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel as TAtomicModel from src_gui4dft.models.swnt import SWNT diff --git a/src/src_gui4dft/models/gaussiancube.py b/src/src_gui4dft/models/gaussiancube.py index fdcd453..880dfa0 100644 --- a/src/src_gui4dft/models/gaussiancube.py +++ b/src/src_gui4dft/models/gaussiancube.py @@ -2,12 +2,14 @@ from copy import deepcopy import os -from core_gui_atomistic.atomic_model import AtomicModel as TAtomicModel +import math +import numpy as np +from core_atomistic.atomic_model import AtomicModel as TAtomicModel +from core_atomistic.periodic_table import TPeriodTable from src_gui4dft.models.volumericdatablock import VolumericDataBlock from src_gui4dft.models.volumericdata import VolumericData -from core_gui_atomistic.periodic_table import TPeriodTable -import numpy as np -import math + + class GaussianCube(VolumericData): diff --git a/src/src_gui4dft/models/hexagonal_plane.py b/src/src_gui4dft/models/hexagonal_plane.py index b64fc0f..fcd0c84 100644 --- a/src/src_gui4dft/models/hexagonal_plane.py +++ b/src/src_gui4dft/models/hexagonal_plane.py @@ -2,8 +2,8 @@ import math import numpy as np -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel class HexagonalPlaneHex(AtomicModel): diff --git a/src/src_gui4dft/models/meta_graphene.py b/src/src_gui4dft/models/meta_graphene.py index 1ff571b..c9234a5 100644 --- a/src/src_gui4dft/models/meta_graphene.py +++ b/src/src_gui4dft/models/meta_graphene.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel from src_gui4dft.utils.importer_exporter import ImporterExporter from pathlib import Path diff --git a/src/src_gui4dft/models/swgnt.py b/src/src_gui4dft/models/swgnt.py index 94476df..4063e53 100644 --- a/src/src_gui4dft/models/swgnt.py +++ b/src/src_gui4dft/models/swgnt.py @@ -2,17 +2,17 @@ import math -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel class SWGNT(AtomicModel): """The SWGNT class provides """ - def __init__(self, n, m, length: float = 0, n_cell: int = 1): + def __init__(self, n, m, length: float = 0): super().__init__() a: float = 2.9 - t = math.sqrt(1.0 * n * n+1.0 * n * m+1.0 * m * m) + t = math.sqrt(1.0 * n * n + 1.0 * n * m + 1.0 * m * m) a11 = (2.0 * n+m) / (2.0 * t) if length < 1e-3: diff --git a/src/src_gui4dft/models/swnt.py b/src/src_gui4dft/models/swnt.py index 6926a5a..691e029 100644 --- a/src/src_gui4dft/models/swnt.py +++ b/src/src_gui4dft/models/swnt.py @@ -3,7 +3,7 @@ import math import numpy as np -from core_gui_atomistic import helpers +from core_atomistic import helpers from src_gui4dft.models.graphene import Graphene diff --git a/src/src_gui4dft/models/volumericdata.py b/src/src_gui4dft/models/volumericdata.py index eccfe49..088e04f 100644 --- a/src/src_gui4dft/models/volumericdata.py +++ b/src/src_gui4dft/models/volumericdata.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from copy import deepcopy -from core_gui_atomistic import helpers +from core_atomistic import helpers import numpy as np import skimage if skimage.__version__ >= '0.17.2': diff --git a/src/src_gui4dft/models/xsf.py b/src/src_gui4dft/models/xsf.py index 49782a0..7b3ca61 100644 --- a/src/src_gui4dft/models/xsf.py +++ b/src/src_gui4dft/models/xsf.py @@ -2,12 +2,14 @@ from copy import deepcopy import os -from core_gui_atomistic.atomic_model import AtomicModel as TAtomicModel +import numpy as np + +from core_atomistic.atomic_model import AtomicModel as TAtomicModel +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers + from src_gui4dft.models.volumericdatablock import VolumericDataBlock from src_gui4dft.models.volumericdata import VolumericData -from core_gui_atomistic.periodic_table import TPeriodTable -from core_gui_atomistic import helpers -import numpy as np class XSF(VolumericData): diff --git a/src/src_gui4dft/program/ase.py b/src/src_gui4dft/program/ase.py index 19d8177..418a868 100644 --- a/src/src_gui4dft/program/ase.py +++ b/src/src_gui4dft/program/ase.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- import numpy as np -from core_gui_atomistic import helpers -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel -from core_gui_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable def from_ase_atoms_to_atomic_model(ase_atoms): diff --git a/src/src_gui4dft/program/crystal.py b/src/src_gui4dft/program/crystal.py index 4f9ac51..e7a7c4c 100644 --- a/src/src_gui4dft/program/crystal.py +++ b/src/src_gui4dft/program/crystal.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- from copy import deepcopy import numpy as np -from core_gui_atomistic import helpers -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic import helpers def model_0d_to_d12(model): diff --git a/src/src_gui4dft/program/dftb.py b/src/src_gui4dft/program/dftb.py index d32e8a7..b07ff14 100644 --- a/src/src_gui4dft/program/dftb.py +++ b/src/src_gui4dft/program/dftb.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -import re -import math import os from copy import deepcopy -from core_gui_atomistic.periodic_table import TPeriodTable + import numpy as np -from core_gui_atomistic import helpers -from core_gui_atomistic.atomic_model import AtomicModel + +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers def model_to_dftb_d0(model: AtomicModel): diff --git a/src/src_gui4dft/program/fdfdata.py b/src/src_gui4dft/program/fdfdata.py index 3dbd5b5..5db5b47 100644 --- a/src/src_gui4dft/program/fdfdata.py +++ b/src/src_gui4dft/program/fdfdata.py @@ -2,7 +2,7 @@ import os from copy import deepcopy -from core_gui_atomistic.helpers import text_between_lines +from core_atomistic.helpers import text_between_lines from src_gui4dft.program.siesta import TSIESTA diff --git a/src/src_gui4dft/program/firefly.py b/src/src_gui4dft/program/firefly.py index fc87c17..24e3fcd 100644 --- a/src/src_gui4dft/program/firefly.py +++ b/src/src_gui4dft/program/firefly.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Python 3 -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel def atomic_model_to_firefly_inp(model: AtomicModel) -> str: diff --git a/src/src_gui4dft/program/lammps.py b/src/src_gui4dft/program/lammps.py index 0697edd..ce5fd05 100644 --- a/src/src_gui4dft/program/lammps.py +++ b/src/src_gui4dft/program/lammps.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import numpy as np -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel def atoms_trajectory_step(f_name): diff --git a/src/src_gui4dft/program/qe.py b/src/src_gui4dft/program/qe.py index 6334c8a..9d54f03 100644 --- a/src/src_gui4dft/program/qe.py +++ b/src/src_gui4dft/program/qe.py @@ -2,9 +2,9 @@ import math from copy import deepcopy import numpy as np -from core_gui_atomistic import helpers -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic import helpers +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel def vectors_from_pwout(f_name): diff --git a/src/src_gui4dft/program/siesta.py b/src/src_gui4dft/program/siesta.py index 059bf97..7106111 100644 --- a/src/src_gui4dft/program/siesta.py +++ b/src/src_gui4dft/program/siesta.py @@ -1,15 +1,14 @@ # -*- coding: utf-8 -*- import os import re +import xml.etree.ElementTree as ET import numpy as np -from core_gui_atomistic import helpers -import xml.etree.ElementTree as ET -from core_gui_atomistic.periodic_table import TPeriodTable -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel -from core_gui_atomistic.helpers import clear_fdf_lines, text_between_lines +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers class TSIESTA: @@ -504,7 +503,7 @@ def atoms_from_fdf_prepare(filename): @staticmethod def atoms_from_fdf_text(atomic_coordinates_format, number_of_atoms, chem_spec_info, lat, lat_vectors, lines, units): - lines = clear_fdf_lines(lines) + lines = helpers.clear_fdf_lines(lines) all_atoms = AtomicModel() at_list = [] at_list1 = [] @@ -758,7 +757,7 @@ def atoms_from_output_sp(filename): coord_format, n_atoms, chem_spec_info, lat, lat_vectors, units = TSIESTA.atoms_from_fdf_prepare(filename) line1 = "Dump of input data file" line2 = "End of input data file" - lines = text_between_lines(filename, line1, line2) + lines = helpers.text_between_lines(filename, line1, line2) return [TSIESTA.atoms_from_fdf_text(coord_format, n_atoms, chem_spec_info, lat, lat_vectors, lines, units)] @staticmethod diff --git a/src/src_gui4dft/program/vasp.py b/src/src_gui4dft/program/vasp.py index abb83f3..5aa560e 100644 --- a/src/src_gui4dft/program/vasp.py +++ b/src/src_gui4dft/program/vasp.py @@ -3,11 +3,10 @@ import numpy as np import re -from core_gui_atomistic import helpers -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel - -from core_gui_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable from src_gui4dft.utils.electronic_prop_reader import dos_from_file diff --git a/src/src_gui4dft/program/wien.py b/src/src_gui4dft/program/wien.py index 21eb6ce..b2bad6b 100644 --- a/src/src_gui4dft/program/wien.py +++ b/src/src_gui4dft/program/wien.py @@ -3,9 +3,9 @@ import math from copy import deepcopy import numpy as np -from core_gui_atomistic import helpers -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel + +from core_atomistic.atomic_model import AtomicModel +from core_atomistic import helpers def n_atoms_from_struct(f_name): diff --git a/src/src_gui4dft/qtbased/guiopengl.py b/src/src_gui4dft/qtbased/guiopengl.py index ce81e32..59eac8d 100644 --- a/src/src_gui4dft/qtbased/guiopengl.py +++ b/src/src_gui4dft/qtbased/guiopengl.py @@ -3,12 +3,13 @@ from typing import Callable import OpenGL.GL as gl -from core_gui_atomistic_qt.guiopenglbase import GuiOpenGLBase from copy import deepcopy -from core_gui_atomistic.atomic_model import AtomicModel -from src_gui4dft.utils.voronoi import VoronoiAnalisis import numpy as np +from core_atomistic_qt.guiopenglbase import GuiOpenGLBase +from core_atomistic.atomic_model import AtomicModel +from src_gui4dft.utils.voronoi import VoronoiAnalisis + class GuiOpenGL(GuiOpenGLBase): def __init__(self, parent=None): diff --git a/src/src_gui4dft/qtbased/image3dexporter.py b/src/src_gui4dft/qtbased/image3dexporter.py index 744a9c3..312bf04 100644 --- a/src/src_gui4dft/qtbased/image3dexporter.py +++ b/src/src_gui4dft/qtbased/image3dexporter.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -from PySide2.QtWidgets import QMainWindow -from PySide2.QtCore import QSize +from qtpy.QtWidgets import QMainWindow +from qtpy.QtCore import QSize from src_gui4dft.ui.image3D import Ui_MainWindow as Ui_image3D diff --git a/src/src_gui4dft/qtbased/mainform.py b/src/src_gui4dft/qtbased/mainform.py index 179eccf..b2ee079 100644 --- a/src/src_gui4dft/qtbased/mainform.py +++ b/src/src_gui4dft/qtbased/mainform.py @@ -13,8 +13,19 @@ import matplotlib.pyplot as plt import numpy as np -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel +from qtpy.QtCore import QLocale, QSettings, Qt, QSize +from qtpy.QtGui import QColor, QIcon, QImage, QKeySequence, QPixmap, QStandardItem, QStandardItemModel +from qtpy.QtWidgets import QAction, QDialog, QFileDialog, QMessageBox, QColorDialog +from qtpy.QtWidgets import QDoubleSpinBox, QMainWindow, QShortcut, QTableWidgetItem, QTreeWidgetItem +from qtpy.QtWidgets import QTreeWidgetItemIterator + +from ase.build import molecule, bulk + +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers + from src_gui4dft.models.capedswcnt import CapedSWNT from src_gui4dft.models.bint import BiNT from src_gui4dft.models.hexagonal_plane import HexagonalPlane, HexagonalPlaneHex @@ -24,36 +35,22 @@ from src_gui4dft.models.gaussiancube import GaussianCube from src_gui4dft.models.volumericdata import VolumericData from src_gui4dft.models.xsf import XSF - -from PySide2.QtCore import QLocale, QSettings, Qt, QSize -from PySide2.QtGui import QColor, QIcon, QImage, QKeySequence, QPixmap, QStandardItem, QStandardItemModel -from PySide2.QtWidgets import QAction, QDialog, QFileDialog, QMessageBox, QColorDialog -from PySide2.QtWidgets import QDoubleSpinBox, QMainWindow, QShortcut, QTableWidgetItem, QTreeWidgetItem -from PySide2.QtWidgets import QTreeWidgetItemIterator from src_gui4dft.qtbased.image3dexporter import Image3Dexporter - from src_gui4dft.program.siesta import TSIESTA -import src_gui4dft.program.crystal as CRYSTAL # model_0d_to_d12, model_1d_to_d12, model_2d_to_d12, model_3d_to_d12 +import src_gui4dft.program.crystal as CRYSTAL # model_0d_to_d12, model_1d_to_d12, model_2d_to_d12, model_3d_to_d12 from src_gui4dft.program.qe import model_to_qe_pw from src_gui4dft.program.wien import model_to_wien_struct from src_gui4dft.program.vasp import TVASP, vasp_dos, model_to_vasp_poscar from src_gui4dft.program.dftb import model_to_dftb_d0 - from src_gui4dft.program import ase - from src_gui4dft.utils.importer_exporter import ImporterExporter from src_gui4dft.utils.electronic_prop_reader import read_siesta_bands, dos_from_file -from core_gui_atomistic.periodic_table import TPeriodTable from src_gui4dft.program.fdfdata import TFDFFile from src_gui4dft.utils.calculators import Calculators as Calculator from src_gui4dft.utils.calculators import gaps -from core_gui_atomistic import helpers - from src_gui4dft.ui.about import Ui_DialogAbout as Ui_about from src_gui4dft.ui.form import Ui_MainWindow as Ui_form -from ase.build import molecule, bulk - sys.path.append('') is_with_figure = True @@ -3257,7 +3254,7 @@ def create_swnt(self): model = CapedSWNT(n, m, leng, cells, tube_type, dist1, angle1, dist2, angle2) if tube_type == 3: - model = SWGNT(n, m, leng, cells) + model = SWGNT(n, m, leng) self.models.append(model) self.plot_model(-1) diff --git a/src/src_gui4dft/ui/form.py b/src/src_gui4dft/ui/form.py index ba55bbf..74339d0 100644 --- a/src/src_gui4dft/ui/form.py +++ b/src/src_gui4dft/ui/form.py @@ -12,8 +12,8 @@ from qtpy.QtGui import * from qtpy.QtWidgets import * -from core_gui_atomistic_qt.pyqtgraphwidget import PyqtGraphWidget -from core_gui_atomistic_qt.pyqtgraphwidgetimage import PyqtGraphWidgetImage +from core_atomistic_qt.pyqtgraphwidget import PyqtGraphWidget +from core_atomistic_qt.pyqtgraphwidgetimage import PyqtGraphWidgetImage from src_gui4dft.qtbased.guiopengl import GuiOpenGL diff --git a/src/src_gui4dft/utils/calculators.py b/src/src_gui4dft/utils/calculators.py index 2ce225a..eb5e105 100644 --- a/src/src_gui4dft/utils/calculators.py +++ b/src/src_gui4dft/utils/calculators.py @@ -11,9 +11,9 @@ from scipy.spatial import ConvexHull from scipy.spatial import Voronoi -from core_gui_atomistic import helpers -from core_gui_atomistic.atom import Atom -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic import helpers def gaps(bands, emaxf, eminf, homo, lumo) -> Tuple[float, float]: diff --git a/src/src_gui4dft/utils/electronic_prop_reader.py b/src/src_gui4dft/utils/electronic_prop_reader.py index 7d8a769..59c1dd9 100644 --- a/src/src_gui4dft/utils/electronic_prop_reader.py +++ b/src/src_gui4dft/utils/electronic_prop_reader.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -from core_gui_atomistic import helpers -import numpy as np import os +import numpy as np +from core_atomistic import helpers def dos_from_file(filename, n=2, n_lines=0): diff --git a/src/src_gui4dft/utils/importer_exporter.py b/src/src_gui4dft/utils/importer_exporter.py index 13b0dca..c55744c 100644 --- a/src/src_gui4dft/utils/importer_exporter.py +++ b/src/src_gui4dft/utils/importer_exporter.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- import os -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel +from core_atomistic import helpers +from core_atomistic.project_file import ProjectFile from src_gui4dft.program.vasp import fermi_energy_from_doscar, atoms_from_POSCAR from src_gui4dft.program.fdfdata import TFDFFile from src_gui4dft.program.siesta import TSIESTA @@ -12,8 +14,6 @@ from src_gui4dft.program.wien import atoms_from_struct from src_gui4dft.program.dftb import atoms_from_gen from src_gui4dft.program.lammps import atoms_trajectory_step -from core_gui_atomistic import helpers -from core_gui_atomistic.gui4dft_project_file import GUI4dftProjectFile from src_gui4dft.models.gaussiancube import GaussianCube from src_gui4dft.models.xsf import XSF @@ -81,7 +81,7 @@ def import_from_file(filename, fl='all', prop=False): models = atoms_trajectory_step(filename) elif file_format == "project": - models = GUI4dftProjectFile.project_file_reader(filename) + models = ProjectFile.project_file_reader(filename) else: print("Wrong format") @@ -100,7 +100,7 @@ def export_to_file(model, f_name): # pragma: no cover if f_name.endswith(".xyz"): text = TSIESTA.to_siesta_xyz_data(model) if f_name.endswith(".data"): - text = GUI4dftProjectFile.project_file_writer(model) + text = ProjectFile.project_file_writer(model) helpers.write_text_to_file(f_name, text) @staticmethod diff --git a/tests/conftest.py b/tests/conftest.py index 091fa69..406ae81 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,6 @@ from pathlib import Path -from core_gui_atomistic.atomic_model import AtomicModel -from core_gui_atomistic.periodic_table import TPeriodTable +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable import pytest diff --git a/tests/core_gui_atomistic/conftest.py b/tests/core_gui_atomistic/conftest.py deleted file mode 100644 index 29a0dac..0000000 --- a/tests/core_gui_atomistic/conftest.py +++ /dev/null @@ -1,8 +0,0 @@ -from pathlib import Path -from core_gui_atomistic.periodic_table import TPeriodTable -import pytest - - -@pytest.fixture -def period_table() -> TPeriodTable: - return TPeriodTable() diff --git a/tests/gui4dft/test_importer.py b/tests/gui4dft/test_importer.py index e7401bb..20551cc 100644 --- a/tests/gui4dft/test_importer.py +++ b/tests/gui4dft/test_importer.py @@ -1,7 +1,7 @@ import numpy as np +from core_atomistic import helpers from src_gui4dft.utils.importer_exporter import ImporterExporter -from core_gui_atomistic import helpers def test_check_format(tests_path): diff --git a/tests/gui4dft/test_siesta.py b/tests/gui4dft/test_siesta.py index 1d6ef2e..7fb9e85 100644 --- a/tests/gui4dft/test_siesta.py +++ b/tests/gui4dft/test_siesta.py @@ -1,8 +1,7 @@ import math import numpy as np - +from core_atomistic.helpers import lat_vectors_from_params from src_gui4dft.program.siesta import TSIESTA -from core_gui_atomistic.helpers import lat_vectors_from_params def test_lattice_constant(tests_path): diff --git a/tests/gui4dft_opengl/conftest.py b/tests/gui4dft_opengl/conftest.py index 8a9ad1c..883f330 100644 --- a/tests/gui4dft_opengl/conftest.py +++ b/tests/gui4dft_opengl/conftest.py @@ -1,8 +1,8 @@ +from core_atomistic_qt.pyqtgraphwidget import PyqtGraphWidget +from core_atomistic_qt.pyqtgraphwidgetimage import PyqtGraphWidgetImage from src_gui4dft.qtbased.guiopengl import GuiOpenGL -from core_gui_atomistic_qt.pyqtgraphwidget import PyqtGraphWidget -from core_gui_atomistic_qt.pyqtgraphwidgetimage import PyqtGraphWidgetImage from src_gui4dft.qtbased.mainform import MainForm -from PySide2.QtCore import QCoreApplication, Qt +from qtpy.QtCore import QCoreApplication, Qt import pytest diff --git a/tests/gui4dft_opengl/test_guiopengl.py b/tests/gui4dft_opengl/test_guiopengl.py index 28af242..3a2365e 100644 --- a/tests/gui4dft_opengl/test_guiopengl.py +++ b/tests/gui4dft_opengl/test_guiopengl.py @@ -1,4 +1,4 @@ -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel def test_guiopengl(guiopengl_widget): diff --git a/tests_core/conftest.py b/tests_core/conftest.py new file mode 100644 index 0000000..2478632 --- /dev/null +++ b/tests_core/conftest.py @@ -0,0 +1,14 @@ +from pathlib import Path +from core_atomistic.periodic_table import TPeriodTable + +import pytest + + +@pytest.fixture +def tests_path() -> Path: + return Path(__file__).parent + + +@pytest.fixture +def period_table() -> TPeriodTable: + return TPeriodTable() diff --git a/tests_core/core_atomistic/conftest.py b/tests_core/core_atomistic/conftest.py new file mode 100644 index 0000000..40b35d6 --- /dev/null +++ b/tests_core/core_atomistic/conftest.py @@ -0,0 +1,21 @@ +from core_atomistic.atomic_model import AtomicModel +import pytest + + +@pytest.fixture +def h2o_model() -> AtomicModel: + # x y z let charge + atoms = [[0.0, 0.0, 0.0, "O", 8], [-1.0, 0.0, 0.0, "H", 1], [1.0, 0.0, 0.0, "H", 1]] + return AtomicModel(atoms) + + +@pytest.fixture +def swnt_33() -> AtomicModel: + # x y z let charge + atoms = [[-0.70056811, 1.92479506, - 0.61920816, "C", 6], [-1.31663736, - 1.56910731, - 0.61920816, "C", 6], + [-2.01720547, - 0.35568775, - 0.61920816, "C", 6], [2.01720547, - 0.35568775, - 0.61920816, "C", 6], + [1.31663736, - 1.56910731, - 0.61920816, "C", 6], [0.70056811, 1.92479506, - 0.61920816, "C", 6], + [-1.31663736, 1.56910731, 0.61920816, "C", 6], [-0.70056811, - 1.92479506, 0.61920816, "C", 6], + [-2.01720547, 0.35568775, 0.61920816, "C", 6], [2.01720547, 0.35568775, 0.61920816, "C", 6], + [0.70056811, - 1.92479506, 0.61920816, "C", 6], [1.31663736, 1.56910731, 0.61920816, "C", 6]] + return AtomicModel(atoms) diff --git a/tests/core_gui_atomistic/test_atom.py b/tests_core/core_atomistic/test_atom.py similarity index 88% rename from tests/core_gui_atomistic/test_atom.py rename to tests_core/core_atomistic/test_atom.py index 0463fe8..8fcdf5a 100644 --- a/tests/core_gui_atomistic/test_atom.py +++ b/tests_core/core_atomistic/test_atom.py @@ -1,4 +1,4 @@ -from core_gui_atomistic.atom import Atom +from core_atomistic.atom import Atom def test_atom(): diff --git a/tests/core_gui_atomistic/test_atomic_model.py b/tests_core/core_atomistic/test_atomic_model.py similarity index 98% rename from tests/core_gui_atomistic/test_atomic_model.py rename to tests_core/core_atomistic/test_atomic_model.py index 9e6e51c..ccb841f 100644 --- a/tests/core_gui_atomistic/test_atomic_model.py +++ b/tests_core/core_atomistic/test_atomic_model.py @@ -1,4 +1,4 @@ -from core_gui_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel import pytest import numpy as np from copy import copy, deepcopy diff --git a/tests/core_gui_atomistic/test_helpers.py b/tests_core/core_atomistic/test_helpers.py similarity index 96% rename from tests/core_gui_atomistic/test_helpers.py rename to tests_core/core_atomistic/test_helpers.py index e8e9ff0..bbba4d8 100644 --- a/tests/core_gui_atomistic/test_helpers.py +++ b/tests_core/core_atomistic/test_helpers.py @@ -1,6 +1,6 @@ import numpy as np -from core_gui_atomistic import helpers +from core_atomistic import helpers def test_helpers_spacedel(): diff --git a/tests/core_gui_atomistic/test_periodic_table.py b/tests_core/core_atomistic/test_periodic_table.py similarity index 100% rename from tests/core_gui_atomistic/test_periodic_table.py rename to tests_core/core_atomistic/test_periodic_table.py diff --git a/tests/core_gui_atomistic_qt/conftest.py b/tests_core/core_atomistic_qt/conftest.py similarity index 59% rename from tests/core_gui_atomistic_qt/conftest.py rename to tests_core/core_atomistic_qt/conftest.py index 461c784..121aa19 100644 --- a/tests/core_gui_atomistic_qt/conftest.py +++ b/tests_core/core_atomistic_qt/conftest.py @@ -1,5 +1,6 @@ -from core_gui_atomistic_qt.pyqtgraphwidget import PyqtGraphWidget -from core_gui_atomistic_qt.pyqtgraphwidgetimage import PyqtGraphWidgetImage +from core_atomistic_qt.pyqtgraphwidget import PyqtGraphWidget +from core_atomistic_qt.pyqtgraphwidgetimage import PyqtGraphWidgetImage +from qtpy.QtWidgets import QApplication import pytest @@ -15,6 +16,18 @@ def factory_function(): return factory_function +@pytest.fixture +def qsapp(qapp_session) -> QApplication: + yield qapp_session + qapp_session.processEvents() + qapp_session.closeAllWindows() + + +@pytest.fixture(scope='session') +def qapp_session(qapp): + return qapp + + @pytest.fixture def graph_widget(get_graph_widget): return get_graph_widget() diff --git a/tests/core_gui_atomistic_qt/test_pygrimagewidget.py b/tests_core/core_atomistic_qt/test_pygrimagewidget.py similarity index 100% rename from tests/core_gui_atomistic_qt/test_pygrimagewidget.py rename to tests_core/core_atomistic_qt/test_pygrimagewidget.py diff --git a/tests/core_gui_atomistic_qt/test_pygrwidget.py b/tests_core/core_atomistic_qt/test_pygrwidget.py similarity index 100% rename from tests/core_gui_atomistic_qt/test_pygrwidget.py rename to tests_core/core_atomistic_qt/test_pygrwidget.py From db884d527ec8792af2663d391bad5abe93161171 Mon Sep 17 00:00:00 2001 From: Sergey Sozykin Date: Sat, 6 Jan 2024 21:18:23 +0500 Subject: [PATCH 3/7] renames in core_atomistic_qt module --- .github/workflows/python-app.yml | 26 ++++++- .gitignore | 3 +- src/gui4dft.py | 2 +- src/{src_gui4dft => }/models/bint.py | 4 +- src/{src_gui4dft => }/models/bn_plane.py | 2 +- src/{src_gui4dft => }/models/capedswcnt.py | 6 +- .../models/caps/cap-10-0.xyz | 0 .../models/caps/cap-10-10.xyz | 0 .../models/caps/cap-19-0.xyz | 0 src/{src_gui4dft => }/models/caps/cap-6-6.xyz | 0 .../models/cells/biphenylene.fdf | 0 src/{src_gui4dft => }/models/cells/irida.fdf | 0 .../models/cells/psi-graphene.fdf | 0 src/{src_gui4dft => }/models/cells/tpdhg.fdf | 0 src/{src_gui4dft => }/models/gaussiancube.py | 8 +-- src/{src_gui4dft => }/models/graphene.py | 2 +- .../models/hexagonal_plane.py | 4 +- src/{src_gui4dft => }/models/meta_graphene.py | 4 +- src/{src_gui4dft => }/models/swgnt.py | 4 +- src/{src_gui4dft => }/models/swnt.py | 4 +- src/{src_gui4dft => }/models/volumericdata.py | 2 +- .../models/volumericdatablock.py | 0 src/{src_gui4dft => }/models/xsf.py | 10 +-- src/{src_gui4dft => }/program/ase.py | 8 +-- src/{src_gui4dft => }/program/crystal.py | 6 +- src/{src_gui4dft => }/program/dftb.py | 6 +- src/{src_gui4dft => }/program/fdfdata.py | 4 +- src/{src_gui4dft => }/program/firefly.py | 2 +- src/{src_gui4dft => }/program/lammps.py | 2 +- src/{src_gui4dft => }/program/qe.py | 6 +- src/{src_gui4dft => }/program/siesta.py | 9 ++- src/{src_gui4dft => }/program/vasp.py | 10 +-- src/{src_gui4dft => }/program/wien.py | 4 +- src/{src_gui4dft => }/qtbased/guiopengl.py | 6 +- .../qtbased/image3dexporter.py | 2 +- .../qtbased/images/Close.png | Bin src/{src_gui4dft => }/qtbased/images/Open.png | Bin .../qtbased/images/RedoX.png | Bin .../qtbased/images/RedoY.png | Bin .../qtbased/images/RedoZ.png | Bin .../qtbased/images/Save2D.png | Bin .../qtbased/images/Save3D.png | Bin .../qtbased/images/UndoX.png | Bin .../qtbased/images/UndoY.png | Bin .../qtbased/images/UndoZ.png | Bin src/{src_gui4dft => }/qtbased/images/down.png | Bin src/{src_gui4dft => }/qtbased/images/ico.png | Bin src/{src_gui4dft => }/qtbased/images/left.png | Bin .../qtbased/images/murnaghan.png | Bin .../qtbased/images/murnaghanbirch.png | Bin .../qtbased/images/parabola.png | Bin .../qtbased/images/right.png | Bin src/{src_gui4dft => }/qtbased/images/up.png | Bin src/{src_gui4dft => }/qtbased/mainform.py | 67 +++++++++--------- src/{src_gui4dft => }/ui/about.py | 0 src/{src_gui4dft => }/ui/about.ui | 0 src/{src_gui4dft => }/ui/form-v1.x.ui | 0 src/{src_gui4dft => }/ui/form.py | 6 +- src/{src_gui4dft => }/ui/image3D.py | 2 +- src/{src_gui4dft => }/ui/image3D.ui | 0 .../ui/runGUIgenerator-second.bat | 0 src/{src_gui4dft => }/ui/runGUIgenerator.bat | 0 src/{src_gui4dft => }/utils/calculators.py | 6 +- .../utils/electronic_prop_reader.py | 2 +- .../utils/importer_exporter.py | 30 ++++---- src/{src_gui4dft => }/utils/voronoi.py | 0 .../atom.py | 2 +- .../atomic_model.py | 6 +- .../helpers.py | 0 .../periodic_table.py | 0 .../project_file.py | 2 +- .../opengl_base.py | 4 +- .../qt_graph.py | 0 .../qt_image.py | 0 tests/conftest.py | 4 +- tests/gui4dft/dftb.py | 2 +- tests/gui4dft/test_calculators.py | 2 +- tests/gui4dft/test_crystal.py | 4 +- tests/gui4dft/test_electronic_prop.py | 8 +-- tests/gui4dft/test_fdf.py | 2 +- tests/gui4dft/test_firefly.py | 4 +- tests/gui4dft/test_importer.py | 6 +- tests/gui4dft/test_models.py | 8 +-- tests/gui4dft/test_qe.py | 2 +- tests/gui4dft/test_siesta.py | 4 +- tests/gui4dft/test_vasp.py | 2 +- tests/gui4dft/test_volumeric_model.py | 6 +- tests/gui4dft/test_wien.py | 2 +- tests/gui4dft_opengl/conftest.py | 8 +-- tests/gui4dft_opengl/test_guiopengl.py | 2 +- tests_core/core_atomistic/conftest.py | 2 +- tests_core/core_atomistic/test_atom.py | 2 +- .../core_atomistic/test_atomic_model.py | 2 +- tests_core/core_atomistic/test_helpers.py | 2 +- tests_core/core_atomistic_qt/conftest.py | 4 +- 95 files changed, 184 insertions(+), 167 deletions(-) rename src/{src_gui4dft => }/models/bint.py (94%) rename src/{src_gui4dft => }/models/bn_plane.py (77%) rename src/{src_gui4dft => }/models/capedswcnt.py (98%) rename src/{src_gui4dft => }/models/caps/cap-10-0.xyz (100%) rename src/{src_gui4dft => }/models/caps/cap-10-10.xyz (100%) rename src/{src_gui4dft => }/models/caps/cap-19-0.xyz (100%) rename src/{src_gui4dft => }/models/caps/cap-6-6.xyz (100%) rename src/{src_gui4dft => }/models/cells/biphenylene.fdf (100%) rename src/{src_gui4dft => }/models/cells/irida.fdf (100%) rename src/{src_gui4dft => }/models/cells/psi-graphene.fdf (100%) rename src/{src_gui4dft => }/models/cells/tpdhg.fdf (100%) rename src/{src_gui4dft => }/models/gaussiancube.py (93%) rename src/{src_gui4dft => }/models/graphene.py (76%) rename src/{src_gui4dft => }/models/hexagonal_plane.py (97%) rename src/{src_gui4dft => }/models/meta_graphene.py (88%) rename src/{src_gui4dft => }/models/swgnt.py (92%) rename src/{src_gui4dft => }/models/swnt.py (93%) rename src/{src_gui4dft => }/models/volumericdata.py (99%) rename src/{src_gui4dft => }/models/volumericdatablock.py (100%) rename src/{src_gui4dft => }/models/xsf.py (94%) rename src/{src_gui4dft => }/program/ase.py (96%) rename src/{src_gui4dft => }/program/crystal.py (97%) rename src/{src_gui4dft => }/program/dftb.py (92%) rename src/{src_gui4dft => }/program/fdfdata.py (97%) rename src/{src_gui4dft => }/program/firefly.py (82%) rename src/{src_gui4dft => }/program/lammps.py (97%) rename src/{src_gui4dft => }/program/qe.py (98%) rename src/{src_gui4dft => }/program/siesta.py (99%) rename src/{src_gui4dft => }/program/vasp.py (96%) rename src/{src_gui4dft => }/program/wien.py (97%) rename src/{src_gui4dft => }/qtbased/guiopengl.py (98%) rename src/{src_gui4dft => }/qtbased/image3dexporter.py (87%) rename src/{src_gui4dft => }/qtbased/images/Close.png (100%) rename src/{src_gui4dft => }/qtbased/images/Open.png (100%) rename src/{src_gui4dft => }/qtbased/images/RedoX.png (100%) rename src/{src_gui4dft => }/qtbased/images/RedoY.png (100%) rename src/{src_gui4dft => }/qtbased/images/RedoZ.png (100%) rename src/{src_gui4dft => }/qtbased/images/Save2D.png (100%) rename src/{src_gui4dft => }/qtbased/images/Save3D.png (100%) rename src/{src_gui4dft => }/qtbased/images/UndoX.png (100%) rename src/{src_gui4dft => }/qtbased/images/UndoY.png (100%) rename src/{src_gui4dft => }/qtbased/images/UndoZ.png (100%) rename src/{src_gui4dft => }/qtbased/images/down.png (100%) rename src/{src_gui4dft => }/qtbased/images/ico.png (100%) rename src/{src_gui4dft => }/qtbased/images/left.png (100%) rename src/{src_gui4dft => }/qtbased/images/murnaghan.png (100%) rename src/{src_gui4dft => }/qtbased/images/murnaghanbirch.png (100%) rename src/{src_gui4dft => }/qtbased/images/parabola.png (100%) rename src/{src_gui4dft => }/qtbased/images/right.png (100%) rename src/{src_gui4dft => }/qtbased/images/up.png (100%) rename src/{src_gui4dft => }/qtbased/mainform.py (98%) rename src/{src_gui4dft => }/ui/about.py (100%) rename src/{src_gui4dft => }/ui/about.ui (100%) rename src/{src_gui4dft => }/ui/form-v1.x.ui (100%) rename src/{src_gui4dft => }/ui/form.py (99%) rename src/{src_gui4dft => }/ui/image3D.py (96%) rename src/{src_gui4dft => }/ui/image3D.ui (100%) rename src/{src_gui4dft => }/ui/runGUIgenerator-second.bat (100%) rename src/{src_gui4dft => }/ui/runGUIgenerator.bat (100%) rename src/{src_gui4dft => }/utils/calculators.py (97%) rename src/{src_gui4dft => }/utils/electronic_prop_reader.py (98%) rename src/{src_gui4dft => }/utils/importer_exporter.py (83%) rename src/{src_gui4dft => }/utils/voronoi.py (100%) rename {src/core_atomistic => src_core_atomistic}/atom.py (97%) rename {src/core_atomistic => src_core_atomistic}/atomic_model.py (99%) rename {src/core_atomistic => src_core_atomistic}/helpers.py (100%) rename {src/core_atomistic => src_core_atomistic}/periodic_table.py (100%) rename {src/core_atomistic => src_core_atomistic}/project_file.py (96%) rename src/core_atomistic_qt/guiopenglbase.py => src_core_atomistic_qt/opengl_base.py (99%) rename src/core_atomistic_qt/pyqtgraphwidget.py => src_core_atomistic_qt/qt_graph.py (100%) rename src/core_atomistic_qt/pyqtgraphwidgetimage.py => src_core_atomistic_qt/qt_image.py (100%) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 225c324..4c720d6 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -37,6 +37,26 @@ jobs: # exit-zero treats all errors as warnings. black defaults to 88 characters flake8 . --exclude src/ui/*, --count --exit-zero --max-complexity=18 --max-line-length=120 --statistics + test-core: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest pytest-qt + pip install -r requirements.txt + pip install -r requirements-dev.txt + - name: Test with pytest + run: | + python -m pytest tests_core --cov=src/core_atomistic --cov-report=xml --cov-report=term-missing --ignore=tests_core/core_atomistic_qt + test-linux: runs-on: ubuntu-latest @@ -55,7 +75,7 @@ jobs: pip install -r requirements-dev.txt - name: Test with pytest run: | - python -m pytest tests --cov=src/core_gui_atomistic --cov-report=xml --cov-report=term-missing --ignore=tests/gui4dft_opengl --ignore=tests/core_gui_atomistic_qt + python -m pytest tests --cov=src/src_gui4dft --cov-report=xml --cov-report=term-missing --ignore=tests/gui4dft_opengl - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: @@ -86,7 +106,7 @@ jobs: pip install -r requirements-dev.txt - name: Test with pytest run: | - python -m pytest tests --color=yes --cov=src/core_gui_atomistic --cov=src/src_gui4dft --cov-report=xml --cov-report=term-missing --ignore=tests/gui4dft_opengl + python -m pytest tests --color=yes --cov=src/core_atomistic --cov=src/src_gui4dft --cov-report=xml --cov-report=term-missing --ignore=tests/gui4dft_opengl test-mac: @@ -105,4 +125,4 @@ jobs: pip install -r requirements-dev.txt - name: Test with pytest run: | - python -m pytest tests --color=yes --cov=src/core_gui_atomistic --cov=src/src_gui4dft --cov-report=xml --cov-report=term-missing --ignore=tests/gui4dft_opengl + python -m pytest tests --color=yes --cov=src/core_atomistic --cov=src/src_gui4dft --cov-report=xml --cov-report=term-missing --ignore=tests/gui4dft_opengl diff --git a/.gitignore b/.gitignore index da18970..182fe90 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ executable/build/ executable/gui4dft.spec tests/.coverage .coverage -coverage.xml \ No newline at end of file +coverage.xml +/tests_core/core_atomistic/.pytest_cache diff --git a/src/gui4dft.py b/src/gui4dft.py index 38a97d5..a573714 100644 --- a/src/gui4dft.py +++ b/src/gui4dft.py @@ -12,7 +12,7 @@ from qtpy.QtGui import QIcon from qtpy.QtWidgets import QApplication -from src_gui4dft.qtbased.mainform import MainForm +from qtbased.mainform import MainForm sys.path.append('.') diff --git a/src/src_gui4dft/models/bint.py b/src/models/bint.py similarity index 94% rename from src/src_gui4dft/models/bint.py rename to src/models/bint.py index 8f11cbe..779a9b5 100644 --- a/src/src_gui4dft/models/bint.py +++ b/src/models/bint.py @@ -2,8 +2,8 @@ import math -from core_atomistic.atom import Atom -from core_atomistic.atomic_model import AtomicModel as TAtomicModel +from src_core_atomistic.atom import Atom +from src_core_atomistic.atomic_model import AtomicModel as TAtomicModel class BiNT(TAtomicModel): diff --git a/src/src_gui4dft/models/bn_plane.py b/src/models/bn_plane.py similarity index 77% rename from src/src_gui4dft/models/bn_plane.py rename to src/models/bn_plane.py index 992bab4..f7ec166 100644 --- a/src/src_gui4dft/models/bn_plane.py +++ b/src/models/bn_plane.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from src_gui4dft.models.hexagonal_plane import HexagonalPlane +from models.hexagonal_plane import HexagonalPlane class BNplane(HexagonalPlane): diff --git a/src/src_gui4dft/models/capedswcnt.py b/src/models/capedswcnt.py similarity index 98% rename from src/src_gui4dft/models/capedswcnt.py rename to src/models/capedswcnt.py index 5cb0dbe..cc731e2 100644 --- a/src/src_gui4dft/models/capedswcnt.py +++ b/src/models/capedswcnt.py @@ -5,9 +5,9 @@ import numpy as np from pathlib import Path -from core_atomistic.atom import Atom -from core_atomistic.atomic_model import AtomicModel as TAtomicModel -from src_gui4dft.models.swnt import SWNT +from src_core_atomistic.atom import Atom +from src_core_atomistic.atomic_model import AtomicModel as TAtomicModel +from models.swnt import SWNT class CapedSWNT(TAtomicModel): diff --git a/src/src_gui4dft/models/caps/cap-10-0.xyz b/src/models/caps/cap-10-0.xyz similarity index 100% rename from src/src_gui4dft/models/caps/cap-10-0.xyz rename to src/models/caps/cap-10-0.xyz diff --git a/src/src_gui4dft/models/caps/cap-10-10.xyz b/src/models/caps/cap-10-10.xyz similarity index 100% rename from src/src_gui4dft/models/caps/cap-10-10.xyz rename to src/models/caps/cap-10-10.xyz diff --git a/src/src_gui4dft/models/caps/cap-19-0.xyz b/src/models/caps/cap-19-0.xyz similarity index 100% rename from src/src_gui4dft/models/caps/cap-19-0.xyz rename to src/models/caps/cap-19-0.xyz diff --git a/src/src_gui4dft/models/caps/cap-6-6.xyz b/src/models/caps/cap-6-6.xyz similarity index 100% rename from src/src_gui4dft/models/caps/cap-6-6.xyz rename to src/models/caps/cap-6-6.xyz diff --git a/src/src_gui4dft/models/cells/biphenylene.fdf b/src/models/cells/biphenylene.fdf similarity index 100% rename from src/src_gui4dft/models/cells/biphenylene.fdf rename to src/models/cells/biphenylene.fdf diff --git a/src/src_gui4dft/models/cells/irida.fdf b/src/models/cells/irida.fdf similarity index 100% rename from src/src_gui4dft/models/cells/irida.fdf rename to src/models/cells/irida.fdf diff --git a/src/src_gui4dft/models/cells/psi-graphene.fdf b/src/models/cells/psi-graphene.fdf similarity index 100% rename from src/src_gui4dft/models/cells/psi-graphene.fdf rename to src/models/cells/psi-graphene.fdf diff --git a/src/src_gui4dft/models/cells/tpdhg.fdf b/src/models/cells/tpdhg.fdf similarity index 100% rename from src/src_gui4dft/models/cells/tpdhg.fdf rename to src/models/cells/tpdhg.fdf diff --git a/src/src_gui4dft/models/gaussiancube.py b/src/models/gaussiancube.py similarity index 93% rename from src/src_gui4dft/models/gaussiancube.py rename to src/models/gaussiancube.py index 880dfa0..aaf3182 100644 --- a/src/src_gui4dft/models/gaussiancube.py +++ b/src/models/gaussiancube.py @@ -4,10 +4,10 @@ import os import math import numpy as np -from core_atomistic.atomic_model import AtomicModel as TAtomicModel -from core_atomistic.periodic_table import TPeriodTable -from src_gui4dft.models.volumericdatablock import VolumericDataBlock -from src_gui4dft.models.volumericdata import VolumericData +from src_core_atomistic.atomic_model import AtomicModel as TAtomicModel +from src_core_atomistic.periodic_table import TPeriodTable +from models.volumericdatablock import VolumericDataBlock +from models.volumericdata import VolumericData diff --git a/src/src_gui4dft/models/graphene.py b/src/models/graphene.py similarity index 76% rename from src/src_gui4dft/models/graphene.py rename to src/models/graphene.py index 638fb7c..8a349c8 100644 --- a/src/src_gui4dft/models/graphene.py +++ b/src/models/graphene.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from src_gui4dft.models.hexagonal_plane import HexagonalPlane +from models.hexagonal_plane import HexagonalPlane class Graphene(HexagonalPlane): diff --git a/src/src_gui4dft/models/hexagonal_plane.py b/src/models/hexagonal_plane.py similarity index 97% rename from src/src_gui4dft/models/hexagonal_plane.py rename to src/models/hexagonal_plane.py index fcd0c84..6c31615 100644 --- a/src/src_gui4dft/models/hexagonal_plane.py +++ b/src/models/hexagonal_plane.py @@ -2,8 +2,8 @@ import math import numpy as np -from core_atomistic.atom import Atom -from core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.atom import Atom +from src_core_atomistic.atomic_model import AtomicModel class HexagonalPlaneHex(AtomicModel): diff --git a/src/src_gui4dft/models/meta_graphene.py b/src/models/meta_graphene.py similarity index 88% rename from src/src_gui4dft/models/meta_graphene.py rename to src/models/meta_graphene.py index c9234a5..fda9b86 100644 --- a/src/src_gui4dft/models/meta_graphene.py +++ b/src/models/meta_graphene.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -from core_atomistic.atomic_model import AtomicModel -from src_gui4dft.utils.importer_exporter import ImporterExporter +from src_core_atomistic.atomic_model import AtomicModel +from utils.importer_exporter import ImporterExporter from pathlib import Path diff --git a/src/src_gui4dft/models/swgnt.py b/src/models/swgnt.py similarity index 92% rename from src/src_gui4dft/models/swgnt.py rename to src/models/swgnt.py index 4063e53..f7636d3 100644 --- a/src/src_gui4dft/models/swgnt.py +++ b/src/models/swgnt.py @@ -2,8 +2,8 @@ import math -from core_atomistic.atom import Atom -from core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.atom import Atom +from src_core_atomistic.atomic_model import AtomicModel class SWGNT(AtomicModel): diff --git a/src/src_gui4dft/models/swnt.py b/src/models/swnt.py similarity index 93% rename from src/src_gui4dft/models/swnt.py rename to src/models/swnt.py index 691e029..8359978 100644 --- a/src/src_gui4dft/models/swnt.py +++ b/src/models/swnt.py @@ -3,8 +3,8 @@ import math import numpy as np -from core_atomistic import helpers -from src_gui4dft.models.graphene import Graphene +from src_core_atomistic import helpers +from models.graphene import Graphene class SWNT(Graphene): diff --git a/src/src_gui4dft/models/volumericdata.py b/src/models/volumericdata.py similarity index 99% rename from src/src_gui4dft/models/volumericdata.py rename to src/models/volumericdata.py index 088e04f..2317b6d 100644 --- a/src/src_gui4dft/models/volumericdata.py +++ b/src/models/volumericdata.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from copy import deepcopy -from core_atomistic import helpers +from src_core_atomistic import helpers import numpy as np import skimage if skimage.__version__ >= '0.17.2': diff --git a/src/src_gui4dft/models/volumericdatablock.py b/src/models/volumericdatablock.py similarity index 100% rename from src/src_gui4dft/models/volumericdatablock.py rename to src/models/volumericdatablock.py diff --git a/src/src_gui4dft/models/xsf.py b/src/models/xsf.py similarity index 94% rename from src/src_gui4dft/models/xsf.py rename to src/models/xsf.py index 7b3ca61..0123c79 100644 --- a/src/src_gui4dft/models/xsf.py +++ b/src/models/xsf.py @@ -4,12 +4,12 @@ import os import numpy as np -from core_atomistic.atomic_model import AtomicModel as TAtomicModel -from core_atomistic.periodic_table import TPeriodTable -from core_atomistic import helpers +from src_core_atomistic.atomic_model import AtomicModel as TAtomicModel +from src_core_atomistic.periodic_table import TPeriodTable +from src_core_atomistic import helpers -from src_gui4dft.models.volumericdatablock import VolumericDataBlock -from src_gui4dft.models.volumericdata import VolumericData +from models.volumericdatablock import VolumericDataBlock +from models.volumericdata import VolumericData class XSF(VolumericData): diff --git a/src/src_gui4dft/program/ase.py b/src/program/ase.py similarity index 96% rename from src/src_gui4dft/program/ase.py rename to src/program/ase.py index 418a868..33922a9 100644 --- a/src/src_gui4dft/program/ase.py +++ b/src/program/ase.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- import numpy as np -from core_atomistic import helpers -from core_atomistic.atom import Atom -from core_atomistic.atomic_model import AtomicModel -from core_atomistic.periodic_table import TPeriodTable +from src_core_atomistic import helpers +from src_core_atomistic.atom import Atom +from src_core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.periodic_table import TPeriodTable def from_ase_atoms_to_atomic_model(ase_atoms): diff --git a/src/src_gui4dft/program/crystal.py b/src/program/crystal.py similarity index 97% rename from src/src_gui4dft/program/crystal.py rename to src/program/crystal.py index e7a7c4c..dfd2c6f 100644 --- a/src/src_gui4dft/program/crystal.py +++ b/src/program/crystal.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- from copy import deepcopy import numpy as np -from core_atomistic.atom import Atom -from core_atomistic.atomic_model import AtomicModel -from core_atomistic import helpers +from src_core_atomistic.atom import Atom +from src_core_atomistic.atomic_model import AtomicModel +from src_core_atomistic import helpers def model_0d_to_d12(model): diff --git a/src/src_gui4dft/program/dftb.py b/src/program/dftb.py similarity index 92% rename from src/src_gui4dft/program/dftb.py rename to src/program/dftb.py index b07ff14..b3a1300 100644 --- a/src/src_gui4dft/program/dftb.py +++ b/src/program/dftb.py @@ -4,9 +4,9 @@ import numpy as np -from core_atomistic.atomic_model import AtomicModel -from core_atomistic.periodic_table import TPeriodTable -from core_atomistic import helpers +from src_core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.periodic_table import TPeriodTable +from src_core_atomistic import helpers def model_to_dftb_d0(model: AtomicModel): diff --git a/src/src_gui4dft/program/fdfdata.py b/src/program/fdfdata.py similarity index 97% rename from src/src_gui4dft/program/fdfdata.py rename to src/program/fdfdata.py index 5db5b47..806d96f 100644 --- a/src/src_gui4dft/program/fdfdata.py +++ b/src/program/fdfdata.py @@ -2,8 +2,8 @@ import os from copy import deepcopy -from core_atomistic.helpers import text_between_lines -from src_gui4dft.program.siesta import TSIESTA +from src_core_atomistic.helpers import text_between_lines +from program.siesta import TSIESTA ################################################################## diff --git a/src/src_gui4dft/program/firefly.py b/src/program/firefly.py similarity index 82% rename from src/src_gui4dft/program/firefly.py rename to src/program/firefly.py index 24e3fcd..84d155d 100644 --- a/src/src_gui4dft/program/firefly.py +++ b/src/program/firefly.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Python 3 -from core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.atomic_model import AtomicModel def atomic_model_to_firefly_inp(model: AtomicModel) -> str: diff --git a/src/src_gui4dft/program/lammps.py b/src/program/lammps.py similarity index 97% rename from src/src_gui4dft/program/lammps.py rename to src/program/lammps.py index ce5fd05..dc9f9a2 100644 --- a/src/src_gui4dft/program/lammps.py +++ b/src/program/lammps.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import numpy as np -from core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.atomic_model import AtomicModel def atoms_trajectory_step(f_name): diff --git a/src/src_gui4dft/program/qe.py b/src/program/qe.py similarity index 98% rename from src/src_gui4dft/program/qe.py rename to src/program/qe.py index 9d54f03..62182f1 100644 --- a/src/src_gui4dft/program/qe.py +++ b/src/program/qe.py @@ -2,9 +2,9 @@ import math from copy import deepcopy import numpy as np -from core_atomistic import helpers -from core_atomistic.atom import Atom -from core_atomistic.atomic_model import AtomicModel +from src_core_atomistic import helpers +from src_core_atomistic.atom import Atom +from src_core_atomistic.atomic_model import AtomicModel def vectors_from_pwout(f_name): diff --git a/src/src_gui4dft/program/siesta.py b/src/program/siesta.py similarity index 99% rename from src/src_gui4dft/program/siesta.py rename to src/program/siesta.py index 7106111..ea2cd9d 100644 --- a/src/src_gui4dft/program/siesta.py +++ b/src/program/siesta.py @@ -1,14 +1,13 @@ # -*- coding: utf-8 -*- import os -import re import xml.etree.ElementTree as ET import numpy as np -from core_atomistic.atom import Atom -from core_atomistic.atomic_model import AtomicModel -from core_atomistic.periodic_table import TPeriodTable -from core_atomistic import helpers +from src_core_atomistic.atom import Atom +from src_core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.periodic_table import TPeriodTable +from src_core_atomistic import helpers class TSIESTA: diff --git a/src/src_gui4dft/program/vasp.py b/src/program/vasp.py similarity index 96% rename from src/src_gui4dft/program/vasp.py rename to src/program/vasp.py index 5aa560e..4989306 100644 --- a/src/src_gui4dft/program/vasp.py +++ b/src/program/vasp.py @@ -3,11 +3,11 @@ import numpy as np import re -from core_atomistic import helpers -from core_atomistic.atom import Atom -from core_atomistic.atomic_model import AtomicModel -from core_atomistic.periodic_table import TPeriodTable -from src_gui4dft.utils.electronic_prop_reader import dos_from_file +from src_core_atomistic import helpers +from src_core_atomistic.atom import Atom +from src_core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.periodic_table import TPeriodTable +from utils.electronic_prop_reader import dos_from_file class TVASP: diff --git a/src/src_gui4dft/program/wien.py b/src/program/wien.py similarity index 97% rename from src/src_gui4dft/program/wien.py rename to src/program/wien.py index b2bad6b..b84e975 100644 --- a/src/src_gui4dft/program/wien.py +++ b/src/program/wien.py @@ -4,8 +4,8 @@ from copy import deepcopy import numpy as np -from core_atomistic.atomic_model import AtomicModel -from core_atomistic import helpers +from src_core_atomistic.atomic_model import AtomicModel +from src_core_atomistic import helpers def n_atoms_from_struct(f_name): diff --git a/src/src_gui4dft/qtbased/guiopengl.py b/src/qtbased/guiopengl.py similarity index 98% rename from src/src_gui4dft/qtbased/guiopengl.py rename to src/qtbased/guiopengl.py index 59eac8d..33a8eec 100644 --- a/src/src_gui4dft/qtbased/guiopengl.py +++ b/src/qtbased/guiopengl.py @@ -6,9 +6,9 @@ from copy import deepcopy import numpy as np -from core_atomistic_qt.guiopenglbase import GuiOpenGLBase -from core_atomistic.atomic_model import AtomicModel -from src_gui4dft.utils.voronoi import VoronoiAnalisis +from src_core_atomistic_qt.opengl_base import GuiOpenGLBase +from src_core_atomistic.atomic_model import AtomicModel +from utils.voronoi import VoronoiAnalisis class GuiOpenGL(GuiOpenGLBase): diff --git a/src/src_gui4dft/qtbased/image3dexporter.py b/src/qtbased/image3dexporter.py similarity index 87% rename from src/src_gui4dft/qtbased/image3dexporter.py rename to src/qtbased/image3dexporter.py index 312bf04..a6bcd2b 100644 --- a/src/src_gui4dft/qtbased/image3dexporter.py +++ b/src/qtbased/image3dexporter.py @@ -2,7 +2,7 @@ from qtpy.QtWidgets import QMainWindow from qtpy.QtCore import QSize -from src_gui4dft.ui.image3D import Ui_MainWindow as Ui_image3D +from ui.image3D import Ui_MainWindow as Ui_image3D class Image3Dexporter(QMainWindow): diff --git a/src/src_gui4dft/qtbased/images/Close.png b/src/qtbased/images/Close.png similarity index 100% rename from src/src_gui4dft/qtbased/images/Close.png rename to src/qtbased/images/Close.png diff --git a/src/src_gui4dft/qtbased/images/Open.png b/src/qtbased/images/Open.png similarity index 100% rename from src/src_gui4dft/qtbased/images/Open.png rename to src/qtbased/images/Open.png diff --git a/src/src_gui4dft/qtbased/images/RedoX.png b/src/qtbased/images/RedoX.png similarity index 100% rename from src/src_gui4dft/qtbased/images/RedoX.png rename to src/qtbased/images/RedoX.png diff --git a/src/src_gui4dft/qtbased/images/RedoY.png b/src/qtbased/images/RedoY.png similarity index 100% rename from src/src_gui4dft/qtbased/images/RedoY.png rename to src/qtbased/images/RedoY.png diff --git a/src/src_gui4dft/qtbased/images/RedoZ.png b/src/qtbased/images/RedoZ.png similarity index 100% rename from src/src_gui4dft/qtbased/images/RedoZ.png rename to src/qtbased/images/RedoZ.png diff --git a/src/src_gui4dft/qtbased/images/Save2D.png b/src/qtbased/images/Save2D.png similarity index 100% rename from src/src_gui4dft/qtbased/images/Save2D.png rename to src/qtbased/images/Save2D.png diff --git a/src/src_gui4dft/qtbased/images/Save3D.png b/src/qtbased/images/Save3D.png similarity index 100% rename from src/src_gui4dft/qtbased/images/Save3D.png rename to src/qtbased/images/Save3D.png diff --git a/src/src_gui4dft/qtbased/images/UndoX.png b/src/qtbased/images/UndoX.png similarity index 100% rename from src/src_gui4dft/qtbased/images/UndoX.png rename to src/qtbased/images/UndoX.png diff --git a/src/src_gui4dft/qtbased/images/UndoY.png b/src/qtbased/images/UndoY.png similarity index 100% rename from src/src_gui4dft/qtbased/images/UndoY.png rename to src/qtbased/images/UndoY.png diff --git a/src/src_gui4dft/qtbased/images/UndoZ.png b/src/qtbased/images/UndoZ.png similarity index 100% rename from src/src_gui4dft/qtbased/images/UndoZ.png rename to src/qtbased/images/UndoZ.png diff --git a/src/src_gui4dft/qtbased/images/down.png b/src/qtbased/images/down.png similarity index 100% rename from src/src_gui4dft/qtbased/images/down.png rename to src/qtbased/images/down.png diff --git a/src/src_gui4dft/qtbased/images/ico.png b/src/qtbased/images/ico.png similarity index 100% rename from src/src_gui4dft/qtbased/images/ico.png rename to src/qtbased/images/ico.png diff --git a/src/src_gui4dft/qtbased/images/left.png b/src/qtbased/images/left.png similarity index 100% rename from src/src_gui4dft/qtbased/images/left.png rename to src/qtbased/images/left.png diff --git a/src/src_gui4dft/qtbased/images/murnaghan.png b/src/qtbased/images/murnaghan.png similarity index 100% rename from src/src_gui4dft/qtbased/images/murnaghan.png rename to src/qtbased/images/murnaghan.png diff --git a/src/src_gui4dft/qtbased/images/murnaghanbirch.png b/src/qtbased/images/murnaghanbirch.png similarity index 100% rename from src/src_gui4dft/qtbased/images/murnaghanbirch.png rename to src/qtbased/images/murnaghanbirch.png diff --git a/src/src_gui4dft/qtbased/images/parabola.png b/src/qtbased/images/parabola.png similarity index 100% rename from src/src_gui4dft/qtbased/images/parabola.png rename to src/qtbased/images/parabola.png diff --git a/src/src_gui4dft/qtbased/images/right.png b/src/qtbased/images/right.png similarity index 100% rename from src/src_gui4dft/qtbased/images/right.png rename to src/qtbased/images/right.png diff --git a/src/src_gui4dft/qtbased/images/up.png b/src/qtbased/images/up.png similarity index 100% rename from src/src_gui4dft/qtbased/images/up.png rename to src/qtbased/images/up.png diff --git a/src/src_gui4dft/qtbased/mainform.py b/src/qtbased/mainform.py similarity index 98% rename from src/src_gui4dft/qtbased/mainform.py rename to src/qtbased/mainform.py index b2ee079..43c2253 100644 --- a/src/src_gui4dft/qtbased/mainform.py +++ b/src/qtbased/mainform.py @@ -21,35 +21,34 @@ from ase.build import molecule, bulk -from core_atomistic.atom import Atom -from core_atomistic.atomic_model import AtomicModel -from core_atomistic.periodic_table import TPeriodTable -from core_atomistic import helpers - -from src_gui4dft.models.capedswcnt import CapedSWNT -from src_gui4dft.models.bint import BiNT -from src_gui4dft.models.hexagonal_plane import HexagonalPlane, HexagonalPlaneHex -from src_gui4dft.models.meta_graphene import MetaGraphene -from src_gui4dft.models.swnt import SWNT -from src_gui4dft.models.swgnt import SWGNT -from src_gui4dft.models.gaussiancube import GaussianCube -from src_gui4dft.models.volumericdata import VolumericData -from src_gui4dft.models.xsf import XSF -from src_gui4dft.qtbased.image3dexporter import Image3Dexporter -from src_gui4dft.program.siesta import TSIESTA -import src_gui4dft.program.crystal as CRYSTAL # model_0d_to_d12, model_1d_to_d12, model_2d_to_d12, model_3d_to_d12 -from src_gui4dft.program.qe import model_to_qe_pw -from src_gui4dft.program.wien import model_to_wien_struct -from src_gui4dft.program.vasp import TVASP, vasp_dos, model_to_vasp_poscar -from src_gui4dft.program.dftb import model_to_dftb_d0 -from src_gui4dft.program import ase -from src_gui4dft.utils.importer_exporter import ImporterExporter -from src_gui4dft.utils.electronic_prop_reader import read_siesta_bands, dos_from_file -from src_gui4dft.program.fdfdata import TFDFFile -from src_gui4dft.utils.calculators import Calculators as Calculator -from src_gui4dft.utils.calculators import gaps -from src_gui4dft.ui.about import Ui_DialogAbout as Ui_about -from src_gui4dft.ui.form import Ui_MainWindow as Ui_form +from src_core_atomistic.atom import Atom +from src_core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.periodic_table import TPeriodTable +from src_core_atomistic import helpers + +from models.capedswcnt import CapedSWNT +from models.bint import BiNT +from models.hexagonal_plane import HexagonalPlane, HexagonalPlaneHex +from models.meta_graphene import MetaGraphene +from models.swnt import SWNT +from models.swgnt import SWGNT +from models.gaussiancube import GaussianCube +from models.volumericdata import VolumericData +from models.xsf import XSF +from qtbased.image3dexporter import Image3Dexporter +from program.siesta import TSIESTA +from program.qe import model_to_qe_pw +from program.wien import model_to_wien_struct +from program.vasp import TVASP, vasp_dos, model_to_vasp_poscar +from program.dftb import model_to_dftb_d0 +from program import ase +from utils.importer_exporter import ImporterExporter +from utils.electronic_prop_reader import read_siesta_bands, dos_from_file +from program.fdfdata import TFDFFile +from utils.calculators import Calculators as Calculator +from utils.calculators import gaps +from ui.about import Ui_DialogAbout as Ui_about +from ui.form import Ui_MainWindow as Ui_form sys.path.append('') @@ -1080,7 +1079,7 @@ def fill_gui(self, title=""): self.fill_energies(energies) if helpers.check_format(file_name) == "CRYSTALout": - energies = CRYSTAL.energies(file_name) + energies = crystal.energies(file_name) self.fill_energies(energies) if helpers.check_format(file_name) == "SIESTAfdf": @@ -2927,7 +2926,7 @@ def d12_0D_to_form(self): # pragma: no cover return try: model = self.models[self.active_model_id] - text = CRYSTAL.model_0d_to_d12(model) + text = crystal.model_0d_to_d12(model) if len(text) > 0: self.ui.FormActionsPreTextFDF.setText(text) except Exception as e: @@ -2938,7 +2937,7 @@ def d12_1D_to_form(self): # pragma: no cover return try: model = self.models[self.active_model_id] - text = CRYSTAL.model_1d_to_d12(model) + text = crystal.model_1d_to_d12(model) if len(text) > 0: self.ui.FormActionsPreTextFDF.setText(text) except Exception as e: @@ -2949,7 +2948,7 @@ def d12_2D_to_form(self): # pragma: no cover return try: model = self.models[self.active_model_id] - text = CRYSTAL.model_2d_to_d12(model) + text = crystal.model_2d_to_d12(model) if len(text) > 0: self.ui.FormActionsPreTextFDF.setText(text) except Exception as e: @@ -2960,7 +2959,7 @@ def d12_3D_to_form(self): # pragma: no cover return try: model = self.models[self.active_model_id] - text = CRYSTAL.model_3d_to_d12(model) + text = crystal.model_3d_to_d12(model) if len(text) > 0: self.ui.FormActionsPreTextFDF.setText(text) except Exception as e: diff --git a/src/src_gui4dft/ui/about.py b/src/ui/about.py similarity index 100% rename from src/src_gui4dft/ui/about.py rename to src/ui/about.py diff --git a/src/src_gui4dft/ui/about.ui b/src/ui/about.ui similarity index 100% rename from src/src_gui4dft/ui/about.ui rename to src/ui/about.ui diff --git a/src/src_gui4dft/ui/form-v1.x.ui b/src/ui/form-v1.x.ui similarity index 100% rename from src/src_gui4dft/ui/form-v1.x.ui rename to src/ui/form-v1.x.ui diff --git a/src/src_gui4dft/ui/form.py b/src/ui/form.py similarity index 99% rename from src/src_gui4dft/ui/form.py rename to src/ui/form.py index 74339d0..da51f15 100644 --- a/src/src_gui4dft/ui/form.py +++ b/src/ui/form.py @@ -12,9 +12,9 @@ from qtpy.QtGui import * from qtpy.QtWidgets import * -from core_atomistic_qt.pyqtgraphwidget import PyqtGraphWidget -from core_atomistic_qt.pyqtgraphwidgetimage import PyqtGraphWidgetImage -from src_gui4dft.qtbased.guiopengl import GuiOpenGL +from src_core_atomistic_qt.qt_graph import PyqtGraphWidget +from src_core_atomistic_qt.qt_image import PyqtGraphWidgetImage +from qtbased.guiopengl import GuiOpenGL class Ui_MainWindow(object): diff --git a/src/src_gui4dft/ui/image3D.py b/src/ui/image3D.py similarity index 96% rename from src/src_gui4dft/ui/image3D.py rename to src/ui/image3D.py index 696121e..256173e 100644 --- a/src/src_gui4dft/ui/image3D.py +++ b/src/ui/image3D.py @@ -11,7 +11,7 @@ from qtpy.QtCore import * from qtpy.QtWidgets import * -from src_gui4dft.qtbased.guiopengl import GuiOpenGL +from qtbased.guiopengl import GuiOpenGL class Ui_MainWindow(object): diff --git a/src/src_gui4dft/ui/image3D.ui b/src/ui/image3D.ui similarity index 100% rename from src/src_gui4dft/ui/image3D.ui rename to src/ui/image3D.ui diff --git a/src/src_gui4dft/ui/runGUIgenerator-second.bat b/src/ui/runGUIgenerator-second.bat similarity index 100% rename from src/src_gui4dft/ui/runGUIgenerator-second.bat rename to src/ui/runGUIgenerator-second.bat diff --git a/src/src_gui4dft/ui/runGUIgenerator.bat b/src/ui/runGUIgenerator.bat similarity index 100% rename from src/src_gui4dft/ui/runGUIgenerator.bat rename to src/ui/runGUIgenerator.bat diff --git a/src/src_gui4dft/utils/calculators.py b/src/utils/calculators.py similarity index 97% rename from src/src_gui4dft/utils/calculators.py rename to src/utils/calculators.py index eb5e105..cc9db64 100644 --- a/src/src_gui4dft/utils/calculators.py +++ b/src/utils/calculators.py @@ -11,9 +11,9 @@ from scipy.spatial import ConvexHull from scipy.spatial import Voronoi -from core_atomistic.atom import Atom -from core_atomistic.atomic_model import AtomicModel -from core_atomistic import helpers +from src_core_atomistic.atom import Atom +from src_core_atomistic.atomic_model import AtomicModel +from src_core_atomistic import helpers def gaps(bands, emaxf, eminf, homo, lumo) -> Tuple[float, float]: diff --git a/src/src_gui4dft/utils/electronic_prop_reader.py b/src/utils/electronic_prop_reader.py similarity index 98% rename from src/src_gui4dft/utils/electronic_prop_reader.py rename to src/utils/electronic_prop_reader.py index 59c1dd9..c284ffe 100644 --- a/src/src_gui4dft/utils/electronic_prop_reader.py +++ b/src/utils/electronic_prop_reader.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import os import numpy as np -from core_atomistic import helpers +from src_core_atomistic import helpers def dos_from_file(filename, n=2, n_lines=0): diff --git a/src/src_gui4dft/utils/importer_exporter.py b/src/utils/importer_exporter.py similarity index 83% rename from src/src_gui4dft/utils/importer_exporter.py rename to src/utils/importer_exporter.py index c55744c..5dd7c2c 100644 --- a/src/src_gui4dft/utils/importer_exporter.py +++ b/src/utils/importer_exporter.py @@ -1,21 +1,21 @@ # -*- coding: utf-8 -*- import os -from core_atomistic.atomic_model import AtomicModel -from core_atomistic import helpers -from core_atomistic.project_file import ProjectFile -from src_gui4dft.program.vasp import fermi_energy_from_doscar, atoms_from_POSCAR -from src_gui4dft.program.fdfdata import TFDFFile -from src_gui4dft.program.siesta import TSIESTA -from src_gui4dft.program.firefly import atomic_model_to_firefly_inp -from src_gui4dft.program.vasp import model_to_vasp_poscar -from src_gui4dft.program.crystal import structure_of_primitive_cell, structure_opt_step -from src_gui4dft.program.qe import atoms_from_pwout -from src_gui4dft.program.wien import atoms_from_struct -from src_gui4dft.program.dftb import atoms_from_gen -from src_gui4dft.program.lammps import atoms_trajectory_step -from src_gui4dft.models.gaussiancube import GaussianCube -from src_gui4dft.models.xsf import XSF +from src_core_atomistic.atomic_model import AtomicModel +from src_core_atomistic import helpers +from src_core_atomistic.project_file import ProjectFile +from program.vasp import fermi_energy_from_doscar, atoms_from_POSCAR +from program.fdfdata import TFDFFile +from program.siesta import TSIESTA +from program.firefly import atomic_model_to_firefly_inp +from program.vasp import model_to_vasp_poscar +from program.crystal import structure_of_primitive_cell, structure_opt_step +from program.qe import atoms_from_pwout +from program.wien import atoms_from_struct +from program.dftb import atoms_from_gen +from program.lammps import atoms_trajectory_step +from models.gaussiancube import GaussianCube +from models.xsf import XSF class ImporterExporter(object): diff --git a/src/src_gui4dft/utils/voronoi.py b/src/utils/voronoi.py similarity index 100% rename from src/src_gui4dft/utils/voronoi.py rename to src/utils/voronoi.py diff --git a/src/core_atomistic/atom.py b/src_core_atomistic/atom.py similarity index 97% rename from src/core_atomistic/atom.py rename to src_core_atomistic/atom.py index aa69a1e..e1bceb9 100644 --- a/src/core_atomistic/atom.py +++ b/src_core_atomistic/atom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from core_atomistic import helpers +from src_core_atomistic import helpers import numpy as np diff --git a/src/core_atomistic/atomic_model.py b/src_core_atomistic/atomic_model.py similarity index 99% rename from src/core_atomistic/atomic_model.py rename to src_core_atomistic/atomic_model.py index 79f825e..1112ac8 100644 --- a/src/core_atomistic/atomic_model.py +++ b/src_core_atomistic/atomic_model.py @@ -12,9 +12,9 @@ from numpy.linalg import inv from numpy.linalg import norm -from core_atomistic import helpers -from core_atomistic.periodic_table import TPeriodTable -from core_atomistic.atom import Atom +from src_core_atomistic import helpers +from src_core_atomistic.periodic_table import TPeriodTable +from src_core_atomistic.atom import Atom from scipy.spatial.distance import cdist from scipy.optimize import fmin import scipy diff --git a/src/core_atomistic/helpers.py b/src_core_atomistic/helpers.py similarity index 100% rename from src/core_atomistic/helpers.py rename to src_core_atomistic/helpers.py diff --git a/src/core_atomistic/periodic_table.py b/src_core_atomistic/periodic_table.py similarity index 100% rename from src/core_atomistic/periodic_table.py rename to src_core_atomistic/periodic_table.py diff --git a/src/core_atomistic/project_file.py b/src_core_atomistic/project_file.py similarity index 96% rename from src/core_atomistic/project_file.py rename to src_core_atomistic/project_file.py index e975885..2e5960f 100644 --- a/src/core_atomistic/project_file.py +++ b/src_core_atomistic/project_file.py @@ -1,6 +1,6 @@ import os import numpy as np -from core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.atomic_model import AtomicModel class ProjectFile(object): diff --git a/src/core_atomistic_qt/guiopenglbase.py b/src_core_atomistic_qt/opengl_base.py similarity index 99% rename from src/core_atomistic_qt/guiopenglbase.py rename to src_core_atomistic_qt/opengl_base.py index 44f1636..9e98712 100644 --- a/src/core_atomistic_qt/guiopenglbase.py +++ b/src_core_atomistic_qt/opengl_base.py @@ -8,8 +8,8 @@ from qtpy.QtCore import Qt from qtpy.QtGui import QColor, QPainter, QFont from copy import deepcopy -from core_atomistic.periodic_table import TPeriodTable -from core_atomistic.atom import Atom +from src_core_atomistic.periodic_table import TPeriodTable +from src_core_atomistic.atom import Atom import math import numpy as np diff --git a/src/core_atomistic_qt/pyqtgraphwidget.py b/src_core_atomistic_qt/qt_graph.py similarity index 100% rename from src/core_atomistic_qt/pyqtgraphwidget.py rename to src_core_atomistic_qt/qt_graph.py diff --git a/src/core_atomistic_qt/pyqtgraphwidgetimage.py b/src_core_atomistic_qt/qt_image.py similarity index 100% rename from src/core_atomistic_qt/pyqtgraphwidgetimage.py rename to src_core_atomistic_qt/qt_image.py diff --git a/tests/conftest.py b/tests/conftest.py index 406ae81..1670935 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,6 @@ from pathlib import Path -from core_atomistic.atomic_model import AtomicModel -from core_atomistic.periodic_table import TPeriodTable +from src_core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.periodic_table import TPeriodTable import pytest diff --git a/tests/gui4dft/dftb.py b/tests/gui4dft/dftb.py index cd355a3..21f0aae 100644 --- a/tests/gui4dft/dftb.py +++ b/tests/gui4dft/dftb.py @@ -1,4 +1,4 @@ -from src_gui4dft.program.dftb import model_to_dftb_d0 +from program.dftb import model_to_dftb_d0 def test_model_to_dftb_d0(h2o_model): diff --git a/tests/gui4dft/test_calculators.py b/tests/gui4dft/test_calculators.py index ce1b25c..8c749f4 100644 --- a/tests/gui4dft/test_calculators.py +++ b/tests/gui4dft/test_calculators.py @@ -1,7 +1,7 @@ import numpy as np import pytest -from src_gui4dft.utils.calculators import Calculators +from utils.calculators import Calculators def test_lattice_approx(): diff --git a/tests/gui4dft/test_crystal.py b/tests/gui4dft/test_crystal.py index 4175bcc..135a05a 100644 --- a/tests/gui4dft/test_crystal.py +++ b/tests/gui4dft/test_crystal.py @@ -1,5 +1,5 @@ -from src_gui4dft.program.crystal import model_1d_to_d12, model_2d_to_d12, structure_opt_step -from src_gui4dft.utils.importer_exporter import ImporterExporter +from program.crystal import model_1d_to_d12, model_2d_to_d12 +from utils.importer_exporter import ImporterExporter def test_model_1d_to_d12(tests_path): diff --git a/tests/gui4dft/test_electronic_prop.py b/tests/gui4dft/test_electronic_prop.py index 1958497..3224236 100644 --- a/tests/gui4dft/test_electronic_prop.py +++ b/tests/gui4dft/test_electronic_prop.py @@ -1,8 +1,8 @@ -from src_gui4dft.utils.electronic_prop_reader import read_siesta_bands, dos_from_file, dos_siesta_vert -from src_gui4dft.program.vasp import vasp_dos -from src_gui4dft.program.siesta import TSIESTA +from utils.electronic_prop_reader import read_siesta_bands, dos_from_file, dos_siesta_vert +from program.vasp import vasp_dos +from program.siesta import TSIESTA -from src_gui4dft.utils.calculators import gaps +from utils.calculators import gaps def test_dos_from_file(tests_path): diff --git a/tests/gui4dft/test_fdf.py b/tests/gui4dft/test_fdf.py index 8096971..9d986c4 100644 --- a/tests/gui4dft/test_fdf.py +++ b/tests/gui4dft/test_fdf.py @@ -1,4 +1,4 @@ -from src_gui4dft.utils.importer_exporter import ImporterExporter +from utils.importer_exporter import ImporterExporter def test_fdf_parser(tests_path): diff --git a/tests/gui4dft/test_firefly.py b/tests/gui4dft/test_firefly.py index 85636d3..2ffc06d 100644 --- a/tests/gui4dft/test_firefly.py +++ b/tests/gui4dft/test_firefly.py @@ -1,5 +1,5 @@ -from src_gui4dft.program.firefly import atomic_model_to_firefly_inp -from src_gui4dft.models.swnt import SWNT +from program.firefly import atomic_model_to_firefly_inp +from models.swnt import SWNT def test_atomic_model_to_firefly_inp(): diff --git a/tests/gui4dft/test_importer.py b/tests/gui4dft/test_importer.py index 20551cc..3dd2778 100644 --- a/tests/gui4dft/test_importer.py +++ b/tests/gui4dft/test_importer.py @@ -1,7 +1,5 @@ -import numpy as np - -from core_atomistic import helpers -from src_gui4dft.utils.importer_exporter import ImporterExporter +from src_core_atomistic import helpers +from utils.importer_exporter import ImporterExporter def test_check_format(tests_path): diff --git a/tests/gui4dft/test_models.py b/tests/gui4dft/test_models.py index 24fd6e8..f07263f 100644 --- a/tests/gui4dft/test_models.py +++ b/tests/gui4dft/test_models.py @@ -1,7 +1,7 @@ -from src_gui4dft.models.capedswcnt import CapedSWNT -from src_gui4dft.models.graphene import Graphene -from src_gui4dft.models.bint import BiNT -from src_gui4dft.models.swnt import SWNT +from models.capedswcnt import CapedSWNT +from models.graphene import Graphene +from models.bint import BiNT +from models.swnt import SWNT def test_swnt(): diff --git a/tests/gui4dft/test_qe.py b/tests/gui4dft/test_qe.py index 3d5dd0c..da921f0 100644 --- a/tests/gui4dft/test_qe.py +++ b/tests/gui4dft/test_qe.py @@ -1,6 +1,6 @@ import pytest -from src_gui4dft.program.qe import alats_from_pwout, atoms_from_pwout, vectors_from_pwout +from program.qe import alats_from_pwout, atoms_from_pwout, vectors_from_pwout def test_vectors_from_pwout(tests_path): diff --git a/tests/gui4dft/test_siesta.py b/tests/gui4dft/test_siesta.py index 7fb9e85..2290e62 100644 --- a/tests/gui4dft/test_siesta.py +++ b/tests/gui4dft/test_siesta.py @@ -1,7 +1,7 @@ import math import numpy as np -from core_atomistic.helpers import lat_vectors_from_params -from src_gui4dft.program.siesta import TSIESTA +from src_core_atomistic.helpers import lat_vectors_from_params +from program.siesta import TSIESTA def test_lattice_constant(tests_path): diff --git a/tests/gui4dft/test_vasp.py b/tests/gui4dft/test_vasp.py index d95c692..10d9ba0 100644 --- a/tests/gui4dft/test_vasp.py +++ b/tests/gui4dft/test_vasp.py @@ -1,4 +1,4 @@ -from src_gui4dft.program.vasp import TVASP, model_to_vasp_poscar, fermi_energy_from_doscar +from program.vasp import TVASP, model_to_vasp_poscar, fermi_energy_from_doscar def test_model_to_vasp_poscar(h2o_model): diff --git a/tests/gui4dft/test_volumeric_model.py b/tests/gui4dft/test_volumeric_model.py index 00a7261..8240e09 100644 --- a/tests/gui4dft/test_volumeric_model.py +++ b/tests/gui4dft/test_volumeric_model.py @@ -1,6 +1,6 @@ -from src_gui4dft.models.gaussiancube import GaussianCube -from src_gui4dft.models.xsf import XSF -from src_gui4dft.models.volumericdatablock import VolumericDataBlock +from models.gaussiancube import GaussianCube +from models.xsf import XSF +from models.volumericdatablock import VolumericDataBlock def test_volumeric_data_block(): diff --git a/tests/gui4dft/test_wien.py b/tests/gui4dft/test_wien.py index 3b0fc73..6946dd9 100644 --- a/tests/gui4dft/test_wien.py +++ b/tests/gui4dft/test_wien.py @@ -1,4 +1,4 @@ -from src_gui4dft.program.wien import n_atoms_from_struct, alats_from_struct, atoms_from_struct +from program.wien import n_atoms_from_struct, alats_from_struct, atoms_from_struct def test_n_atoms_from_struct(tests_path): diff --git a/tests/gui4dft_opengl/conftest.py b/tests/gui4dft_opengl/conftest.py index 883f330..20d57cf 100644 --- a/tests/gui4dft_opengl/conftest.py +++ b/tests/gui4dft_opengl/conftest.py @@ -1,7 +1,7 @@ -from core_atomistic_qt.pyqtgraphwidget import PyqtGraphWidget -from core_atomistic_qt.pyqtgraphwidgetimage import PyqtGraphWidgetImage -from src_gui4dft.qtbased.guiopengl import GuiOpenGL -from src_gui4dft.qtbased.mainform import MainForm +from src_core_atomistic_qt.qt_graph import PyqtGraphWidget +from src_core_atomistic_qt.qt_image import PyqtGraphWidgetImage +from qtbased.guiopengl import GuiOpenGL +from qtbased.mainform import MainForm from qtpy.QtCore import QCoreApplication, Qt import pytest diff --git a/tests/gui4dft_opengl/test_guiopengl.py b/tests/gui4dft_opengl/test_guiopengl.py index 3a2365e..3f5938d 100644 --- a/tests/gui4dft_opengl/test_guiopengl.py +++ b/tests/gui4dft_opengl/test_guiopengl.py @@ -1,4 +1,4 @@ -from core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.atomic_model import AtomicModel def test_guiopengl(guiopengl_widget): diff --git a/tests_core/core_atomistic/conftest.py b/tests_core/core_atomistic/conftest.py index 40b35d6..487b7ad 100644 --- a/tests_core/core_atomistic/conftest.py +++ b/tests_core/core_atomistic/conftest.py @@ -1,4 +1,4 @@ -from core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.atomic_model import AtomicModel import pytest diff --git a/tests_core/core_atomistic/test_atom.py b/tests_core/core_atomistic/test_atom.py index 8fcdf5a..3934ee9 100644 --- a/tests_core/core_atomistic/test_atom.py +++ b/tests_core/core_atomistic/test_atom.py @@ -1,4 +1,4 @@ -from core_atomistic.atom import Atom +from src_core_atomistic.atom import Atom def test_atom(): diff --git a/tests_core/core_atomistic/test_atomic_model.py b/tests_core/core_atomistic/test_atomic_model.py index ccb841f..3ac370b 100644 --- a/tests_core/core_atomistic/test_atomic_model.py +++ b/tests_core/core_atomistic/test_atomic_model.py @@ -1,4 +1,4 @@ -from core_atomistic.atomic_model import AtomicModel +from src_core_atomistic.atomic_model import AtomicModel import pytest import numpy as np from copy import copy, deepcopy diff --git a/tests_core/core_atomistic/test_helpers.py b/tests_core/core_atomistic/test_helpers.py index bbba4d8..38ebba0 100644 --- a/tests_core/core_atomistic/test_helpers.py +++ b/tests_core/core_atomistic/test_helpers.py @@ -1,6 +1,6 @@ import numpy as np -from core_atomistic import helpers +from src_core_atomistic import helpers def test_helpers_spacedel(): diff --git a/tests_core/core_atomistic_qt/conftest.py b/tests_core/core_atomistic_qt/conftest.py index 121aa19..d48e37a 100644 --- a/tests_core/core_atomistic_qt/conftest.py +++ b/tests_core/core_atomistic_qt/conftest.py @@ -1,5 +1,5 @@ -from core_atomistic_qt.pyqtgraphwidget import PyqtGraphWidget -from core_atomistic_qt.pyqtgraphwidgetimage import PyqtGraphWidgetImage +from src_core_atomistic_qt.qt_graph import PyqtGraphWidget +from src_core_atomistic_qt.qt_image import PyqtGraphWidgetImage from qtpy.QtWidgets import QApplication import pytest From 2f2191476786775cf0f60f596581bcb66e6b5957 Mon Sep 17 00:00:00 2001 From: Sergey Sozykin Date: Sun, 7 Jan 2024 23:18:00 +0500 Subject: [PATCH 4/7] some renames --- .github/workflows/python-app.yml | 4 --- .gitignore | 2 +- requirements-dev-qt.txt | 2 ++ requirements-dev.txt | 2 -- .../core_atomistic}/atom.py | 2 +- .../core_atomistic}/atomic_model.py | 6 ++-- .../core_atomistic}/helpers.py | 0 .../core_atomistic}/periodic_table.py | 0 .../core_atomistic}/project_file.py | 2 +- .../core_atomistic_qt}/opengl_base.py | 14 ++++++-- .../core_atomistic_qt}/qt_graph.py | 0 .../core_atomistic_qt}/qt_image.py | 0 src/models/bint.py | 4 +-- src/models/capedswcnt.py | 4 +-- src/models/gaussiancube.py | 4 +-- src/models/hexagonal_plane.py | 4 +-- src/models/meta_graphene.py | 2 +- src/models/swgnt.py | 4 +-- src/models/swnt.py | 2 +- src/models/volumericdata.py | 2 +- src/models/xsf.py | 6 ++-- src/program/ase.py | 8 ++--- src/program/crystal.py | 6 ++-- src/program/dftb.py | 6 ++-- src/program/fdfdata.py | 2 +- src/program/firefly.py | 2 +- src/program/lammps.py | 2 +- src/program/qe.py | 6 ++-- src/program/siesta.py | 8 ++--- src/program/vasp.py | 8 ++--- src/program/wien.py | 4 +-- src/qtbased/guiopengl.py | 4 +-- src/qtbased/mainform.py | 35 ++++++------------- src/ui/form.py | 4 +-- src/utils/calculators.py | 6 ++-- src/utils/electronic_prop_reader.py | 2 +- src/utils/importer_exporter.py | 6 ++-- tests/conftest.py | 4 +-- tests/gui4dft/test_importer.py | 2 +- tests/gui4dft/test_siesta.py | 2 +- tests/gui4dft_opengl/conftest.py | 4 +-- tests/gui4dft_opengl/test_guiopengl.py | 2 +- tests_core/conftest.py | 14 -------- .../conftest.py | 15 +++++++- .../test_atom.py | 2 +- .../test_atomic_model.py | 2 +- .../test_helpers.py | 2 +- .../test_periodic_table.py | 0 .../conftest.py | 16 +++++++-- .../test_pygrimagewidget.py | 0 .../test_pygrwidget.py | 0 51 files changed, 122 insertions(+), 118 deletions(-) create mode 100644 requirements-dev-qt.txt rename {src_core_atomistic => src/core_atomistic}/atom.py (97%) rename {src_core_atomistic => src/core_atomistic}/atomic_model.py (99%) rename {src_core_atomistic => src/core_atomistic}/helpers.py (100%) rename {src_core_atomistic => src/core_atomistic}/periodic_table.py (100%) rename {src_core_atomistic => src/core_atomistic}/project_file.py (96%) rename {src_core_atomistic_qt => src/core_atomistic_qt}/opengl_base.py (98%) rename {src_core_atomistic_qt => src/core_atomistic_qt}/qt_graph.py (100%) rename {src_core_atomistic_qt => src/core_atomistic_qt}/qt_image.py (100%) delete mode 100644 tests_core/conftest.py rename {tests_core/core_atomistic => tests_core_atomistic}/conftest.py (77%) rename {tests_core/core_atomistic => tests_core_atomistic}/test_atom.py (88%) rename {tests_core/core_atomistic => tests_core_atomistic}/test_atomic_model.py (98%) rename {tests_core/core_atomistic => tests_core_atomistic}/test_helpers.py (96%) rename {tests_core/core_atomistic => tests_core_atomistic}/test_periodic_table.py (100%) rename {tests_core/core_atomistic_qt => tests_core_atomistic_qt}/conftest.py (70%) rename {tests_core/core_atomistic_qt => tests_core_atomistic_qt}/test_pygrimagewidget.py (100%) rename {tests_core/core_atomistic_qt => tests_core_atomistic_qt}/test_pygrwidget.py (100%) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 4c720d6..cc36e55 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -27,7 +27,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install black flake8 pip install -r requirements.txt pip install -r requirements-dev.txt - name: Lint with flake8 @@ -50,7 +49,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest pytest-qt pip install -r requirements.txt pip install -r requirements-dev.txt - name: Test with pytest @@ -70,7 +68,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest pytest-qt pip install -r requirements.txt pip install -r requirements-dev.txt - name: Test with pytest @@ -101,7 +98,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest pytest-qt pytest-xvfb pip install -r requirements.txt pip install -r requirements-dev.txt - name: Test with pytest diff --git a/.gitignore b/.gitignore index 182fe90..47e723c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,4 @@ executable/gui4dft.spec tests/.coverage .coverage coverage.xml -/tests_core/core_atomistic/.pytest_cache +/tests_core_atomistic/.pytest_cache diff --git a/requirements-dev-qt.txt b/requirements-dev-qt.txt new file mode 100644 index 0000000..86c7d0f --- /dev/null +++ b/requirements-dev-qt.txt @@ -0,0 +1,2 @@ +pytest-qt +pytest-xvfb diff --git a/requirements-dev.txt b/requirements-dev.txt index a890f67..ee028ab 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,4 @@ pytest pytest-cov -pytest-qt -pytest-xvfb black flake8 diff --git a/src_core_atomistic/atom.py b/src/core_atomistic/atom.py similarity index 97% rename from src_core_atomistic/atom.py rename to src/core_atomistic/atom.py index e1bceb9..aa69a1e 100644 --- a/src_core_atomistic/atom.py +++ b/src/core_atomistic/atom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from src_core_atomistic import helpers +from core_atomistic import helpers import numpy as np diff --git a/src_core_atomistic/atomic_model.py b/src/core_atomistic/atomic_model.py similarity index 99% rename from src_core_atomistic/atomic_model.py rename to src/core_atomistic/atomic_model.py index 1112ac8..79f825e 100644 --- a/src_core_atomistic/atomic_model.py +++ b/src/core_atomistic/atomic_model.py @@ -12,9 +12,9 @@ from numpy.linalg import inv from numpy.linalg import norm -from src_core_atomistic import helpers -from src_core_atomistic.periodic_table import TPeriodTable -from src_core_atomistic.atom import Atom +from core_atomistic import helpers +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic.atom import Atom from scipy.spatial.distance import cdist from scipy.optimize import fmin import scipy diff --git a/src_core_atomistic/helpers.py b/src/core_atomistic/helpers.py similarity index 100% rename from src_core_atomistic/helpers.py rename to src/core_atomistic/helpers.py diff --git a/src_core_atomistic/periodic_table.py b/src/core_atomistic/periodic_table.py similarity index 100% rename from src_core_atomistic/periodic_table.py rename to src/core_atomistic/periodic_table.py diff --git a/src_core_atomistic/project_file.py b/src/core_atomistic/project_file.py similarity index 96% rename from src_core_atomistic/project_file.py rename to src/core_atomistic/project_file.py index 2e5960f..e975885 100644 --- a/src_core_atomistic/project_file.py +++ b/src/core_atomistic/project_file.py @@ -1,6 +1,6 @@ import os import numpy as np -from src_core_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel class ProjectFile(object): diff --git a/src_core_atomistic_qt/opengl_base.py b/src/core_atomistic_qt/opengl_base.py similarity index 98% rename from src_core_atomistic_qt/opengl_base.py rename to src/core_atomistic_qt/opengl_base.py index 9e98712..a8e21b1 100644 --- a/src_core_atomistic_qt/opengl_base.py +++ b/src/core_atomistic_qt/opengl_base.py @@ -8,8 +8,8 @@ from qtpy.QtCore import Qt from qtpy.QtGui import QColor, QPainter, QFont from copy import deepcopy -from src_core_atomistic.periodic_table import TPeriodTable -from src_core_atomistic.atom import Atom +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic.atom import Atom import math import numpy as np @@ -861,3 +861,13 @@ def set_atomic_structure(self, structure): self.main_model.find_bonds_fast() self.add_all_elements() self.update() + + def bond_len_correct(self, let1: str, let2: str, d: float): + ch1 = self.main_model.mendeley.get_charge_by_letter(let1) + ch2 = self.main_model.mendeley.get_charge_by_letter(let2) + self.main_model.mendeley.Bonds[ch1][ch2] = d + self.main_model.mendeley.Bonds[ch2][ch1] = d + #self.main_model.set_mendeley(self.periodic_table) + self.main_model.find_bonds_fast() + self.add_all_elements() + self.update() diff --git a/src_core_atomistic_qt/qt_graph.py b/src/core_atomistic_qt/qt_graph.py similarity index 100% rename from src_core_atomistic_qt/qt_graph.py rename to src/core_atomistic_qt/qt_graph.py diff --git a/src_core_atomistic_qt/qt_image.py b/src/core_atomistic_qt/qt_image.py similarity index 100% rename from src_core_atomistic_qt/qt_image.py rename to src/core_atomistic_qt/qt_image.py diff --git a/src/models/bint.py b/src/models/bint.py index 779a9b5..8f11cbe 100644 --- a/src/models/bint.py +++ b/src/models/bint.py @@ -2,8 +2,8 @@ import math -from src_core_atomistic.atom import Atom -from src_core_atomistic.atomic_model import AtomicModel as TAtomicModel +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel as TAtomicModel class BiNT(TAtomicModel): diff --git a/src/models/capedswcnt.py b/src/models/capedswcnt.py index cc731e2..0080015 100644 --- a/src/models/capedswcnt.py +++ b/src/models/capedswcnt.py @@ -5,8 +5,8 @@ import numpy as np from pathlib import Path -from src_core_atomistic.atom import Atom -from src_core_atomistic.atomic_model import AtomicModel as TAtomicModel +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel as TAtomicModel from models.swnt import SWNT diff --git a/src/models/gaussiancube.py b/src/models/gaussiancube.py index aaf3182..6bcdd7e 100644 --- a/src/models/gaussiancube.py +++ b/src/models/gaussiancube.py @@ -4,8 +4,8 @@ import os import math import numpy as np -from src_core_atomistic.atomic_model import AtomicModel as TAtomicModel -from src_core_atomistic.periodic_table import TPeriodTable +from core_atomistic.atomic_model import AtomicModel as TAtomicModel +from core_atomistic.periodic_table import TPeriodTable from models.volumericdatablock import VolumericDataBlock from models.volumericdata import VolumericData diff --git a/src/models/hexagonal_plane.py b/src/models/hexagonal_plane.py index 6c31615..fcd0c84 100644 --- a/src/models/hexagonal_plane.py +++ b/src/models/hexagonal_plane.py @@ -2,8 +2,8 @@ import math import numpy as np -from src_core_atomistic.atom import Atom -from src_core_atomistic.atomic_model import AtomicModel +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel class HexagonalPlaneHex(AtomicModel): diff --git a/src/models/meta_graphene.py b/src/models/meta_graphene.py index fda9b86..3cca0bb 100644 --- a/src/models/meta_graphene.py +++ b/src/models/meta_graphene.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from src_core_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel from utils.importer_exporter import ImporterExporter from pathlib import Path diff --git a/src/models/swgnt.py b/src/models/swgnt.py index f7636d3..4063e53 100644 --- a/src/models/swgnt.py +++ b/src/models/swgnt.py @@ -2,8 +2,8 @@ import math -from src_core_atomistic.atom import Atom -from src_core_atomistic.atomic_model import AtomicModel +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel class SWGNT(AtomicModel): diff --git a/src/models/swnt.py b/src/models/swnt.py index 8359978..1fc929d 100644 --- a/src/models/swnt.py +++ b/src/models/swnt.py @@ -3,7 +3,7 @@ import math import numpy as np -from src_core_atomistic import helpers +from core_atomistic import helpers from models.graphene import Graphene diff --git a/src/models/volumericdata.py b/src/models/volumericdata.py index 2317b6d..088e04f 100644 --- a/src/models/volumericdata.py +++ b/src/models/volumericdata.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from copy import deepcopy -from src_core_atomistic import helpers +from core_atomistic import helpers import numpy as np import skimage if skimage.__version__ >= '0.17.2': diff --git a/src/models/xsf.py b/src/models/xsf.py index 0123c79..df6a8f4 100644 --- a/src/models/xsf.py +++ b/src/models/xsf.py @@ -4,9 +4,9 @@ import os import numpy as np -from src_core_atomistic.atomic_model import AtomicModel as TAtomicModel -from src_core_atomistic.periodic_table import TPeriodTable -from src_core_atomistic import helpers +from core_atomistic.atomic_model import AtomicModel as TAtomicModel +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers from models.volumericdatablock import VolumericDataBlock from models.volumericdata import VolumericData diff --git a/src/program/ase.py b/src/program/ase.py index 33922a9..418a868 100644 --- a/src/program/ase.py +++ b/src/program/ase.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- import numpy as np -from src_core_atomistic import helpers -from src_core_atomistic.atom import Atom -from src_core_atomistic.atomic_model import AtomicModel -from src_core_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable def from_ase_atoms_to_atomic_model(ase_atoms): diff --git a/src/program/crystal.py b/src/program/crystal.py index dfd2c6f..e7a7c4c 100644 --- a/src/program/crystal.py +++ b/src/program/crystal.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- from copy import deepcopy import numpy as np -from src_core_atomistic.atom import Atom -from src_core_atomistic.atomic_model import AtomicModel -from src_core_atomistic import helpers +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic import helpers def model_0d_to_d12(model): diff --git a/src/program/dftb.py b/src/program/dftb.py index b3a1300..b07ff14 100644 --- a/src/program/dftb.py +++ b/src/program/dftb.py @@ -4,9 +4,9 @@ import numpy as np -from src_core_atomistic.atomic_model import AtomicModel -from src_core_atomistic.periodic_table import TPeriodTable -from src_core_atomistic import helpers +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers def model_to_dftb_d0(model: AtomicModel): diff --git a/src/program/fdfdata.py b/src/program/fdfdata.py index 806d96f..8cc9d5b 100644 --- a/src/program/fdfdata.py +++ b/src/program/fdfdata.py @@ -2,7 +2,7 @@ import os from copy import deepcopy -from src_core_atomistic.helpers import text_between_lines +from core_atomistic.helpers import text_between_lines from program.siesta import TSIESTA diff --git a/src/program/firefly.py b/src/program/firefly.py index 84d155d..24e3fcd 100644 --- a/src/program/firefly.py +++ b/src/program/firefly.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Python 3 -from src_core_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel def atomic_model_to_firefly_inp(model: AtomicModel) -> str: diff --git a/src/program/lammps.py b/src/program/lammps.py index dc9f9a2..ce5fd05 100644 --- a/src/program/lammps.py +++ b/src/program/lammps.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import numpy as np -from src_core_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel def atoms_trajectory_step(f_name): diff --git a/src/program/qe.py b/src/program/qe.py index 62182f1..9d54f03 100644 --- a/src/program/qe.py +++ b/src/program/qe.py @@ -2,9 +2,9 @@ import math from copy import deepcopy import numpy as np -from src_core_atomistic import helpers -from src_core_atomistic.atom import Atom -from src_core_atomistic.atomic_model import AtomicModel +from core_atomistic import helpers +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel def vectors_from_pwout(f_name): diff --git a/src/program/siesta.py b/src/program/siesta.py index ea2cd9d..17e8675 100644 --- a/src/program/siesta.py +++ b/src/program/siesta.py @@ -4,10 +4,10 @@ import numpy as np -from src_core_atomistic.atom import Atom -from src_core_atomistic.atomic_model import AtomicModel -from src_core_atomistic.periodic_table import TPeriodTable -from src_core_atomistic import helpers +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers class TSIESTA: diff --git a/src/program/vasp.py b/src/program/vasp.py index 4989306..088d1ee 100644 --- a/src/program/vasp.py +++ b/src/program/vasp.py @@ -3,10 +3,10 @@ import numpy as np import re -from src_core_atomistic import helpers -from src_core_atomistic.atom import Atom -from src_core_atomistic.atomic_model import AtomicModel -from src_core_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable from utils.electronic_prop_reader import dos_from_file diff --git a/src/program/wien.py b/src/program/wien.py index b84e975..b2bad6b 100644 --- a/src/program/wien.py +++ b/src/program/wien.py @@ -4,8 +4,8 @@ from copy import deepcopy import numpy as np -from src_core_atomistic.atomic_model import AtomicModel -from src_core_atomistic import helpers +from core_atomistic.atomic_model import AtomicModel +from core_atomistic import helpers def n_atoms_from_struct(f_name): diff --git a/src/qtbased/guiopengl.py b/src/qtbased/guiopengl.py index 33a8eec..e2c6d29 100644 --- a/src/qtbased/guiopengl.py +++ b/src/qtbased/guiopengl.py @@ -6,8 +6,8 @@ from copy import deepcopy import numpy as np -from src_core_atomistic_qt.opengl_base import GuiOpenGLBase -from src_core_atomistic.atomic_model import AtomicModel +from core_atomistic_qt.opengl_base import GuiOpenGLBase +from core_atomistic.atomic_model import AtomicModel from utils.voronoi import VoronoiAnalisis diff --git a/src/qtbased/mainform.py b/src/qtbased/mainform.py index 43c2253..eb903d5 100644 --- a/src/qtbased/mainform.py +++ b/src/qtbased/mainform.py @@ -21,10 +21,10 @@ from ase.build import molecule, bulk -from src_core_atomistic.atom import Atom -from src_core_atomistic.atomic_model import AtomicModel -from src_core_atomistic.periodic_table import TPeriodTable -from src_core_atomistic import helpers +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic import helpers from models.capedswcnt import CapedSWNT from models.bint import BiNT @@ -41,12 +41,13 @@ from program.wien import model_to_wien_struct from program.vasp import TVASP, vasp_dos, model_to_vasp_poscar from program.dftb import model_to_dftb_d0 +from program import crystal from program import ase -from utils.importer_exporter import ImporterExporter -from utils.electronic_prop_reader import read_siesta_bands, dos_from_file from program.fdfdata import TFDFFile from utils.calculators import Calculators as Calculator from utils.calculators import gaps +from utils.importer_exporter import ImporterExporter +from utils.electronic_prop_reader import read_siesta_bands, dos_from_file from ui.about import Ui_DialogAbout as Ui_about from ui.form import Ui_MainWindow as Ui_form @@ -3114,14 +3115,7 @@ def select_contour_color(self): # pragma: no cover def bond_len_correct(self, d): let1 = self.ui.FormAtomsList1.currentText() let2 = self.ui.FormAtomsList2.currentText() - ch1 = self.periodic_table.get_charge_by_letter(let1) - ch2 = self.periodic_table.get_charge_by_letter(let2) - self.periodic_table.Bonds[ch1][ch2] = d - self.periodic_table.Bonds[ch2][ch1] = d - self.ui.openGLWidget.main_model.set_mendeley(self.periodic_table) - self.ui.openGLWidget.main_model.find_bonds_fast() - self.ui.openGLWidget.add_all_elements() - self.ui.openGLWidget.update() + self.ui.openGLWidget.bond_len_correct(let1, let2, d) print(let1, "-", let2, ": ", d) def create_2d_hexagonal(self): @@ -3294,11 +3288,6 @@ def get_k_path(self): # k_path = cell.bandpath('GXW', npoints=20) k_path = cell.bandpath(npoints=20) - # print(k_path) - # print(k_path.kpts) - # print("----") - # print(k_path.cartesian_kpts()) - #BandPath(path='GXW', cell=[3x3], special_points={GKLUWX}, kpts=[20x3]) txt = "" for point in k_path.kpts: txt += str(point[0]) + " " + str(point[1]) + " " + str(point[2]) + "\n" @@ -3323,12 +3312,10 @@ def swnt_type2_selected(self): def change_color(self, colorUi, var_property): # pragma: no cover color = QColorDialog.getColor() - colorUi.setStyleSheet( - "background-color:rgb(" + str(color.getRgb()[0]) + "," + str(color.getRgb()[1]) + "," + str( - color.getRgb()[2]) + ")") + color_str = str(color.getRgb()[0]) + "," + str(color.getRgb()[1]) + "," + str(color.getRgb()[2]) + colorUi.setStyleSheet("background-color:rgb(" + color_str + ")") newcolor = [color.getRgbF()[0], color.getRgbF()[1], color.getRgbF()[2]] - self.save_property(var_property, - str(color.getRgb()[0]) + " " + str(color.getRgb()[1]) + " " + str(color.getRgb()[2])) + self.save_property(var_property, color_str) return newcolor def volumeric_data_load(self): # pragma: no cover diff --git a/src/ui/form.py b/src/ui/form.py index da51f15..93c1bf7 100644 --- a/src/ui/form.py +++ b/src/ui/form.py @@ -12,8 +12,8 @@ from qtpy.QtGui import * from qtpy.QtWidgets import * -from src_core_atomistic_qt.qt_graph import PyqtGraphWidget -from src_core_atomistic_qt.qt_image import PyqtGraphWidgetImage +from core_atomistic_qt.qt_graph import PyqtGraphWidget +from core_atomistic_qt.qt_image import PyqtGraphWidgetImage from qtbased.guiopengl import GuiOpenGL diff --git a/src/utils/calculators.py b/src/utils/calculators.py index cc9db64..eb5e105 100644 --- a/src/utils/calculators.py +++ b/src/utils/calculators.py @@ -11,9 +11,9 @@ from scipy.spatial import ConvexHull from scipy.spatial import Voronoi -from src_core_atomistic.atom import Atom -from src_core_atomistic.atomic_model import AtomicModel -from src_core_atomistic import helpers +from core_atomistic.atom import Atom +from core_atomistic.atomic_model import AtomicModel +from core_atomistic import helpers def gaps(bands, emaxf, eminf, homo, lumo) -> Tuple[float, float]: diff --git a/src/utils/electronic_prop_reader.py b/src/utils/electronic_prop_reader.py index c284ffe..59c1dd9 100644 --- a/src/utils/electronic_prop_reader.py +++ b/src/utils/electronic_prop_reader.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import os import numpy as np -from src_core_atomistic import helpers +from core_atomistic import helpers def dos_from_file(filename, n=2, n_lines=0): diff --git a/src/utils/importer_exporter.py b/src/utils/importer_exporter.py index 5dd7c2c..acdade7 100644 --- a/src/utils/importer_exporter.py +++ b/src/utils/importer_exporter.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- import os -from src_core_atomistic.atomic_model import AtomicModel -from src_core_atomistic import helpers -from src_core_atomistic.project_file import ProjectFile +from core_atomistic.atomic_model import AtomicModel +from core_atomistic import helpers +from core_atomistic.project_file import ProjectFile from program.vasp import fermi_energy_from_doscar, atoms_from_POSCAR from program.fdfdata import TFDFFile from program.siesta import TSIESTA diff --git a/tests/conftest.py b/tests/conftest.py index 1670935..406ae81 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,6 +1,6 @@ from pathlib import Path -from src_core_atomistic.atomic_model import AtomicModel -from src_core_atomistic.periodic_table import TPeriodTable +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable import pytest diff --git a/tests/gui4dft/test_importer.py b/tests/gui4dft/test_importer.py index 3dd2778..ee34711 100644 --- a/tests/gui4dft/test_importer.py +++ b/tests/gui4dft/test_importer.py @@ -1,4 +1,4 @@ -from src_core_atomistic import helpers +from core_atomistic import helpers from utils.importer_exporter import ImporterExporter diff --git a/tests/gui4dft/test_siesta.py b/tests/gui4dft/test_siesta.py index 2290e62..a5e5f30 100644 --- a/tests/gui4dft/test_siesta.py +++ b/tests/gui4dft/test_siesta.py @@ -1,6 +1,6 @@ import math import numpy as np -from src_core_atomistic.helpers import lat_vectors_from_params +from core_atomistic.helpers import lat_vectors_from_params from program.siesta import TSIESTA diff --git a/tests/gui4dft_opengl/conftest.py b/tests/gui4dft_opengl/conftest.py index 20d57cf..97db99b 100644 --- a/tests/gui4dft_opengl/conftest.py +++ b/tests/gui4dft_opengl/conftest.py @@ -1,5 +1,5 @@ -from src_core_atomistic_qt.qt_graph import PyqtGraphWidget -from src_core_atomistic_qt.qt_image import PyqtGraphWidgetImage +from core_atomistic_qt.qt_graph import PyqtGraphWidget +from core_atomistic_qt.qt_image import PyqtGraphWidgetImage from qtbased.guiopengl import GuiOpenGL from qtbased.mainform import MainForm from qtpy.QtCore import QCoreApplication, Qt diff --git a/tests/gui4dft_opengl/test_guiopengl.py b/tests/gui4dft_opengl/test_guiopengl.py index 3f5938d..3a2365e 100644 --- a/tests/gui4dft_opengl/test_guiopengl.py +++ b/tests/gui4dft_opengl/test_guiopengl.py @@ -1,4 +1,4 @@ -from src_core_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel def test_guiopengl(guiopengl_widget): diff --git a/tests_core/conftest.py b/tests_core/conftest.py deleted file mode 100644 index 2478632..0000000 --- a/tests_core/conftest.py +++ /dev/null @@ -1,14 +0,0 @@ -from pathlib import Path -from core_atomistic.periodic_table import TPeriodTable - -import pytest - - -@pytest.fixture -def tests_path() -> Path: - return Path(__file__).parent - - -@pytest.fixture -def period_table() -> TPeriodTable: - return TPeriodTable() diff --git a/tests_core/core_atomistic/conftest.py b/tests_core_atomistic/conftest.py similarity index 77% rename from tests_core/core_atomistic/conftest.py rename to tests_core_atomistic/conftest.py index 487b7ad..585f68e 100644 --- a/tests_core/core_atomistic/conftest.py +++ b/tests_core_atomistic/conftest.py @@ -1,7 +1,20 @@ -from src_core_atomistic.atomic_model import AtomicModel +from pathlib import Path +from core_atomistic.atomic_model import AtomicModel +from core_atomistic.periodic_table import TPeriodTable + import pytest +@pytest.fixture +def tests_path() -> Path: + return Path(__file__).parent + + +@pytest.fixture +def period_table() -> TPeriodTable: + return TPeriodTable() + + @pytest.fixture def h2o_model() -> AtomicModel: # x y z let charge diff --git a/tests_core/core_atomistic/test_atom.py b/tests_core_atomistic/test_atom.py similarity index 88% rename from tests_core/core_atomistic/test_atom.py rename to tests_core_atomistic/test_atom.py index 3934ee9..8fcdf5a 100644 --- a/tests_core/core_atomistic/test_atom.py +++ b/tests_core_atomistic/test_atom.py @@ -1,4 +1,4 @@ -from src_core_atomistic.atom import Atom +from core_atomistic.atom import Atom def test_atom(): diff --git a/tests_core/core_atomistic/test_atomic_model.py b/tests_core_atomistic/test_atomic_model.py similarity index 98% rename from tests_core/core_atomistic/test_atomic_model.py rename to tests_core_atomistic/test_atomic_model.py index 3ac370b..ccb841f 100644 --- a/tests_core/core_atomistic/test_atomic_model.py +++ b/tests_core_atomistic/test_atomic_model.py @@ -1,4 +1,4 @@ -from src_core_atomistic.atomic_model import AtomicModel +from core_atomistic.atomic_model import AtomicModel import pytest import numpy as np from copy import copy, deepcopy diff --git a/tests_core/core_atomistic/test_helpers.py b/tests_core_atomistic/test_helpers.py similarity index 96% rename from tests_core/core_atomistic/test_helpers.py rename to tests_core_atomistic/test_helpers.py index 38ebba0..bbba4d8 100644 --- a/tests_core/core_atomistic/test_helpers.py +++ b/tests_core_atomistic/test_helpers.py @@ -1,6 +1,6 @@ import numpy as np -from src_core_atomistic import helpers +from core_atomistic import helpers def test_helpers_spacedel(): diff --git a/tests_core/core_atomistic/test_periodic_table.py b/tests_core_atomistic/test_periodic_table.py similarity index 100% rename from tests_core/core_atomistic/test_periodic_table.py rename to tests_core_atomistic/test_periodic_table.py diff --git a/tests_core/core_atomistic_qt/conftest.py b/tests_core_atomistic_qt/conftest.py similarity index 70% rename from tests_core/core_atomistic_qt/conftest.py rename to tests_core_atomistic_qt/conftest.py index d48e37a..0f064d8 100644 --- a/tests_core/core_atomistic_qt/conftest.py +++ b/tests_core_atomistic_qt/conftest.py @@ -1,10 +1,22 @@ -from src_core_atomistic_qt.qt_graph import PyqtGraphWidget -from src_core_atomistic_qt.qt_image import PyqtGraphWidgetImage +from core_atomistic.periodic_table import TPeriodTable +from core_atomistic_qt.qt_graph import PyqtGraphWidget +from core_atomistic_qt.qt_image import PyqtGraphWidgetImage from qtpy.QtWidgets import QApplication +from pathlib import Path import pytest +@pytest.fixture +def tests_path() -> Path: + return Path(__file__).parent + + +@pytest.fixture +def period_table() -> TPeriodTable: + return TPeriodTable() + + @pytest.fixture def get_graph_widget(qapp): diff --git a/tests_core/core_atomistic_qt/test_pygrimagewidget.py b/tests_core_atomistic_qt/test_pygrimagewidget.py similarity index 100% rename from tests_core/core_atomistic_qt/test_pygrimagewidget.py rename to tests_core_atomistic_qt/test_pygrimagewidget.py diff --git a/tests_core/core_atomistic_qt/test_pygrwidget.py b/tests_core_atomistic_qt/test_pygrwidget.py similarity index 100% rename from tests_core/core_atomistic_qt/test_pygrwidget.py rename to tests_core_atomistic_qt/test_pygrwidget.py From e0f8a2f4f3411c3735e3bb3af00aa790c571290b Mon Sep 17 00:00:00 2001 From: Sergey Sozykin Date: Mon, 8 Jan 2024 16:15:57 +0500 Subject: [PATCH 5/7] comment some *.update() for pyside6 --- .github/workflows/python-app.yml | 4 ++-- src/gui4dft.py | 2 +- src/program/siesta.py | 1 - src/qtbased/{mainform.py => gui4dftform.py} | 16 ++++++++++------ tests/gui4dft_opengl/conftest.py | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) rename src/qtbased/{mainform.py => gui4dftform.py} (99%) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index cc36e55..63bc1e2 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -53,7 +53,7 @@ jobs: pip install -r requirements-dev.txt - name: Test with pytest run: | - python -m pytest tests_core --cov=src/core_atomistic --cov-report=xml --cov-report=term-missing --ignore=tests_core/core_atomistic_qt + python -m pytest tests_core_atomistic --cov=src/core_atomistic --cov-report=xml --cov-report=term-missing test-linux: @@ -72,7 +72,7 @@ jobs: pip install -r requirements-dev.txt - name: Test with pytest run: | - python -m pytest tests --cov=src/src_gui4dft --cov-report=xml --cov-report=term-missing --ignore=tests/gui4dft_opengl + python -m pytest tests --cov=src --cov-report=xml --cov-report=term-missing --ignore=tests/gui4dft_opengl - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: diff --git a/src/gui4dft.py b/src/gui4dft.py index a573714..8213b9f 100644 --- a/src/gui4dft.py +++ b/src/gui4dft.py @@ -12,7 +12,7 @@ from qtpy.QtGui import QIcon from qtpy.QtWidgets import QApplication -from qtbased.mainform import MainForm +from qtbased.gui4dftform import MainForm sys.path.append('.') diff --git a/src/program/siesta.py b/src/program/siesta.py index 17e8675..d1cfdef 100644 --- a/src/program/siesta.py +++ b/src/program/siesta.py @@ -497,7 +497,6 @@ def atoms_from_fdf_prepare(filename): row_data = chemical_species_label[j].split() tag = "" if int(row_data[1]) > 0 else int(row_data[1]) chem_spec_info[row_data[0]] = [int(abs(int(row_data[1]))), row_data[2], tag] - print(chem_spec_info) return atomic_coordinates_format, number_of_atoms, chem_spec_info, lat, lat_vectors, units @staticmethod diff --git a/src/qtbased/mainform.py b/src/qtbased/gui4dftform.py similarity index 99% rename from src/qtbased/mainform.py rename to src/qtbased/gui4dftform.py index eb903d5..4d88c9b 100644 --- a/src/qtbased/mainform.py +++ b/src/qtbased/gui4dftform.py @@ -10,7 +10,9 @@ from pathlib import Path from copy import deepcopy from operator import itemgetter +import matplotlib import matplotlib.pyplot as plt +matplotlib.use('QtAgg') import numpy as np from qtpy.QtCore import QLocale, QSettings, Qt, QSize @@ -831,7 +833,7 @@ def check_dos(self, f_name: str) -> None: # pragma: no cover q_tab_widg.setToolTip(dos_file) self.ui.FormActionsTabeDOSProperty.setItem(i - 1, 0, q_tab_widg) self.ui.FormActionsTabeDOSProperty.setItem(i - 1, 1, QTableWidgetItem(str(e_fermy))) - self.ui.FormActionsTabeDOSProperty.update() + # self.ui.FormActionsTabeDOSProperty.update() def check_volumeric_data(self, file_name): files = [] @@ -855,7 +857,8 @@ def check_volumeric_data(self, file_name): if os.path.exists(file): self.ui.FormActionsPostList3DData.addItems([file]) self.ui.FormActionsPostButSurfaceParse.setEnabled(True) - self.ui.FormActionsPostList3DData.update() + # self.ui.FormActionsPostList3DData.update() + self.ui.FormActionsPostList3DData.setCurrentRow(0) def change_fragment1_status_by_x(self): x_min = self.ui.xminborder.value() @@ -1122,7 +1125,7 @@ def fill_models_list(self): self.ui.FormModelComboModels.setModel(model) self.ui.FormModelComboModels.setCurrentIndex(len(self.models) - 1) self.ui.FormModelComboModels.currentIndexChanged.connect(self.model_to_screen) - self.ui.FormModelComboModels.update() + #self.ui.FormModelComboModels.update() def fill_atoms_table(self): model = self.ui.openGLWidget.get_model().atoms @@ -2359,7 +2362,7 @@ def plot_voronoi(self): def clear_dos(self): self.ui.FormActionsTabeDOSProperty.setRowCount(0) - self.ui.FormActionsTabeDOSProperty.update() + #self.ui.FormActionsTabeDOSProperty.update() def plot_volume_param_energy(self): self.ui.PyqtGraphWidget.set_xticks(None) @@ -2459,8 +2462,9 @@ def plot_curv_and_points(self, xs, ys, xs2, ys2): def plot_cell_approx(self, image_path): image_profile = QImage(image_path) - image_profile = image_profile.scaled(320, 54, aspectRatioMode=Qt.KeepAspectRatio, - transformMode=Qt.SmoothTransformation) + image_profile = image_profile.scaled(320, 54, aspectMode=Qt.KeepAspectRatio, + mode=Qt.SmoothTransformation + ) self.ui.FormActionsPostLabelCellParamFig.setPixmap(QPixmap.fromImage(image_profile)) def save_image_to_file(self, name=""): diff --git a/tests/gui4dft_opengl/conftest.py b/tests/gui4dft_opengl/conftest.py index 97db99b..7d7916f 100644 --- a/tests/gui4dft_opengl/conftest.py +++ b/tests/gui4dft_opengl/conftest.py @@ -1,7 +1,7 @@ from core_atomistic_qt.qt_graph import PyqtGraphWidget from core_atomistic_qt.qt_image import PyqtGraphWidgetImage from qtbased.guiopengl import GuiOpenGL -from qtbased.mainform import MainForm +from qtbased.gui4dftform import MainForm from qtpy.QtCore import QCoreApplication, Qt import pytest From 298dbeb1f8969529183508328f31b1aff7c7de73 Mon Sep 17 00:00:00 2001 From: Sergey Sozykin Date: Wed, 24 Jan 2024 23:12:37 +0500 Subject: [PATCH 6/7] int for text coords --- requirements.txt | 6 ++--- src/core_atomistic_qt/opengl_base.py | 5 +---- src/qtbased/gui4dftform.py | 33 ++++++++++++++++++---------- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/requirements.txt b/requirements.txt index e21b428..b526710 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ pyopengl pyside6 -qtpy==2.4.1 +qtpy ase -numpy==1.26.2 -scipy==1.11.4 +numpy +scipy matplotlib pyqtgraph scikit-image diff --git a/src/core_atomistic_qt/opengl_base.py b/src/core_atomistic_qt/opengl_base.py index a8e21b1..128d50f 100644 --- a/src/core_atomistic_qt/opengl_base.py +++ b/src/core_atomistic_qt/opengl_base.py @@ -619,9 +619,6 @@ def light_prepare(self) -> None: gl.glEnable(gl.GL_LIGHT0) gl.glEnable(gl.GL_DEPTH_TEST) gl.glEnable(gl.GL_COLOR_MATERIAL) - # gl.glDisable(gl.GL_COLOR_MATERIAL) - - # Determine the current lighting model gl.glLightModelf(gl.GL_LIGHT_MODEL_TWO_SIDE, gl.GL_TRUE) # two-side lighting calculation gl.glEnable(gl.GL_LIGHT0) @@ -680,7 +677,7 @@ def render_text(self, text_to_render, font=QFont()): fl = False if fl: used_space.append([pos_x, pos_y]) - painter.drawText(pos_x - self.property_x_shift, pos_y - self.property_y_shift, st) + painter.drawText(int(pos_x - self.property_x_shift), int(pos_y - self.property_y_shift), st) painter.end() @staticmethod diff --git a/src/qtbased/gui4dftform.py b/src/qtbased/gui4dftform.py index 4d88c9b..3744934 100644 --- a/src/qtbased/gui4dftform.py +++ b/src/qtbased/gui4dftform.py @@ -2230,20 +2230,29 @@ def plot_bands(self): title = self.ui.bands_title.text() if os.path.exists(file): - if self.ui.bands_spin_up.isChecked(): + if self.ui.bands_spin_up.isChecked() or self.ui.bands_spin_up_down.isChecked(): bands, emaxf, eminf, homo, kmesh, lumo, xticklabels, xticks = read_siesta_bands(file, True, kmax, kmin) - self.ui.PyqtGraphWidget.plot([kmesh], bands, [None], title, x_title, y_title, False) - - if self.ui.bands_spin_down.isChecked(): - bands, emaxf, eminf, homo, kmesh, lumo, xticklabels, xticks = read_siesta_bands(file, False, kmax, kmin) - self.ui.PyqtGraphWidget.plot([kmesh], bands, [None], title, x_title, y_title, False) - - if self.ui.bands_spin_up_down.isChecked(): - bands, emaxf, eminf, homo, kmesh, lumo, xticklabels, xticks = read_siesta_bands(file, True, kmax, kmin) - self.ui.PyqtGraphWidget.plot([kmesh], bands, [None], title, x_title, y_title, False) - + b_mins = np.min(bands, 1) + b_maxs = np.max(bands, 1) + inds = np.zeros(len(bands), dtype=int) + for i in range(len(bands)): + if (b_mins[i] >= emin) and (b_mins[i] <= emax) or (b_maxs[i] >= emin) and (b_maxs[i] <= emax): + inds[i] = i + self.ui.PyqtGraphWidget.plot([kmesh], bands[inds], [None], title, x_title, y_title, False) + + if self.ui.bands_spin_down.isChecked() or self.ui.bands_spin_up_down.isChecked(): bands, emaxf, eminf, homo, kmesh, lumo, xticklabels, xticks = read_siesta_bands(file, False, kmax, kmin) - self.ui.PyqtGraphWidget.plot([kmesh], bands, [None], title, x_title, y_title, False, _style=Qt.DotLine) + b_mins = np.min(bands, 1) + b_maxs = np.max(bands, 1) + inds = np.zeros(len(bands), dtype=int) + for i in range(len(bands)): + if (b_mins[i] >= emin) and (b_mins[i] <= emax) or (b_maxs[i] >= emin) and (b_maxs[i] <= emax): + inds[i] = i + if self.ui.bands_spin_down.isChecked(): + self.ui.PyqtGraphWidget.plot([kmesh], bands[inds], [None], title, x_title, y_title, False) + if self.ui.bands_spin_up_down.isChecked(): + self.ui.PyqtGraphWidget.plot([kmesh], bands[inds], [None], title, x_title, y_title, False, + _style=Qt.DotLine) major_tick = [] for index in range(len(xticks)): From c81246dba83ab6c830c139787e137f0c45718b0b Mon Sep 17 00:00:00 2001 From: Sergey Sozykin Date: Sun, 4 Feb 2024 23:46:35 +0500 Subject: [PATCH 7/7] Add HGY as available model; LAMMPS input generator --- src/core_atomistic/atomic_model.py | 10 ++++ src/core_atomistic/periodic_table.py | 9 ++-- src/models/cells/hgy.fdf | 69 ++++++++++++++++++++++++++++ src/models/meta_graphene.py | 3 ++ src/program/dftb.py | 9 +--- src/program/lammps.py | 52 +++++++++++++++++++++ src/qtbased/gui4dftform.py | 19 +++++++- src/ui/form-v1.x.ui | 62 ++++++++++--------------- src/ui/form.py | 64 +++++++++++--------------- 9 files changed, 212 insertions(+), 85 deletions(-) create mode 100644 src/models/cells/hgy.fdf diff --git a/src/core_atomistic/atomic_model.py b/src/core_atomistic/atomic_model.py index 79f825e..4900cc6 100644 --- a/src/core_atomistic/atomic_model.py +++ b/src/core_atomistic/atomic_model.py @@ -783,6 +783,16 @@ def types_of_atoms(self): types.append([i, elements[i]]) return types + def get_charge_to_type_array(self): + per_tab = self.mendeley + text = "" + types = self.types_of_atoms() + charge_to_type = np.zeros(200, dtype=int) + for i in range(0, len(types)): + text += ' ' + str(per_tab.get_let(int(types[i][0]))) + charge_to_type[int(types[i][0])] = i + 1 + return charge_to_type, text + def formula(self): text = "" charges = self.types_of_atoms() diff --git a/src/core_atomistic/periodic_table.py b/src/core_atomistic/periodic_table.py index bf099e7..408d52f 100644 --- a/src/core_atomistic/periodic_table.py +++ b/src/core_atomistic/periodic_table.py @@ -1,18 +1,21 @@ # -*- coding: utf-8 -*- import numpy as np -from ase.data import covalent_radii +from ase.data import covalent_radii, atomic_masses_common from ase.data.colors import cpk_colors, jmol_colors class TPeriodTableAtom: """Replace color by 'user_color', 'ase_color', 'xxx_color'""" - def __init__(self, charge, radius, let, color, mass=1): + def __init__(self, charge, radius, let, color, mass=0): self.charge = charge self.radius = radius self.let = let # self.color = color - self.mass = mass + if (mass == 0) and (charge < 119): + self.mass = atomic_masses_common[charge] + else: + self.mass = mass default_color = [0.6, 0.6, 1.0, 1.0] diff --git a/src/models/cells/hgy.fdf b/src/models/cells/hgy.fdf new file mode 100644 index 0000000..fb68a59 --- /dev/null +++ b/src/models/cells/hgy.fdf @@ -0,0 +1,69 @@ +NumberOfAtoms 24 +NumberOfSpecies 1 +WriteCoorStep True +%block ChemicalSpeciesLabel + 1 6 C +%endblock ChemicalSpeciesLabel +LatticeConstant 1.0 Ang +%block LatticeParameters + 10.918132 10.928019191942518 30.0 90.0 90.0 120.00000 +%endblock LatticeParameters +AtomicCoordinatesFormat Ang +%block AtomicCoordinatesAndAtomicSpecies + 7.73771075 3.91646015 0.00321888 1 + 5.83793527 5.69686868 0.00319663 1 + 7.00307550 2.64489670 0.00307992 1 + 5.58637353 2.79043812 0.00286192 1 + 6.90851533 5.07320737 0.00327538 1 + 4.51568352 3.41388222 0.00280007 1 + 2.27998040 4.56839740 0.00299596 1 + 3.68665538 4.57067093 0.00292072 1 + 1.45070689 3.41175512 0.00293376 1 + 0.12813302 5.69609889 0.00325181 1 + 1.54433620 5.83873967 0.00311587 1 + 2.24726774 7.05705163 0.00304912 1 + 3.71590058 7.05956093 0.00303845 1 + 4.42123046 5.84219660 0.00303219 1 + 1.66047367 8.35368040 0.00310463 1 + 4.29878106 8.35798568 0.00318221 1 + 9.14444238 3.91853989 0.00325878 1 + 9.88011355 2.64811366 0.00317446 1 + 7.70830376 1.42741070 0.00313964 1 + 9.17704378 1.42984463 0.00319481 1 + 7.12538799 0.12889487 0.00300610 1 + 9.76369877 0.13318502 0.00312341 1 + 9.97401099 5.07495527 0.00337039 1 + 11.29642180 2.79082798 0.00306982 1 +%endblock AtomicCoordinatesAndAtomicSpecies +SystemName tpdhg +SystemLabel C224 +WriteMullikenPop 1 +PAO.BasisSize DZP +MeshCutoff 350.0 Ry +SpinPolarized True +MaxSCFIterations 150 +SolutionMethod diagon +NetCharge 0.00 +DM.NumberPulay 4 +DM.MixingWeight 0.3 +DM.UseSaveDM .true. +NeglNonOverlapInt False +XC.functional=GGA +XC.authors=PBE +WriteCoorXmol True +WriteForces .true. +WriteMullikenPop 1 +MD.TypeOfRun cg # Type of dynamics: Conjugate gradients +MD.NumCGsteps 320 # number of CG steps +MD.MaxCGDispl 0.10 Ang +MD.MaxForceTol 0.04 eV/Ang +MD.UseSaveXV yes +MD.VariableCell .false. +%block kgrid_Monkhorst_Pack + 3 0 0 0.0 + 0 3 0 0.0 + 0 0 1 0.0 +%endblock kgrid_Monkhorst_Pack +%block ProjectedDensityOfStates + -24.00 15.00 0.100 1000 eV +%endblock ProjectedDensityOfStates diff --git a/src/models/meta_graphene.py b/src/models/meta_graphene.py index 3cca0bb..6412f7c 100644 --- a/src/models/meta_graphene.py +++ b/src/models/meta_graphene.py @@ -22,6 +22,9 @@ def __init__(self, model_type: str = "irida-graphene", n=0, m=0): if model_type == "tpdh-graphene": f_name = str(Path(__file__).parent / "cells" / 'tpdhg.fdf') + if model_type == "HGY": + f_name = str(Path(__file__).parent / "cells" / 'hgy.fdf') + basis, fdf = ImporterExporter.import_from_file(f_name, fl='all', prop=False) basis = basis[0] diff --git a/src/program/dftb.py b/src/program/dftb.py index b07ff14..c6a70a0 100644 --- a/src/program/dftb.py +++ b/src/program/dftb.py @@ -24,13 +24,8 @@ def model_to_dftb_d0(model: AtomicModel): model1 = deepcopy(model) model1.sort_atoms_by_type() types = model1.types_of_atoms() - - per_tab = TPeriodTable() - charge_to_type = np.zeros(200, dtype=int) - for i in range(0, len(types)): - text += ' ' + str(per_tab.get_let(int(types[i][0]))) - charge_to_type[int(types[i][0])] = i + 1 - text += "\n\n" + charge_to_type,text1 = model1.get_charge_to_type_array() + text += text1 + "\n\n" for i in range(n_atoms): xyz_st = model1[i].xyz_string diff --git a/src/program/lammps.py b/src/program/lammps.py index ce5fd05..74ae5c8 100644 --- a/src/program/lammps.py +++ b/src/program/lammps.py @@ -3,6 +3,58 @@ from core_atomistic.atomic_model import AtomicModel +def model_to_lammps_input(model: AtomicModel): + """ + # Comment + + 4577 atoms + 3 atom types + + 0.000000000000 36.920000000000 xlo xhi + 0.000000000000 36.920000000000 ylo yhi + 0.000000000000 36.920000000000 zlo zhi + + Masses + + 1 55.84500000 # Fe + 2 50.94150000 # V + 3 12.01100000 # C + + Atoms # atomic + + 1 1 35.499999943200 4.260000170400 24.139999858000 + 2 1 0.000000000000 5.679999858000 22.720000170400 + 3 1 24.139999858000 4.260000170400 24.139999858000 + 4 1 34.079999886400 2.840000113600 22.720000170400 + 5 1 8.519999971600 5.679999858000 22.720000170400 + 6 1 4.260000170400 7.099999914800 24.139999858000 + 7 1 2.840000113600 5.679999858000 22.720000170400 + """ + + text = "# Comment\n" + n_atoms = model.n_atoms() + text += str(n_atoms) + " atoms\n" + types = model.types_of_atoms() + text += str(len(types)) + " atom types\n\n" + + text += "0.000000000000 36.920000000000 xlo xhi\n" + text += "0.000000000000 36.920000000000 ylo yhi\n" + text += "0.000000000000 36.920000000000 zlo zhi\n\n" + + text += "Masses\n\n" + for i in range(len(types)): + item = model.mendeley.Atoms[types[i][0]] + text += str(i + 1) + " " + str(item.mass) + " #" + item.let + "\n" + + text += "Atoms # atomic\n\n" + charge_to_type, text1 = model.get_charge_to_type_array() + + for i in range(n_atoms): + xyz_st = model[i].xyz_string + text += str(i + 1) + " " + str(charge_to_type[model[i].charge]) + " " + xyz_st + "\n" + return text + + def atoms_trajectory_step(f_name): model = AtomicModel() n_atoms = 0 diff --git a/src/qtbased/gui4dftform.py b/src/qtbased/gui4dftform.py index 3744934..5253c1b 100644 --- a/src/qtbased/gui4dftform.py +++ b/src/qtbased/gui4dftform.py @@ -43,6 +43,7 @@ from program.wien import model_to_wien_struct from program.vasp import TVASP, vasp_dos, model_to_vasp_poscar from program.dftb import model_to_dftb_d0 +from program.lammps import model_to_lammps_input from program import crystal from program import ase from program.fdfdata import TFDFFile @@ -172,6 +173,7 @@ def setup_ui(self): # pragma: no cover self.ui.crystal_2d_d12_generate.clicked.connect(self.d12_2D_to_form) self.ui.crystal_3d_d12_generate.clicked.connect(self.d12_3D_to_form) self.ui.dftb_0d_generate.clicked.connect(self.dftb_0D_to_form) + self.ui.lammps_generate.clicked.connect(self.lammps_to_form) self.ui.data_from_form_to_input_file.clicked.connect(self.data_from_form_to_input_file) self.ui.model_rotation_x.valueChanged.connect(self.model_orientation_changed) @@ -384,6 +386,7 @@ def setup_ui(self): # pragma: no cover model_meta_gr_type.appendRow(QStandardItem("psi-graphene")) model_meta_gr_type.appendRow(QStandardItem("biphenylene")) model_meta_gr_type.appendRow(QStandardItem("tpdh-graphene")) + model_meta_gr_type.appendRow(QStandardItem("HGY")) self.ui.model_meta_gr_type.setModel(model_meta_gr_type) bi_element_type_tube = QStandardItemModel() @@ -655,12 +658,12 @@ def add_isosurface_color_to_table(self): self.ui.FormActionsPostButSurfaceDelete.setEnabled(True) def set_part1_file(self) -> None: - f_name = self.get_file_name_from_open_dialog("All files (*.*)") + f_name = self.get_file_name_from_open_dialog("All files (*)") if os.path.exists(f_name): self.ui.part1_file.setText(f_name) def set_part2_file(self) -> None: - f_name = self.get_file_name_from_open_dialog("All files (*.*)") + f_name = self.get_file_name_from_open_dialog("All files (*)") if os.path.exists(f_name): self.ui.part2_file.setText(f_name) @@ -2924,6 +2927,18 @@ def ase_raman_and_ir_plot(self): self.ui.Form3Dand2DTabs.setCurrentIndex(1) self.ui.PyqtGraphWidget.plot([x_fig], [y_fig], [None], title, x_title, y_title, True) + def lammps_to_form(self): + if len(self.models) == 0: + return + try: + text = "Not implemented" + model = self.models[self.active_model_id] + text = model_to_lammps_input(model) + if len(text) > 0: + self.ui.FormActionsPreTextFDF.setText(text) + except Exception as e: + self.show_error(e) + def dftb_0D_to_form(self): if len(self.models) == 0: return diff --git a/src/ui/form-v1.x.ui b/src/ui/form-v1.x.ui index 7176fbc..55fd10e 100644 --- a/src/ui/form-v1.x.ui +++ b/src/ui/form-v1.x.ui @@ -1670,8 +1670,8 @@ 0 0 - 323 - 466 + 371 + 562 @@ -3658,8 +3658,8 @@ 0 0 - 371 - 562 + 361 + 405 @@ -4003,8 +4003,8 @@ 0 0 - 371 - 562 + 352 + 209 @@ -4294,6 +4294,14 @@ + + + 0 + 0 + 100 + 30 + + Сhange type of atoms @@ -6018,17 +6026,14 @@ - - - - 0 - 0 - + + + QFrame::StyledPanel - - DFTB+ + + QFrame::Raised - + 0 @@ -6042,39 +6047,22 @@ 0 - + - false - - - 3D - - - - - - - false + true - 2D + LAMMPS - - - - - + false - - 1D - - 0D + DFTB+ 0D diff --git a/src/ui/form.py b/src/ui/form.py index 93c1bf7..c65c4ce 100644 --- a/src/ui/form.py +++ b/src/ui/form.py @@ -960,7 +960,7 @@ def setupUi(self, MainWindow): self.toolBox.addItem(self.page_4, u"1D (nanotubes)") self.page_17 = QWidget() self.page_17.setObjectName(u"page_17") - self.page_17.setGeometry(QRect(0, 0, 323, 466)) + self.page_17.setGeometry(QRect(0, 0, 371, 562)) self.verticalLayout_27 = QVBoxLayout(self.page_17) self.verticalLayout_27.setObjectName(u"verticalLayout_27") self.groupBox_30 = QGroupBox(self.page_17) @@ -1415,7 +1415,7 @@ def setupUi(self, MainWindow): self.toolBox.addItem(self.page_5, u"3D (bulk)") self.page_6 = QWidget() self.page_6.setObjectName(u"page_6") - self.page_6.setGeometry(QRect(0, 0, 371, 562)) + self.page_6.setGeometry(QRect(0, 0, 337, 549)) self.verticalLayout_93 = QVBoxLayout(self.page_6) self.verticalLayout_93.setObjectName(u"verticalLayout_93") self.groupBox_40 = QGroupBox(self.page_6) @@ -2406,6 +2406,10 @@ def setupUi(self, MainWindow): self.verticalLayout_36.addItem(self.verticalSpacer_6) self.toolBox_6.addItem(self.page, u"Cell") + self.page_9 = QWidget() + self.page_9.setObjectName(u"page_9") + self.page_9.setGeometry(QRect(0, 0, 100, 30)) + self.toolBox_6.addItem(self.page_9, u"\u0421hange type of atoms") self.page_28 = QWidget() self.page_28.setObjectName(u"page_28") self.page_28.setGeometry(QRect(0, 0, 307, 467)) @@ -3273,37 +3277,27 @@ def setupUi(self, MainWindow): self.verticalLayout_78.addWidget(self.frame_161) - self.groupBox_60 = QGroupBox(self.tab_24) - self.groupBox_60.setObjectName(u"groupBox_60") - self.groupBox_60.setMinimumSize(QSize(0, 0)) - self.horizontalLayout_200 = QHBoxLayout(self.groupBox_60) - self.horizontalLayout_200.setObjectName(u"horizontalLayout_200") - self.horizontalLayout_200.setContentsMargins(0, 0, 0, 0) - self.pushButton_4 = QPushButton(self.groupBox_60) - self.pushButton_4.setObjectName(u"pushButton_4") - self.pushButton_4.setEnabled(False) - - self.horizontalLayout_200.addWidget(self.pushButton_4) - - self.pushButton = QPushButton(self.groupBox_60) - self.pushButton.setObjectName(u"pushButton") - self.pushButton.setEnabled(False) - - self.horizontalLayout_200.addWidget(self.pushButton) - - self.pushButton_2 = QPushButton(self.groupBox_60) - self.pushButton_2.setObjectName(u"pushButton_2") - self.pushButton_2.setEnabled(False) - - self.horizontalLayout_200.addWidget(self.pushButton_2) - - self.dftb_0d_generate = QPushButton(self.groupBox_60) + self.frame_29 = QFrame(self.tab_24) + self.frame_29.setObjectName(u"frame_29") + self.frame_29.setFrameShape(QFrame.StyledPanel) + self.frame_29.setFrameShadow(QFrame.Raised) + self.horizontalLayout_181 = QHBoxLayout(self.frame_29) + self.horizontalLayout_181.setObjectName(u"horizontalLayout_181") + self.horizontalLayout_181.setContentsMargins(0, 0, 0, 0) + self.lammps_generate = QPushButton(self.frame_29) + self.lammps_generate.setObjectName(u"lammps_generate") + self.lammps_generate.setEnabled(True) + self.lammps_generate.setCheckable(False) + + self.horizontalLayout_181.addWidget(self.lammps_generate) + + self.dftb_0d_generate = QPushButton(self.frame_29) self.dftb_0d_generate.setObjectName(u"dftb_0d_generate") - self.horizontalLayout_200.addWidget(self.dftb_0d_generate) + self.horizontalLayout_181.addWidget(self.dftb_0d_generate) - self.verticalLayout_78.addWidget(self.groupBox_60) + self.verticalLayout_78.addWidget(self.frame_29) self.FormActionsPreTextFDF = QTextBrowser(self.tab_24) self.FormActionsPreTextFDF.setObjectName(u"FormActionsPreTextFDF") @@ -3356,7 +3350,7 @@ def setupUi(self, MainWindow): self.toolBox_2.setStyleSheet(u"") self.page_19 = QWidget() self.page_19.setObjectName(u"page_19") - self.page_19.setGeometry(QRect(0, 0, 340, 627)) + self.page_19.setGeometry(QRect(0, 0, 399, 675)) self.verticalLayout_6 = QVBoxLayout(self.page_19) self.verticalLayout_6.setSpacing(0) self.verticalLayout_6.setObjectName(u"verticalLayout_6") @@ -6884,7 +6878,7 @@ def setupUi(self, MainWindow): self.Form3Dand2DTabs.addItem(self.page_7, u"3D View") self.page_8 = QWidget() self.page_8.setObjectName(u"page_8") - self.page_8.setGeometry(QRect(0, 0, 98, 100)) + self.page_8.setGeometry(QRect(0, 0, 665, 765)) self.horizontalLayout = QHBoxLayout(self.page_8) self.horizontalLayout.setObjectName(u"horizontalLayout") self.horizontalLayout.setContentsMargins(0, 0, 0, 0) @@ -7127,6 +7121,7 @@ def retranslateUi(self, MainWindow): self.toolBox_6.setItemText(self.toolBox_6.indexOf(self.page_29), QCoreApplication.translate("MainWindow", u"Add or Modify Atom", None)) self.FormModifyCellButton.setText(QCoreApplication.translate("MainWindow", u"Edit", None)) self.toolBox_6.setItemText(self.toolBox_6.indexOf(self.page), QCoreApplication.translate("MainWindow", u"Cell", None)) + self.toolBox_6.setItemText(self.toolBox_6.indexOf(self.page_9), QCoreApplication.translate("MainWindow", u"\u0421hange type of atoms", None)) self.label.setText(QCoreApplication.translate("MainWindow", u"

This tab is designed to search for various configurations of a given number of atoms within a given cylindrical volume.

", None)) self.label_3.setText(QCoreApplication.translate("MainWindow", u"nAtoms", None)) self.label_6.setText(QCoreApplication.translate("MainWindow", u"charge of atoms", None)) @@ -7186,11 +7181,8 @@ def retranslateUi(self, MainWindow): self.crystal_2d_d12_generate.setText(QCoreApplication.translate("MainWindow", u"2D", None)) self.crystal_1d_d12_generate.setText(QCoreApplication.translate("MainWindow", u"1D", None)) self.crystal_0d_d12_generate.setText(QCoreApplication.translate("MainWindow", u"0D", None)) - self.groupBox_60.setTitle(QCoreApplication.translate("MainWindow", u"DFTB+", None)) - self.pushButton_4.setText(QCoreApplication.translate("MainWindow", u"3D", None)) - self.pushButton.setText(QCoreApplication.translate("MainWindow", u"2D", None)) - self.pushButton_2.setText(QCoreApplication.translate("MainWindow", u"1D", None)) - self.dftb_0d_generate.setText(QCoreApplication.translate("MainWindow", u"0D", None)) + self.lammps_generate.setText(QCoreApplication.translate("MainWindow", u"LAMMPS", None)) + self.dftb_0d_generate.setText(QCoreApplication.translate("MainWindow", u"DFTB+ 0D", None)) self.data_from_form_to_input_file.setText(QCoreApplication.translate("MainWindow", u"Save", None)) self.tabWidget_3.setTabText(self.tabWidget_3.indexOf(self.tab_24), QCoreApplication.translate("MainWindow", u"Input file generator", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.FormTabActions), QCoreApplication.translate("MainWindow", u"Preprocessing", None))