diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index ea14c789..0d94f5de 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -67,6 +67,11 @@ jobs: - name: Submodule recursive run: git submodule update --init --recursive + - name: Update vcpkg + run: | + cd ${{ env.VCPKG_ROOT }} + git checkout master + # Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service. - uses: lukka/get-cmake@latest # Restore both vcpkg and its artifacts from the GitHub cache service. diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index bc2ad575..1668abb9 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -40,6 +40,11 @@ jobs: - name: Submodule recursive run: git submodule update --init --recursive + - name: Update vcpkg + run: | + cd ${{ env.VCPKG_ROOT }} + git checkout master + # Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service. - uses: lukka/get-cmake@latest # Restore both vcpkg and its artifacts from the GitHub cache service. @@ -117,11 +122,11 @@ jobs: - name: Get version id: get_version run: | - echo ::set-output name=VERSION_TAG::${GITHUB_REF#refs/tags/} + echo "VERSION_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - name: Deploy documentation if: ${{ (env.BRANCH_NAME == 'master') || (env.BRANCH_NAME == 'develop') }} - uses: JamesIves/github-pages-deploy-action@v4.3.3 + uses: JamesIves/github-pages-deploy-action@v4 with: branch: gh-pages # The branch the action should deploy to. folder: docs/build/html # The folder the action should deploy. diff --git a/.github/workflows/quick-test.yml b/.github/workflows/quick-test.yml index a3b2671d..185c8ebb 100644 --- a/.github/workflows/quick-test.yml +++ b/.github/workflows/quick-test.yml @@ -45,6 +45,11 @@ jobs: - name: Submodule recursive run: git submodule update --init --recursive + - name: Update vcpkg + run: | + cd ${{ env.VCPKG_ROOT }} + git checkout master + # Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service. - uses: lukka/get-cmake@latest # Restore both vcpkg and its artifacts from the GitHub cache service. @@ -115,7 +120,7 @@ jobs: pytest -vv --cov-report xml --cov=pyapr - name: Upload coverage report - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 - name: Build documentation run: | diff --git a/pyapr/utils/filegui.py b/pyapr/utils/filegui.py index e4e8a0a6..bd855620 100644 --- a/pyapr/utils/filegui.py +++ b/pyapr/utils/filegui.py @@ -1,10 +1,10 @@ -import pyqtgraph.Qt as Qt +from pyqtgraph.Qt import QtCore, QtWidgets import pyqtgraph as pg import matplotlib.pyplot as plt import numpy as np -class DoubleSlider(Qt.QtWidgets.QSlider): +class DoubleSlider(QtWidgets.QSlider): """ Extends QSlider to allow floating-point values @@ -13,7 +13,7 @@ class DoubleSlider(Qt.QtWidgets.QSlider): """ # create a signal that we can connect to if necessary - doubleValueChanged = Qt.QtCore.pyqtSignal(float) + doubleValueChanged = QtCore.pyqtSignal(float) def __init__(self, decimals=2, *args, **kwargs): super(DoubleSlider, self).__init__(*args, **kwargs) @@ -51,10 +51,10 @@ def __init__(self, window, label_name, decimals=0): self.decimals = decimals - self.slider = DoubleSlider(decimals, Qt.QtCore.Qt.Horizontal, window) - self.maxBox = Qt.QtWidgets.QDoubleSpinBox(window, decimals=self.decimals) + self.slider = DoubleSlider(decimals, QtCore.Qt.Horizontal, window) + self.maxBox = QtWidgets.QDoubleSpinBox(window, decimals=self.decimals) - self.label = Qt.QtWidgets.QLabel(window) + self.label = QtWidgets.QLabel(window) self.maxBox.setMaximum(64000) self.maxBox.setValue(300) @@ -95,13 +95,13 @@ def updateText(self): self.label.setText(text_str) -class MainWindowImage(Qt.QtWidgets.QWidget): +class MainWindowImage(QtWidgets.QWidget): def __init__(self, slider_decimals=0): super(MainWindowImage, self).__init__() self.setMouseTracking(True) - self.layout = Qt.QtGui.QGridLayout() + self.layout = QtWidgets.QGridLayout() self.setLayout(self.layout) self.layout.setSpacing(0) @@ -112,7 +112,7 @@ def __init__(self, slider_decimals=0): self.layout.addWidget(self.pg_win, 0, 0, 3, 1) # add a slider - self.slider = Qt.QtWidgets.QSlider(Qt.QtCore.Qt.Horizontal, self) + self.slider = QtWidgets.QSlider(QtCore.Qt.Horizontal, self) self.slider.valueChanged.connect(self.valuechange) @@ -129,14 +129,14 @@ def __init__(self, slider_decimals=0): self.hist.item.sigLevelsChanged.connect(self.histogram_updated) # add a QLabel giving information on the current slice and the APR - self.slice_info = Qt.QtGui.QLabel(self) + self.slice_info = QtWidgets.QLabel(self) self.slice_info.move(20, 20) self.slice_info.setFixedWidth(250) # add a label for the current cursor position - self.cursor = Qt.QtGui.QLabel(self) + self.cursor = QtWidgets.QLabel(self) self.cursor.move(20, 40) self.cursor.setFixedWidth(250) @@ -144,12 +144,12 @@ def __init__(self, slider_decimals=0): # add parameter tuning # create push button - self.exit_button = Qt.QtWidgets.QPushButton('Use Parameters', self) + self.exit_button = QtWidgets.QPushButton('Use Parameters', self) self.exit_button.setFixedWidth(300) self.exit_button.move(300, 10) self.exit_button.clicked.connect(self.exitPressed) - self.max_label = Qt.QtWidgets.QLabel(self) + self.max_label = QtWidgets.QLabel(self) self.max_label.setText("Slider Max") self.max_label.move(610, 50) @@ -278,11 +278,11 @@ def update_slice(self, new_view): self.updateSliceText(new_view) def keyPressEvent(self, event): - if event.key() == Qt.QtCore.Qt.Key_Left: + if event.key() == QtCore.Qt.Key_Left: # back a frame self.update_slice(self.current_view - 1) - if event.key() == Qt.QtCore.Qt.Key_Right: + if event.key() == QtCore.Qt.Key_Right: # forward a frame self.update_slice(self.current_view + 1) @@ -345,13 +345,13 @@ def set_image(self, img, converter): self.hist.setImageItem(self.img_I) - self.img_I_ds.setRect(Qt.QtCore.QRectF(self.min_x, self.min_y, self.x_num_ds*2, self.y_num_ds*2)) - self.img_I.setRect(Qt.QtCore.QRectF(self.min_x, self.min_y, self.x_num, self.y_num)) + self.img_I_ds.setRect(QtCore.QRectF(self.min_x, self.min_y, self.x_num_ds*2, self.y_num_ds*2)) + self.img_I.setRect(QtCore.QRectF(self.min_x, self.min_y, self.x_num, self.y_num)) ## Set up the z slider self.slider.setMinimum(0) self.slider.setMaximum(self.z_num - 1) - self.slider.setTickPosition(Qt.QtWidgets.QSlider.TicksBothSides) + self.slider.setTickPosition(QtWidgets.QSlider.TicksBothSides) self.slider.setGeometry(0.05 * self.full_size, 0.97 * self.full_size, 0.95 * self.full_size, 40) self.setLUT('viridis') @@ -367,30 +367,30 @@ def closeEvent(self, event): class InteractiveIO: def __init__(self): # class methods require a QApplication instance - this helps to avoid multiple instances... - self.app = Qt.QtGui.QApplication.instance() + self.app = QtWidgets.QApplication.instance() if self.app is None: - self.app = Qt.QtGui.QApplication([]) + self.app = QtWidgets.QApplication([]) @staticmethod def get_tiff_file_name(): print("Please select an input image file (TIFF)") - file_name = Qt.QtGui.QFileDialog.getOpenFileName(None, "Open Tiff", "~", "(*.tif *.tiff)") + file_name = QtWidgets.QFileDialog.getOpenFileName(None, "Open Tiff", "~", "(*.tif *.tiff)") return file_name[0] @staticmethod def get_apr_file_name(): print("Please select an input APR file (HDF5)") - file_name = Qt.QtGui.QFileDialog.getOpenFileName(None, "Open APR", "", "(*.apr *.h5)") + file_name = QtWidgets.QFileDialog.getOpenFileName(None, "Open APR", "", "(*.apr *.h5)") return file_name[0] @staticmethod def save_apr_file_name(default_name='output.apr'): - file_name = Qt.QtGui.QFileDialog.getSaveFileName(None, "Save APR", default_name, "(*.apr *.h5)") + file_name = QtWidgets.QFileDialog.getSaveFileName(None, "Save APR", default_name, "(*.apr *.h5)") return file_name[0] @staticmethod def save_tiff_file_name(default_name='output.tif'): - file_name = Qt.QtGui.QFileDialog.getSaveFileName(None, "Save TIFF", default_name, "(*.tif *.tiff)") + file_name = QtWidgets.QFileDialog.getSaveFileName(None, "Save TIFF", default_name, "(*.tif *.tiff)") return file_name[0] def interactive_apr(self, converter, apr, img, slider_decimals=2): diff --git a/pyapr/viewer/compressInteractive.py b/pyapr/viewer/compressInteractive.py index f254bc90..ab15e103 100644 --- a/pyapr/viewer/compressInteractive.py +++ b/pyapr/viewer/compressInteractive.py @@ -1,4 +1,4 @@ -from pyqtgraph.Qt import QtCore, QtGui, QtWidgets +from pyqtgraph.Qt import QtCore, QtWidgets import pyqtgraph as pg from _pyaprwrapper.data_containers import APR, ShortParticles from _pyaprwrapper.viewer import compress_and_fill_slice @@ -156,9 +156,9 @@ def interactive_compression(apr: APR, pg.setConfigOption('foreground', 'k') pg.setConfigOption('imageAxisOrder', 'row-major') - app = QtGui.QApplication.instance() + app = QtWidgets.QApplication.instance() if app is None: - app = QtGui.QApplication([]) + app = QtWidgets.QApplication([]) ## Create window with GraphicsView widget win = CompressWindow() diff --git a/pyapr/viewer/partsViewer.py b/pyapr/viewer/partsViewer.py index d712e500..c528e00c 100644 --- a/pyapr/viewer/partsViewer.py +++ b/pyapr/viewer/partsViewer.py @@ -1,4 +1,4 @@ -from pyqtgraph.Qt import QtCore, QtGui, QtWidgets +from pyqtgraph.Qt import QtCore, QtWidgets from _pyaprwrapper.data_containers import APR, ByteParticles, ShortParticles, FloatParticles, LongParticles from _pyaprwrapper.viewer import fill_slice, fill_slice_level, min_occupied_level from ..utils import particles_to_type @@ -364,9 +364,9 @@ def parts_viewer(apr: APR, Input particle intensity values. """ _check_input(apr, parts) - app = QtGui.QApplication.instance() + app = QtWidgets.QApplication.instance() if app is None: - app = QtGui.QApplication([]) + app = QtWidgets.QApplication([]) pg.setConfigOption('background', 'w') pg.setConfigOption('foreground', 'k') diff --git a/pyapr/viewer/raycastViewer.py b/pyapr/viewer/raycastViewer.py index cfc8b0e1..c9685a8c 100644 --- a/pyapr/viewer/raycastViewer.py +++ b/pyapr/viewer/raycastViewer.py @@ -1,4 +1,4 @@ -from pyqtgraph.Qt import QtCore, QtGui, QtWidgets +from pyqtgraph.Qt import QtCore, QtWidgets import pyqtgraph as pg from _pyaprwrapper.data_containers import APR, ByteParticles, ShortParticles, FloatParticles, LongParticles from _pyaprwrapper.viewer import APRRaycaster @@ -314,9 +314,9 @@ def raycast_viewer(apr: APR, pg.setConfigOption('foreground', 'k') pg.setConfigOption('imageAxisOrder', 'row-major') - app = QtGui.QApplication.instance() + app = QtWidgets.QApplication.instance() if app is None: - app = QtGui.QApplication([]) + app = QtWidgets.QApplication([]) # Create window with GraphicsView widget win = MainWindowImage()