Skip to content

Commit

Permalink
Merge 9f80d47 into ef070b6
Browse files Browse the repository at this point in the history
  • Loading branch information
samtygier-stfc committed Mar 21, 2024
2 parents ef070b6 + 9f80d47 commit 1b77ce3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions mantidimaging/core/operations/rebin/rebin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

from functools import partial
from typing import TYPE_CHECKING, List
from typing import TYPE_CHECKING

import numpy as np
from skimage.transform import resize
Expand Down Expand Up @@ -45,7 +45,7 @@ def filter_func(images: ImageStack, rebin_param=0.5, mode=None, progress=None) -
"""
if isinstance(rebin_param, tuple):
new_shape = rebin_param
elif isinstance(rebin_param, (int, float)):
elif isinstance(rebin_param, (int | float)):
current_shape = images.data.shape[1:]
new_shape = (int(current_shape[0] * rebin_param), int(current_shape[1] * rebin_param))
else:
Expand All @@ -60,7 +60,7 @@ def filter_func(images: ImageStack, rebin_param=0.5, mode=None, progress=None) -
return images

@staticmethod
def compute_function(i: int, arrays: List[np.ndarray], params: dict):
def compute_function(i: int, arrays: list[np.ndarray], params: dict):
array = arrays[0]
output = arrays[1]
new_shape = params['new_shape']
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ line-length = 120
target-version = "py310"

[tool.ruff.lint]
select = ["E", "W", "F", "B", "FA", "C4", "NPY"]
fixable = []
select = ["F", "E", "W", "UP", "B", "C4", "FA", "NPY"]
fixable = ["UP"]
ignore = ["UP014"]

0 comments on commit 1b77ce3

Please sign in to comment.