4 Commits

Author SHA1 Message Date
github-actions[bot]
71e68a645d chore(main): release 0.10.1 (#99)
🤖 I have created a release *beep* *boop*
---


##
[0.10.1](https://github.com/shizand/statapp/compare/v0.10.0...v0.10.1)
(2024-01-29)


### Исправления

* Добавлена обработка ошибок
([#98](https://github.com/shizand/statapp/issues/98))
([c36e1aa](c36e1aa733))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-29 11:19:48 +03:00
MisterMLiL
c36e1aa733 fix: Добавлена обработка ошибок (#98)
Closes #83
Closes #96
Closes #97 

Добавлена обобщенная обработка на большинство методов.
Один из вариантов временно (а может и постоянно)  решить проблемы.
2024-01-29 11:11:53 +03:00
github-actions[bot]
1c88acf772 chore(main): release 0.10.0 (#95)
🤖 I have created a release *beep* *boop*
---


## [0.10.0](https://github.com/shizand/statapp/compare/v0.9.0...v0.10.0)
(2024-01-08)


### Новые функции

* добавлен график ([#94](https://github.com/shizand/statapp/issues/94))
([bb1b2f1](bb1b2f1ec5)),
closes [#86](https://github.com/shizand/statapp/issues/86)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-08 18:57:33 +03:00
bb1b2f1ec5 feat: добавлен график (#94)
Closes #86
2024-01-08 16:09:12 +03:00
40 changed files with 235 additions and 96 deletions

2
.idea/misc.xml generated
View File

@@ -3,5 +3,5 @@
<component name="Black">
<option name="sdkName" value="Poetry (statapp)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="statapp" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Poetry (statapp) (2)" project-jdk-type="Python SDK" />
</project>

2
.idea/stat.iml generated
View File

@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="statapp" jdkType="Python SDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -24,4 +24,5 @@ disable=
missing-docstring,
too-many-public-methods,
too-few-public-methods,
too-many-arguments
too-many-arguments,
broad-except

View File

@@ -1,5 +1,19 @@
# Changelog
## [0.10.1](https://github.com/shizand/statapp/compare/v0.10.0...v0.10.1) (2024-01-29)
### Исправления
* Добавлена обработка ошибок ([#98](https://github.com/shizand/statapp/issues/98)) ([c36e1aa](https://github.com/shizand/statapp/commit/c36e1aa733269720366c4d7dea48d2bdc966a59a))
## [0.10.0](https://github.com/shizand/statapp/compare/v0.9.0...v0.10.0) (2024-01-08)
### Новые функции
* добавлен график ([#94](https://github.com/shizand/statapp/issues/94)) ([bb1b2f1](https://github.com/shizand/statapp/commit/bb1b2f1ec5b988bcb8ddd7500b95fe9e35c826f5)), closes [#86](https://github.com/shizand/statapp/issues/86)
## [0.9.0](https://github.com/shizand/statapp/compare/v0.8.0...v0.9.0) (2024-01-02)

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "statapp"
version = "0.9.0"
version = "0.10.1"
description = ""
authors = [
"Maxim Slipenko <statapp@maks1ms.addy.io>"

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
@@ -33,7 +33,7 @@ from statapp.about_window import AboutWindow
from statapp.models.fileslc_model import FileSLCModel
from statapp.polynoms.squared_polynom_window import SquaredPolynomWindow
from statapp.ui.ui_main_window import Ui_MainWindow
from statapp.utils import buildMessageBox, addIcon, FloatDelegate
from statapp.utils import buildMessageBox, addIcon, FloatDelegate, onError
from statapp.variance_analysis import VarianceAnalysisWindow
from statapp.correlation_analysis import CorrelationAnalysisWindow
from statapp.polynoms.transform_polynom_window import TransformPolynomWindow
@@ -103,71 +103,86 @@ class MainWindow(QMainWindow):
@Slot()
def on_openfileaction_triggered(self):
currentData = self.model.getData()
data = np.array([])
if currentData.size > 1:
file = ''
if self.fileModel.fileName:
file = '\nФайл сохранения: ' + self.fileModel.fileName
try:
currentData = self.model.getData()
data = np.array([])
if currentData.size > 1:
file = ''
if self.fileModel.fileName:
file = '\nФайл сохранения: ' + self.fileModel.fileName
msgBox = buildMessageBox \
('Сохранение данных',
"Сохранить данные?" + file,
QMessageBox.Question,
QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel,
QMessageBox.Cancel)
msgBox = buildMessageBox \
('Сохранение данных',
"Сохранить данные?" + file,
QMessageBox.Question,
QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel,
QMessageBox.Cancel)
reply = msgBox.exec_()
if reply == QMessageBox.StandardButton.Yes:
self.fileModel.saveFile(self.model.getData())
reply = msgBox.exec_()
if reply == QMessageBox.StandardButton.Yes:
self.fileModel.saveFile(self.model.getData())
data = self.fileModel.loadFile()
if data is not None and data.shape[0] > 0:
self.model.updateAllData(data)
self.isDataChanged = False
elif reply == QMessageBox.StandardButton.Cancel:
return
data = self.fileModel.loadFile()
if data is not None and data.shape[0] > 0:
self.model.updateAllData(data)
self.isDataChanged = False
elif reply == QMessageBox.StandardButton.Cancel:
return
else:
data = self.fileModel.loadFile()
if data is not None and data.shape[0] > 0:
self.model.updateAllData(data)
self.isDataChanged = False
else:
data = self.fileModel.loadFile()
if data is not None and data.shape[0] > 0:
self.model.updateAllData(data)
self.isDataChanged = False
else:
data = self.fileModel.loadFile()
if data is not None and data.shape[0] > 0:
self.model.updateAllData(data)
self.isDataChanged = False
except Exception as error:
onError(error)
@Slot()
def on_savefileaction_triggered(self):
self.isDataChanged = not self.fileModel.saveFile(self.model.getData())
try:
self.isDataChanged = not self.fileModel.saveFile(self.model.getData())
except Exception as error:
onError(error)
@Slot()
def on_closefileaction_triggered(self):
self.fileModel.closeFile()
self.isDataChanged = False
try:
self.fileModel.closeFile()
self.isDataChanged = False
except Exception as error:
onError(error)
@Slot()
def on_generateYaction_triggered(self):
gw = GenerateWindow()
try:
gw = GenerateWindow()
if gw.exec():
y = generateYValues(gw.mat, gw.deviation, gw.count)
self.model.updateAllData(y.round(NUMBERS_PRECISION))
self.isDataChanged = True
if gw.exec():
y = generateYValues(gw.mat, gw.deviation, gw.count)
self.model.updateAllData(y.round(NUMBERS_PRECISION))
self.isDataChanged = True
except Exception as error:
onError(error)
@Slot()
def on_generateXaction_triggered(self):
gfw = GenerateFactorWindow()
try:
gfw = GenerateFactorWindow()
if gfw.exec():
data = self.model.getData()
y = self.model.getY()
xValues = generateXValues(gfw.mat, gfw.deviation, gfw.typeConnection, y)
data = np.concatenate((data, xValues.round(NUMBERS_PRECISION)), axis=1)
self.model.updateAllData(data)
self.isDataChanged = True
if gfw.exec():
data = self.model.getData()
y = self.model.getY()
xValues = generateXValues(gfw.mat, gfw.deviation, gfw.typeConnection, y)
data = np.concatenate((data, xValues.round(NUMBERS_PRECISION)), axis=1)
self.model.updateAllData(data)
self.isDataChanged = True
except Exception as error:
onError(error)
@Slot()
def on_aboutmenuaction_triggered(self):
@@ -176,28 +191,43 @@ class MainWindow(QMainWindow):
@Slot()
def on_varianceAnalysisAction_triggered(self):
dw = VarianceAnalysisWindow(self.model.getData())
dw.exec()
try:
dw = VarianceAnalysisWindow(self.model.getData())
dw.exec()
except Exception as error:
onError(error)
@Slot()
def on_correlationAnalisisAction_triggered(self):
dw = CorrelationAnalysisWindow(self.model.getData())
dw.exec()
try:
dw = CorrelationAnalysisWindow(self.model.getData())
dw.exec()
except Exception as error:
onError(error)
@Slot()
def on_linearPolynomAction_triggered(self):
dw = LinearPolynomWindow(self.model.getData())
dw.exec()
try:
dw = LinearPolynomWindow(self.model.getData())
dw.exec()
except Exception as error:
onError(error)
@Slot()
def on_squaredPolynomAction_triggered(self):
dw = SquaredPolynomWindow(self.model.getData())
dw.exec()
try:
dw = SquaredPolynomWindow(self.model.getData())
dw.exec()
except Exception as error:
onError(error)
@Slot()
def on_transformPolynomAction_triggered(self):
dw = TransformPolynomWindow(self.model.getData())
dw.exec()
try:
dw = TransformPolynomWindow(self.model.getData())
dw.exec()
except Exception as error:
onError(error)
def closeEvent(self, event):
if self.isDataChanged:

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
@@ -17,7 +17,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import numpy as np
from PySide2.QtWidgets import QDialog, QHeaderView
import matplotlib
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
from matplotlib.figure import Figure
from statapp.calculations import prediction
from statapp.mathtex_header_view import MathTexHeaderView
@@ -27,6 +31,15 @@ from statapp.ui.ui_polynom_window import Ui_PolynomWindow
from statapp.utils import addIcon, FloatDelegate
matplotlib.use('Qt5Agg')
class MplCanvas(FigureCanvasQTAgg):
def __init__(self, parent=None, width=5, height=4, dpi=100):
fig = Figure(figsize=(width, height), dpi=dpi)
self.axes = fig.add_subplot()
super().__init__(fig)
class PolynomWindow(QDialog):
def __init__(self, data, result, windowTitle):
super().__init__()
@@ -47,7 +60,30 @@ class PolynomWindow(QDialog):
self.ui.fStatisticValueLabel.setText(str(result.fStatistic))
self.ui.rSquaredValueLabel.setText(str(result.scaledResidualVariance))
self.predictionModel = PreditionTableModel(prediction(data, result))
predictionResult = prediction(data, result)
self.predictionModel = PreditionTableModel(predictionResult)
self.ui.predictionTableView.setModel(self.predictionModel)
header = self.ui.predictionTableView.horizontalHeader()
header.setSectionResizeMode(QHeaderView.ResizeMode.Stretch)
sc = MplCanvas(self, width=5, height=4, dpi=100)
xAxes = np.array(range(len(data[:, 0])))
realY = predictionResult[:, 0]
calculatedY = predictionResult[:, 1]
print(xAxes)
print(realY)
print(calculatedY)
sc.axes.scatter(xAxes, realY)
# xnew = np.linspace(xAxes.min(), xAxes.max(), 300)
# gfg = scipy.interpolate.make_interp_spline(xAxes, y, k=3)
# y_new = gfg(xnew)
sc.axes.plot(xAxes, calculatedY)
self.ui.plotContainer.addWidget(sc)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
@@ -26,8 +26,9 @@ from statapp.combo_delegate import ComboDelegate
from statapp.mathtex_header_view import MathTexHeaderView
from statapp.models.prediction_table_model import PreditionTableModel
from statapp.models.transform_polynom_model import TransformPolynomModel, TRANSFORMS
from statapp.polynoms.polynom_window import MplCanvas
from statapp.ui.ui_polynom_window import Ui_PolynomWindow
from statapp.utils import addIcon
from statapp.utils import addIcon, onError
class TransformPolynomWindow(QDialog):
@@ -40,12 +41,24 @@ class TransformPolynomWindow(QDialog):
self.data = data
result = linearPolynom(data)
try:
predictionResult = prediction(data, result)
except Exception as error:
onError(error)
self.predictionModel = PreditionTableModel(prediction(data, result))
self.predictionModel = PreditionTableModel(predictionResult)
self.ui.predictionTableView.setModel(self.predictionModel)
header = self.ui.predictionTableView.horizontalHeader()
header.setSectionResizeMode(QHeaderView.ResizeMode.Stretch)
self.sc = MplCanvas(self, width=5, height=4, dpi=100)
xAxes = np.array(range(len(data[:, 0])))
realY = predictionResult[:, 0]
calculatedY = predictionResult[:, 1]
self.sc.axes.scatter(xAxes, realY)
self.sc.axes.plot(xAxes, calculatedY)
self.ui.plotContainer.addWidget(self.sc)
# Создание столбца из нулей
zeroCol = np.zeros((result.paramsAndImportance.shape[0], 1))
# Добавление столбца к исходному массиву
@@ -80,11 +93,24 @@ class TransformPolynomWindow(QDialog):
tr = self.model.data(self.model.createIndex(j, 0), Qt.DisplayRole)
data[i][j] = TRANSFORMS[tr](data[i][j])
self.rebuildData(data)
try:
self.rebuildData(data)
except Exception as error:
onError(error)
def rebuildData(self, data):
result = linearPolynom(data)
self.predictionModel.updateAllData(prediction(data, result))
predictionResult = prediction(data, result)
self.predictionModel.updateAllData(predictionResult)
self.ui.plotContainer.removeWidget(self.sc)
self.sc = MplCanvas(self, width=5, height=4, dpi=100)
xAxes = np.array(range(len(data[:, 0])))
realY = predictionResult[:, 0]
calculatedY = predictionResult[:, 1]
self.sc.axes.scatter(xAxes, realY)
self.sc.axes.plot(xAxes, calculatedY)
self.ui.plotContainer.addWidget(self.sc)
zeroCol = np.zeros((result.paramsAndImportance.shape[0], 1))
result.paramsAndImportance = np.column_stack((zeroCol, result.paramsAndImportance))
self.model.updateAllData(result)

View File

@@ -120,6 +120,16 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>График</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<layout class="QGridLayout" name="plotContainer"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
@@ -117,6 +117,16 @@ class Ui_PolynomWindow(object):
self.gridLayout_4.addWidget(self.predictionTableView, 0, 0, 1, 1)
self.tabWidget.addTab(self.prediction, "")
self.tab = QWidget()
self.tab.setObjectName(u"tab")
self.gridLayout_5 = QGridLayout(self.tab)
self.gridLayout_5.setObjectName(u"gridLayout_5")
self.plotContainer = QGridLayout()
self.plotContainer.setObjectName(u"plotContainer")
self.gridLayout_5.addLayout(self.plotContainer, 0, 0, 1, 1)
self.tabWidget.addTab(self.tab, "")
self.gridLayout_2.addWidget(self.tabWidget, 0, 6, 1, 1)
@@ -141,4 +151,5 @@ class Ui_PolynomWindow(object):
self.rSquaredValueLabel.setText(QCoreApplication.translate("PolynomWindow", u"undefined", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.model), QCoreApplication.translate("PolynomWindow", u"\u041c\u043e\u0434\u0435\u043b\u044c", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.prediction), QCoreApplication.translate("PolynomWindow", u"\u041f\u0440\u043e\u0433\u043d\u043e\u0437", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QCoreApplication.translate("PolynomWindow", u"\u0413\u0440\u0430\u0444\u0438\u043a", None))
# retranslateUi

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).
@@ -59,8 +59,19 @@ def buildMessageBox(title, text, icon, buttons, defaultButton):
msgBox.setStandardButtons(buttons)
msgBox.setDefaultButton(defaultButton)
addIcon(msgBox)
return msgBox
def onError(errorName: Exception):
msgBox = buildMessageBox \
('Ошибка',
"Упс.. Произошла ошибка:\n" + str(errorName),
QMessageBox.Critical,
QMessageBox.Ok,
QMessageBox.Ok)
msgBox.exec_()
class FloatDelegate(QStyledItemDelegate):
def __init__(self, parent=None):

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2023 Maxim Slipenko, Eugene Lazurenko.
# Copyright (c) 2024 Maxim Slipenko, Eugene Lazurenko.
#
# This file is part of Statapp
# (see https://github.com/shizand/statapp).