Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
marsipu authored Sep 19, 2023
2 parents 6cb6a23 + 9b8dd27 commit dccb34b
Show file tree
Hide file tree
Showing 27 changed files with 242 additions and 219 deletions.
38 changes: 0 additions & 38 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Bug Report
description: File a bug report
title: "BUG: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: "## Thank you for taking the time to fill out this bug report!"
- type: textarea
attributes:
label: What happened?
description: Describe the bug
placeholder: terrible things happening
- type: textarea
attributes:
label: Steps to reproduce
description: What steps made the bug appear? Please describe the steps as detailed as possible
placeholder: things I did/buttons I clicked
- type: textarea
attributes:
label: Error Traceback
description: Please copy the full error traceback into here (either from the dialog that popped up or the terminal)
placeholder: error-traceback
render: python
- type: markdown
attributes:
value: 'Please run `python -c "import mne; mne.sys_info()"` and paste the result into the field below.'
- type: textarea
attributes:
label: System-Info
description: Please paste the results from the aforementioned command in here.
placeholder: sys-info
render: shell
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Feature Request
description: Suggest a new feature
title: "ENH: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: "## Thank you for contributing to this project!"
- type: textarea
attributes:
label: Suggestion?
description: What would you like to suggest?
placeholder: <cool new feature>
15 changes: 14 additions & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,24 @@ jobs:
matrix:
os: [ ubuntu, windows, macos ]
python: [ '3.11' ]
qt : [ 'PySide6' ]
include:
- os: ubuntu
python: '3.9'
qt : 'PySide6'
- os: ubuntu
python: '3.10'
name: Run pytest on ${{ matrix.os }} / ${{matrix.python}}
qt : 'PySide6'
- os: ubuntu
python : '3.10'
qt : 'PySide2'
- os: ubuntu
python : '3.11'
qt : 'PyQt6'
- os: ubuntu
python: '3.11'
qt: 'PyQt5'
name: Run pytest on ${{ matrix.os }} - ${{matrix.python}} with ${{ matrix.qt }}
runs-on: ${{ matrix.os }}-latest
env:
DISPLAY: ':99.0'
Expand All @@ -38,6 +50,7 @@ jobs:
- name: Installation with dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ${{ matrix.qt }}
python -m pip install -ve .[tests]
- name: Get testing version
run: |
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ installed.
4. Add upstream to git for
updates: `git remote add upstream git://github.com/marsipu/mne-pipeline-hd.git`
5. Install development version with pip: `pip install -e .[tests]`
6. Create a branch for changes: `git checkout -b <branch-name>`
7. Commit changes: `git commit -am "<your commit message>"`
8. Push changes to your forked repository on GitHub: `git push`
9. Make "New pull request" from your new feature branch
6. Install the pre-commit hooks with: `pre-commit install`
7. Create a branch for changes: `git checkout -b <branch-name>`
8. Commit changes: `git commit -am "<your commit message>"`
9. Push changes to your forked repository on GitHub: `git push`
10. Make "New pull request" from your new feature branch

You can always [write me](mailto:[email protected]), if you have questions
about the contribution-process
Expand Down
24 changes: 11 additions & 13 deletions mne_pipeline_hd/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
import sys
from importlib import resources

from PyQt5.QtCore import QTimer, Qt
from PyQt5.QtGui import QIcon, QFont
from PyQt5.QtWidgets import QApplication
import qtpy
from qtpy.QtCore import QTimer, Qt
from qtpy.QtGui import QIcon, QFont
from qtpy.QtWidgets import QApplication

import mne_pipeline_hd
from mne_pipeline_hd.gui.gui_utils import StdoutStderrStream, UncaughtHook
Expand Down Expand Up @@ -40,12 +41,6 @@ def main():
app.setOrganizationName(organization_name)
app.setOrganizationDomain(domain_name)

# Disable Help-Button
try:
app.setAttribute(Qt.AA_DisableWindowContextHelpButton, True)
except AttributeError:
print("pyqt-Version is < 5.12")

# Avoid file-dialog-problems with custom file-managers in linux
if islin:
app.setAttribute(Qt.AA_DontUseNativeDialogs, True)
Expand All @@ -55,10 +50,6 @@ def main():
# Workaround for not showing with PyQt < 5.15.2
os.environ["QT_MAC_WANTS_LAYER"] = "1"

# Avoid Mayavi-Issues
os.environ["ETS_TOOLKIT"] = "qt4"
os.environ["QT_API"] = "pyqt5"

# ToDo: MP
# # Set multiprocessing method to spawn
# multiprocessing.set_start_method('spawn')
Expand All @@ -79,6 +70,13 @@ def main():
logger.addHandler(console_handler)
logger.info("Starting MNE-Pipeline HD")

# Show Qt-binding
if any([qtpy.PYQT5, qtpy.PYQT6]):
qt_version = qtpy.PYQT_VERSION
else:
qt_version = qtpy.PYSIDE_VERSION
logger.info(f"Using {qtpy.API_NAME} {qt_version}")

# Initialize Exception-Hook
if os.environ.get("MNEPHD_DEBUG", False) == "true":
print("Debug-Mode is activated")
Expand Down
2 changes: 1 addition & 1 deletion mne_pipeline_hd/development/dev_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import traceback
from ast import literal_eval

from PyQt5.QtWidgets import (
from qtpy.QtWidgets import (
QWidget,
QVBoxLayout,
QGridLayout,
Expand Down
14 changes: 7 additions & 7 deletions mne_pipeline_hd/gui/base_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

import numpy as np
import pandas
from PyQt5.QtCore import QItemSelectionModel, QTimer, Qt, pyqtSignal
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import (
from qtpy.QtCore import QItemSelectionModel, QTimer, Qt, Signal
from qtpy.QtGui import QFont
from qtpy.QtWidgets import (
QAbstractItemView,
QApplication,
QDialog,
Expand Down Expand Up @@ -52,9 +52,9 @@


class Base(QWidget):
currentChanged = pyqtSignal(object, object)
selectionChanged = pyqtSignal(object)
dataChanged = pyqtSignal(object, object)
currentChanged = Signal(object, object)
selectionChanged = Signal(object)
dataChanged = Signal(object, object)

def __init__(self, model, view, drag_drop, parent, title, verbose=False):
if parent:
Expand Down Expand Up @@ -372,7 +372,7 @@ class CheckList(BaseList):
If you change the reference to data, call replace_data or replace_checked.
"""

checkedChanged = pyqtSignal(list)
checkedChanged = Signal(list)

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion mne_pipeline_hd/gui/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from importlib import resources
from pathlib import Path

from PyQt5.QtWidgets import (
from qtpy.QtWidgets import (
QDialog,
QGridLayout,
QLabel,
Expand Down
10 changes: 5 additions & 5 deletions mne_pipeline_hd/gui/education_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from os.path import isdir, join
from shutil import copytree

from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import (
from qtpy import compat
from qtpy.QtCore import Qt
from qtpy.QtGui import QFont
from qtpy.QtWidgets import (
QComboBox,
QFileDialog,
QGridLayout,
QHBoxLayout,
QLabel,
Expand Down Expand Up @@ -238,7 +238,7 @@ def page_text_changed(self):
self.edu["tour"][current_page] = text

def load_edu_file(self):
file_path = QFileDialog().getOpenFileName(self, directory=self.edu_folder)[0]
file_path = compat.getopenfilename(self, directory=self.edu_folder)[0]
if file_path != "":
with open(file_path, "r") as file:
self.edu = json.load(file)
Expand Down
12 changes: 6 additions & 6 deletions mne_pipeline_hd/gui/function_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
from types import FunctionType

import pandas as pd
from PyQt5.QtCore import QSize, Qt
from PyQt5.QtGui import QFont, QTextDocument
from PyQt5.QtWidgets import (
from qtpy import compat
from qtpy.QtCore import QSize, Qt
from qtpy.QtGui import QFont, QTextDocument
from qtpy.QtWidgets import (
QButtonGroup,
QComboBox,
QDialog,
QFileDialog,
QFormLayout,
QGroupBox,
QHBoxLayout,
Expand Down Expand Up @@ -1038,7 +1038,7 @@ def get_functions(self):
self.clear_param_items()

# Returns tuple of files-list and file-type
cf_path_string = QFileDialog.getOpenFileName(
cf_path_string = compat.getopenfilename(
self,
"Choose the Python-File containing your function to import",
filter="Python-File (*.py)",
Expand All @@ -1055,7 +1055,7 @@ def edit_functions(self):
self.clear_param_items()

# Returns tuple of files-list and file-type
cf_path_string = QFileDialog.getOpenFileName(
cf_path_string = compat.getopenfilename(
self,
"Choose the Python-File containing the functions to edit",
filter="Python-File (*.py)",
Expand Down
Loading

0 comments on commit dccb34b

Please sign in to comment.