Skip to content

Commit

Permalink
chore: ruff cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Dec 15, 2023
1 parent e1b51c5 commit e34c70f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions prettyqt/charts/boxset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions prettyqt/itemmodels/proxies/rangefilterproxymodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion prettyqt/widgets/abstractspinbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit e34c70f

Please sign in to comment.