From 7d39e7d4c607e543f57d350a0a36a27a1196e146 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 23:40:43 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v5.0.0) - [github.com/psf/black: 22.12.0 → 24.10.0](https://github.com/psf/black/compare/22.12.0...24.10.0) - [github.com/PyCQA/flake8: 6.0.0 → 7.1.1](https://github.com/PyCQA/flake8/compare/6.0.0...7.1.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a067cc5d..b55e602f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: trailing-whitespace args: [--markdown-linebreak-ext=md] @@ -17,13 +17,13 @@ repos: - id: check-yaml - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 24.10.0 hooks: - id: black exclude: test/data - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 7.1.1 hooks: - id: flake8 exclude: dev-docs|docs|versioneer.py|RefRed/_version.py|create_graph.py|test/data From 8028c8ef0447ee56237559ff28f56cc0d13c1469 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 23:40:58 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- RefRed/calculations/check_list_run_compatibility_thread.py | 1 + RefRed/configuration/global_settings.py | 1 + RefRed/decorators.py | 1 + RefRed/gui_handling/data_norm_spinboxes.py | 2 ++ RefRed/gui_handling/observer.py | 2 ++ RefRed/reduction/individual_reduction_settings_handler.py | 1 + RefRed/sf_calculator/lr_data.py | 1 + RefRed/sf_calculator/sf_calculator.py | 1 + RefRed/status_message_handler.py | 1 + RefRed/tabledata.py | 1 + 10 files changed, 12 insertions(+) diff --git a/RefRed/calculations/check_list_run_compatibility_thread.py b/RefRed/calculations/check_list_run_compatibility_thread.py index da57e4b4..e33891f4 100644 --- a/RefRed/calculations/check_list_run_compatibility_thread.py +++ b/RefRed/calculations/check_list_run_compatibility_thread.py @@ -7,6 +7,7 @@ 1: Direct beam data 2: Reduction options """ + # import logging import RefRed.colors from qtpy import QtCore, QtGui diff --git a/RefRed/configuration/global_settings.py b/RefRed/configuration/global_settings.py index 4ef40ace..54737d3f 100644 --- a/RefRed/configuration/global_settings.py +++ b/RefRed/configuration/global_settings.py @@ -7,4 +7,5 @@ class GlobalSettings(BaseModel): See `DeadTimeSettingsModel` for an example """ + pass diff --git a/RefRed/decorators.py b/RefRed/decorators.py index 3d23ee9e..eb72529c 100644 --- a/RefRed/decorators.py +++ b/RefRed/decorators.py @@ -1,6 +1,7 @@ ''' Module for useful decorators ''' + from qtpy import QtGui, QtCore, QtWidgets from RefRed import WINDOW_TITLE from functools import wraps diff --git a/RefRed/gui_handling/data_norm_spinboxes.py b/RefRed/gui_handling/data_norm_spinboxes.py index 5e4e4fb0..2e7ff891 100644 --- a/RefRed/gui_handling/data_norm_spinboxes.py +++ b/RefRed/gui_handling/data_norm_spinboxes.py @@ -121,6 +121,7 @@ class DataBackSpinbox(object): entry_type One of "back" or "back2", denoting the first or the second background ROI's """ + parent = None def __init__(self, parent: QWidget, entry_type: str = 'back'): @@ -155,6 +156,7 @@ class NormBackSpinbox(object): entry_type One of "back" or "back2", denoting the first or the second background ROI's """ + parent = None def __init__(self, parent: QWidget, entry_type: str = "back"): diff --git a/RefRed/gui_handling/observer.py b/RefRed/gui_handling/observer.py index b1b1f2a0..e9106b81 100644 --- a/RefRed/gui_handling/observer.py +++ b/RefRed/gui_handling/observer.py @@ -17,12 +17,14 @@ class SpinBoxObserver: QUANTUM : int The minimum allowed change in value for any of the registered QSpinBox objects """ + NAN: int = -1 QUANTUM: int = 1 @dataclass class RegistryEntry: r"""Helper class to encapsulate entries in the registry of SpinBoxObserver._registry""" + spin_box: QSpinBox last_value: int diff --git a/RefRed/reduction/individual_reduction_settings_handler.py b/RefRed/reduction/individual_reduction_settings_handler.py index 8e8ea7e3..414553b0 100644 --- a/RefRed/reduction/individual_reduction_settings_handler.py +++ b/RefRed/reduction/individual_reduction_settings_handler.py @@ -6,6 +6,7 @@ is saved if it's not used here. It creates confusion as to where we should keep this information. """ + # standard imports from typing import Any, List, Optional diff --git a/RefRed/sf_calculator/lr_data.py b/RefRed/sf_calculator/lr_data.py index b69814d1..b80cf08d 100644 --- a/RefRed/sf_calculator/lr_data.py +++ b/RefRed/sf_calculator/lr_data.py @@ -2,6 +2,7 @@ Notes from review: This class does a subset of what is done in calculations.lr_data. This code is probably not needed. """ + from mantid.simpleapi import Rebin import numpy as np import logging diff --git a/RefRed/sf_calculator/sf_calculator.py b/RefRed/sf_calculator/sf_calculator.py index e9e42651..0712b231 100644 --- a/RefRed/sf_calculator/sf_calculator.py +++ b/RefRed/sf_calculator/sf_calculator.py @@ -2,6 +2,7 @@ Scaling factor calculator TODO: This need major cleanup """ + import sys import os from pathlib import Path diff --git a/RefRed/status_message_handler.py b/RefRed/status_message_handler.py index c2618550..9df758fc 100644 --- a/RefRed/status_message_handler.py +++ b/RefRed/status_message_handler.py @@ -1,6 +1,7 @@ """ TODO: refactor this """ + import sys import time from qtpy import QtCore diff --git a/RefRed/tabledata.py b/RefRed/tabledata.py index 597cb483..2e6a7d12 100644 --- a/RefRed/tabledata.py +++ b/RefRed/tabledata.py @@ -12,6 +12,7 @@ class TableDataColumIndex(Enum): r"""Enumeration to associate each column index of a TableData instance with a word""" + LR_DATA = 0 LR_NORM = 1 LR_CONFIG = 2