Skip to content

Commit

Permalink
[chore] Formatting and import sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kastakin committed Nov 15, 2024
1 parent c39cf5a commit 43b6bdd
Show file tree
Hide file tree
Showing 41 changed files with 5,333 additions and 2,518 deletions.
4 changes: 2 additions & 2 deletions src/main/python/pyes/commands/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
QTabWidget,
QWidget,
)

from utils_func import get_widgets_from_tab


Expand Down Expand Up @@ -191,7 +190,6 @@ def __init__(
titration_tabs: QTabWidget,
index: int,
):

QUndoCommand.__init__(self)
self.field = field
self.affected_fields = affected_fields
Expand All @@ -204,6 +202,7 @@ def __init__(

def undo(self) -> None:
from ui.widgets import CustomSpinBox

for field in self.affected_fields:
field.setEnabled(self.previous_state)

Expand Down Expand Up @@ -236,6 +235,7 @@ def undo(self) -> None:

def redo(self) -> None:
from ui.widgets import CustomSpinBox

for field in self.affected_fields:
field.setEnabled(self.state)

Expand Down
12 changes: 6 additions & 6 deletions src/main/python/pyes/commands/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ def __init__(

def undo(self) -> None:
self.model.insertRows(position=self.position - self.number, rows=self.number)
self.model._data.iloc[(self.position - self.number) : (self.position), :] = (
self.removed_rows
)
self.model._data.iloc[
(self.position - self.number) : (self.position), :
] = self.removed_rows
for item, row in zip(self.list_items, self.indexes):
self.betas_list.insertItem(row, item)

Expand Down Expand Up @@ -518,9 +518,9 @@ def undo(self) -> None:

for i, m in enumerate(self.titrations_models):
m.insertRows(position=self.position - self.number, rows=self.number)
m._data.iloc[(self.position - self.number) : (self.position), :] = (
self.titrations_removed_rows[i]
)
m._data.iloc[
(self.position - self.number) : (self.position), :
] = self.titrations_removed_rows[i]

self.conc_to_refine.setRowCount(len(self.previous_state))
apply_table_map(self.conc_to_refine, self.previous_state)
Expand Down
6 changes: 3 additions & 3 deletions src/main/python/pyes/commands/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from PySide6.QtWidgets import (
QHBoxLayout,
QTabBar,
QTableView,
QTableWidget,
QTabWidget,
QWidget,
QTableWidget,
QTableView,
)
from ui.widgets.combobox import CustomComboBox
from ui.widgets import inputTitrationOpt
from ui.widgets.combobox import CustomComboBox
from utils_func import apply_table_map, get_table_map, get_widgets_from_tab


Expand Down
2 changes: 1 addition & 1 deletion src/main/python/pyes/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def run(self):
input_path,
"r",
) as input_file:
jsdata = json.load(input_file)
jsdata = json.load(input_file)
w.load_project_file(jsdata)

w.show()
Expand Down
11 changes: 9 additions & 2 deletions src/main/python/pyes/resources_rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3767,10 +3767,17 @@
\x00\x00\x01\x8c\xf2\x8c\xb6\x97\
"


def qInitResources():
QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)
QtCore.qRegisterResourceData(
0x03, qt_resource_struct, qt_resource_name, qt_resource_data
)


def qCleanupResources():
QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)
QtCore.qUnregisterResourceData(
0x03, qt_resource_struct, qt_resource_name, qt_resource_data
)


qInitResources()
90 changes: 69 additions & 21 deletions src/main/python/pyes/ui/PyES_about.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,55 @@
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################

from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QAbstractButton, QApplication, QDialog, QDialogButtonBox,
QLabel, QSizePolicy, QVBoxLayout, QWidget)
import resources_rc
from PySide6.QtCore import (
QCoreApplication,
QDate,
QDateTime,
QLocale,
QMetaObject,
QObject,
QPoint,
QRect,
QSize,
Qt,
QTime,
QUrl,
)
from PySide6.QtGui import (
QBrush,
QColor,
QConicalGradient,
QCursor,
QFont,
QFontDatabase,
QGradient,
QIcon,
QImage,
QKeySequence,
QLinearGradient,
QPainter,
QPalette,
QPixmap,
QRadialGradient,
QTransform,
)
from PySide6.QtWidgets import (
QAbstractButton,
QApplication,
QDialog,
QDialogButtonBox,
QLabel,
QSizePolicy,
QVBoxLayout,
QWidget,
)


class Ui_dialogAbout(object):
def setupUi(self, dialogAbout):
if not dialogAbout.objectName():
dialogAbout.setObjectName(u"dialogAbout")
dialogAbout.setObjectName("dialogAbout")
dialogAbout.resize(471, 298)
sizePolicy = QSizePolicy(QSizePolicy.Policy.Maximum, QSizePolicy.Policy.Maximum)
sizePolicy.setHorizontalStretch(0)
Expand All @@ -32,43 +66,57 @@ def setupUi(self, dialogAbout):
dialogAbout.setMinimumSize(QSize(471, 298))
dialogAbout.setMaximumSize(QSize(471, 298))
self.verticalLayout = QVBoxLayout(dialogAbout)
self.verticalLayout.setObjectName(u"verticalLayout")
self.verticalLayout.setObjectName("verticalLayout")
self.label = QLabel(dialogAbout)
self.label.setObjectName(u"label")
self.label.setObjectName("label")

self.verticalLayout.addWidget(self.label)

self.label_3 = QLabel(dialogAbout)
self.label_3.setObjectName(u"label_3")
sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Maximum)
self.label_3.setObjectName("label_3")
sizePolicy1 = QSizePolicy(
QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Maximum
)
sizePolicy1.setHorizontalStretch(0)
sizePolicy1.setVerticalStretch(0)
sizePolicy1.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
self.label_3.setSizePolicy(sizePolicy1)
self.label_3.setWordWrap(True)
self.label_3.setOpenExternalLinks(True)
self.label_3.setTextInteractionFlags(Qt.LinksAccessibleByMouse|Qt.TextSelectableByMouse)
self.label_3.setTextInteractionFlags(
Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse
)

self.verticalLayout.addWidget(self.label_3)

self.dialogButtonBox = QDialogButtonBox(dialogAbout)
self.dialogButtonBox.setObjectName(u"dialogButtonBox")
self.dialogButtonBox.setObjectName("dialogButtonBox")
self.dialogButtonBox.setOrientation(Qt.Horizontal)
self.dialogButtonBox.setStandardButtons(QDialogButtonBox.Ok)

self.verticalLayout.addWidget(self.dialogButtonBox)


self.retranslateUi(dialogAbout)
self.dialogButtonBox.accepted.connect(dialogAbout.accept)
self.dialogButtonBox.rejected.connect(dialogAbout.reject)

QMetaObject.connectSlotsByName(dialogAbout)

# setupUi

def retranslateUi(self, dialogAbout):
dialogAbout.setWindowTitle(QCoreApplication.translate("dialogAbout", u"About", None))
self.label.setText(QCoreApplication.translate("dialogAbout", u"PyES Version 2.0.0beta", None))
self.label_3.setText(QCoreApplication.translate("dialogAbout", u"<html><head/><body><p>PyES is a sotware created by the chemistry department of the University of Turin in collabration with the University of Messina and the University of Bialystok.</p><p>Based on the previous work of Professor Sammartano of the University of Messina, PyES aims to empower researchers with the ability to easly compute species distribution and simulate titration curves even for complex systems.</p><p>PyES is licensed under GPL3 and its source code is aviable on its entirety on <a href=\"https://github.com/Kastakin/PyES\"><span style=\" text-decoration: underline; color:#0000ff;\">GitHub</span></a>.</p></body></html>", None))
# retranslateUi
dialogAbout.setWindowTitle(
QCoreApplication.translate("dialogAbout", "About", None)
)
self.label.setText(
QCoreApplication.translate("dialogAbout", "PyES Version 2.0.0beta", None)
)
self.label_3.setText(
QCoreApplication.translate(
"dialogAbout",
'<html><head/><body><p>PyES is a sotware created by the chemistry department of the University of Turin in collabration with the University of Messina and the University of Bialystok.</p><p>Based on the previous work of Professor Sammartano of the University of Messina, PyES aims to empower researchers with the ability to easly compute species distribution and simulate titration curves even for complex systems.</p><p>PyES is licensed under GPL3 and its source code is aviable on its entirety on <a href="https://github.com/Kastakin/PyES"><span style=" text-decoration: underline; color:#0000ff;">GitHub</span></a>.</p></body></html>',
None,
)
)

# retranslateUi
86 changes: 66 additions & 20 deletions src/main/python/pyes/ui/PyES_about_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,55 @@
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################

from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QAbstractButton, QApplication, QDialog, QDialogButtonBox,
QLabel, QSizePolicy, QVBoxLayout, QWidget)
import resources_rc
from PySide6.QtCore import (
QCoreApplication,
QDate,
QDateTime,
QLocale,
QMetaObject,
QObject,
QPoint,
QRect,
QSize,
Qt,
QTime,
QUrl,
)
from PySide6.QtGui import (
QBrush,
QColor,
QConicalGradient,
QCursor,
QFont,
QFontDatabase,
QGradient,
QIcon,
QImage,
QKeySequence,
QLinearGradient,
QPainter,
QPalette,
QPixmap,
QRadialGradient,
QTransform,
)
from PySide6.QtWidgets import (
QAbstractButton,
QApplication,
QDialog,
QDialogButtonBox,
QLabel,
QSizePolicy,
QVBoxLayout,
QWidget,
)


class Ui_dialogAbout(object):
def setupUi(self, dialogAbout):
if not dialogAbout.objectName():
dialogAbout.setObjectName(u"dialogAbout")
dialogAbout.setObjectName("dialogAbout")
dialogAbout.resize(471, 298)
sizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
sizePolicy.setHorizontalStretch(0)
Expand All @@ -32,43 +66,55 @@ def setupUi(self, dialogAbout):
dialogAbout.setMinimumSize(QSize(471, 298))
dialogAbout.setMaximumSize(QSize(471, 298))
self.verticalLayout = QVBoxLayout(dialogAbout)
self.verticalLayout.setObjectName(u"verticalLayout")
self.verticalLayout.setObjectName("verticalLayout")
self.label = QLabel(dialogAbout)
self.label.setObjectName(u"label")
self.label.setObjectName("label")

self.verticalLayout.addWidget(self.label)

self.label_3 = QLabel(dialogAbout)
self.label_3.setObjectName(u"label_3")
self.label_3.setObjectName("label_3")
sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Maximum)
sizePolicy1.setHorizontalStretch(0)
sizePolicy1.setVerticalStretch(0)
sizePolicy1.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
self.label_3.setSizePolicy(sizePolicy1)
self.label_3.setWordWrap(True)
self.label_3.setOpenExternalLinks(True)
self.label_3.setTextInteractionFlags(Qt.LinksAccessibleByMouse|Qt.TextSelectableByMouse)
self.label_3.setTextInteractionFlags(
Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse
)

self.verticalLayout.addWidget(self.label_3)

self.dialogButtonBox = QDialogButtonBox(dialogAbout)
self.dialogButtonBox.setObjectName(u"dialogButtonBox")
self.dialogButtonBox.setObjectName("dialogButtonBox")
self.dialogButtonBox.setOrientation(Qt.Horizontal)
self.dialogButtonBox.setStandardButtons(QDialogButtonBox.Ok)

self.verticalLayout.addWidget(self.dialogButtonBox)


self.retranslateUi(dialogAbout)
self.dialogButtonBox.accepted.connect(dialogAbout.accept)
self.dialogButtonBox.rejected.connect(dialogAbout.reject)

QMetaObject.connectSlotsByName(dialogAbout)

# setupUi

def retranslateUi(self, dialogAbout):
dialogAbout.setWindowTitle(QCoreApplication.translate("dialogAbout", u"About", None))
self.label.setText(QCoreApplication.translate("dialogAbout", u"PyES Version 1.1.3", None))
self.label_3.setText(QCoreApplication.translate("dialogAbout", u"<html><head/><body><p>PyES is a sotware created by the chemistry department of the University of Turin in collabration with the University of Messina and the University of Bialystok.</p><p>Based on the previous work of Professor Sammartano of the University of Messina, PyES aims to empower researchers with the ability to easly compute species distribution and simulate titration curves even for complex systems.</p><p>PyES is licensed under GPL3 and its source code is aviable on its entirety on <a href=\"https://github.com/Kastakin/PyES\"><span style=\" text-decoration: underline; color:#0000ff;\">GitHub</span></a>.</p></body></html>", None))
# retranslateUi
dialogAbout.setWindowTitle(
QCoreApplication.translate("dialogAbout", "About", None)
)
self.label.setText(
QCoreApplication.translate("dialogAbout", "PyES Version 1.1.3", None)
)
self.label_3.setText(
QCoreApplication.translate(
"dialogAbout",
'<html><head/><body><p>PyES is a sotware created by the chemistry department of the University of Turin in collabration with the University of Messina and the University of Bialystok.</p><p>Based on the previous work of Professor Sammartano of the University of Messina, PyES aims to empower researchers with the ability to easly compute species distribution and simulate titration curves even for complex systems.</p><p>PyES is licensed under GPL3 and its source code is aviable on its entirety on <a href="https://github.com/Kastakin/PyES"><span style=" text-decoration: underline; color:#0000ff;">GitHub</span></a>.</p></body></html>',
None,
)
)

# retranslateUi
Loading

0 comments on commit 43b6bdd

Please sign in to comment.