From e34c70f54097b867657b9695ec1e562cf697f3b0 Mon Sep 17 00:00:00 2001 From: phil65 Date: Fri, 15 Dec 2023 22:46:32 +0100 Subject: [PATCH] chore: ruff cleanup --- prettyqt/charts/boxset.py | 4 ++-- prettyqt/itemmodels/proxies/rangefilterproxymodel.py | 4 ++-- prettyqt/widgets/abstractspinbox.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/prettyqt/charts/boxset.py b/prettyqt/charts/boxset.py index 69c555823..452f3a0a6 100644 --- a/prettyqt/charts/boxset.py +++ b/prettyqt/charts/boxset.py @@ -36,7 +36,7 @@ def __getitem__( self, index: int | ValuePositionStr | QtCharts.QBoxSet.ValuePositions ) -> float: """Returns the value of the box-and-whiskers item specified by index.""" - if type(index) is not int: + if type(index) is not int: # noqa: E721 index = VALUE_POSITION.get_enum_value(index).value if not (0 <= index <= 4): raise KeyError(index) @@ -46,7 +46,7 @@ def __setitem__( self, index: int | ValuePositionStr | QtCharts.QBoxSet.ValuePositions, value: int ): """Sets the value specified by value in the position specified by index.""" - if type(index) is not int: + if type(index) is not int: # noqa: E721 index = VALUE_POSITION.get_enum_value(index).value if not (0 <= index <= 4): raise KeyError(index) diff --git a/prettyqt/itemmodels/proxies/rangefilterproxymodel.py b/prettyqt/itemmodels/proxies/rangefilterproxymodel.py index d0e627ab3..0ff17f1a2 100644 --- a/prettyqt/itemmodels/proxies/rangefilterproxymodel.py +++ b/prettyqt/itemmodels/proxies/rangefilterproxymodel.py @@ -25,7 +25,7 @@ def filterAcceptsRow(self, source_row: int, parent: core.ModelIndex) -> bool: return False return self._max_value is None or value <= self._max_value - def set_min_value(self, value: float | int | None): + def set_min_value(self, value: float | None): self._min_value = value self.invalidateRowsFilter() @@ -34,7 +34,7 @@ def get_min_value(self) -> float | int: return -float("inf") return self._min_value - def set_max_value(self, value: float | int): + def set_max_value(self, value: float): self._max_value = value self.invalidateRowsFilter() diff --git a/prettyqt/widgets/abstractspinbox.py b/prettyqt/widgets/abstractspinbox.py index bb6714a2f..ecd43b61e 100644 --- a/prettyqt/widgets/abstractspinbox.py +++ b/prettyqt/widgets/abstractspinbox.py @@ -118,7 +118,7 @@ def set_special_value(self, value: str): def get_value(self) -> int: return self.value() - def set_value(self, value: int | float): + def set_value(self, value: float): self.setValue(value)