From b5a3b5b4ecb0c904fdfb79ddce911bf1c1ba8b96 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 08:30:28 +0100 Subject: [PATCH] [pre-commit] pre-commit autoupdate (#573) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- src/mrpro/data/AcqInfo.py | 2 +- src/mrpro/data/MoveDataMixin.py | 2 +- src/mrpro/utils/slice_profiles.py | 2 +- src/mrpro/utils/typing.py | 2 +- src/mrpro/utils/unit_conversion.py | 12 ++++++------ 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2229c194f..3920fb5ae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,14 +14,14 @@ repos: - id: mixed-line-ending - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.2 + rev: v0.8.1 hooks: - id: ruff # linter args: [--fix] - id: ruff-format # formatter - repo: https://github.com/crate-ci/typos - rev: v1.27.0 + rev: typos-dict-v0.11.37 hooks: - id: typos diff --git a/src/mrpro/data/AcqInfo.py b/src/mrpro/data/AcqInfo.py index f5d677f97..b11e07d86 100644 --- a/src/mrpro/data/AcqInfo.py +++ b/src/mrpro/data/AcqInfo.py @@ -188,7 +188,7 @@ def tensor(data: np.ndarray) -> torch.Tensor: data = data.astype(np.int32) case np.uint32 | np.uint64: data = data.astype(np.int64) - # Remove any uncessary dimensions + # Remove any unnecessary dimensions return torch.tensor(np.squeeze(data)) def tensor_2d(data: np.ndarray) -> torch.Tensor: diff --git a/src/mrpro/data/MoveDataMixin.py b/src/mrpro/data/MoveDataMixin.py index 2ac3c1a58..99bcb3df5 100644 --- a/src/mrpro/data/MoveDataMixin.py +++ b/src/mrpro/data/MoveDataMixin.py @@ -121,7 +121,7 @@ def parse1( ) -> parsedType: return device, dtype, non_blocking, copy, memory_format - if args and isinstance(args[0], torch.Tensor) or 'tensor' in kwargs: + if (args and isinstance(args[0], torch.Tensor)) or 'tensor' in kwargs: # overload 3 ("tensor" specifies the dtype and device) device, dtype, non_blocking, copy, memory_format = parse3(*args, **kwargs) elif args and isinstance(args[0], torch.dtype): diff --git a/src/mrpro/utils/slice_profiles.py b/src/mrpro/utils/slice_profiles.py index 0e5fafc1f..8eaf95311 100644 --- a/src/mrpro/utils/slice_profiles.py +++ b/src/mrpro/utils/slice_profiles.py @@ -8,7 +8,7 @@ import torch from torch import Tensor -__all__ = ['SliceProfileBase', 'SliceGaussian', 'SliceSmoothedRectangular', 'SliceInterpolate'] +__all__ = ['SliceGaussian', 'SliceInterpolate', 'SliceProfileBase', 'SliceSmoothedRectangular'] class SliceProfileBase(abc.ABC, torch.nn.Module): diff --git a/src/mrpro/utils/typing.py b/src/mrpro/utils/typing.py index f90e18dab..96ad34d07 100644 --- a/src/mrpro/utils/typing.py +++ b/src/mrpro/utils/typing.py @@ -28,4 +28,4 @@ NestedSequence: TypeAlias = Any NumpyIndexerType: TypeAlias = Any -__all__ = ['TorchIndexerType', 'NumpyIndexerType', 'NestedSequence'] +__all__ = ['NestedSequence', 'NumpyIndexerType', 'TorchIndexerType'] diff --git a/src/mrpro/utils/unit_conversion.py b/src/mrpro/utils/unit_conversion.py index 0115bed47..5a1b5aaae 100644 --- a/src/mrpro/utils/unit_conversion.py +++ b/src/mrpro/utils/unit_conversion.py @@ -6,15 +6,15 @@ import torch __all__ = [ - 'ms_to_s', - 's_to_ms', - 'mm_to_m', - 'm_to_mm', + 'GYROMAGNETIC_RATIO_PROTON', 'deg_to_rad', - 'rad_to_deg', 'lamor_frequency_to_magnetic_field', + 'm_to_mm', 'magnetic_field_to_lamor_frequency', - 'GYROMAGNETIC_RATIO_PROTON', + 'mm_to_m', + 'ms_to_s', + 'rad_to_deg', + 's_to_ms', ] GYROMAGNETIC_RATIO_PROTON = 42.58 * 1e6