diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af7c898..05aa106 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,7 @@ jobs: with: python-version: 3.11 - run: pip install -r requirements.txt pyinstaller + - run: pyuic -o optimization_methods/gui/MainWindowUi.py optimization_methods/gui/MainWindow.ui - run: pyinstaller --noconsole --onefile --icon=etc/icon.ico --add-data="optimization_methods/gui/MainWindow.ui;." --name optimization_methods optimization_methods/__main__.py - uses: actions/upload-artifact@v2 with: diff --git a/.gitignore b/.gitignore index e04276f..69262ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea venv +optimization_methods/gui/MainWindowUi.py diff --git a/optimization_methods/gui/MainWindow.py b/optimization_methods/gui/MainWindow.py index 38f5824..9a6abbb 100644 --- a/optimization_methods/gui/MainWindow.py +++ b/optimization_methods/gui/MainWindow.py @@ -1,20 +1,17 @@ import numpy as np -from pathlib import Path -from PyQt5 import uic from PyQt5.QtWidgets import QMainWindow from optimization_methods.common import Function from optimization_methods.common import GradientDescentMethod, NewtonMethod, ConjugateGradientsMethod +from .MainWindowUi import Ui_MainWindow -class MainWindow(QMainWindow): +class MainWindow(QMainWindow, Ui_MainWindow): def __init__(self): super().__init__() self._setup_ui() def _setup_ui(self): - ui_filepath = str(Path(__file__).parent.absolute().joinpath(f"{self.__class__.__name__}.ui")) - uic.loadUi(ui_filepath, self) - + self.setupUi(self) self.startButton.pressed.connect(self._start_method_execution) def _set_results(self, results: str):