From 2766aa3af58ed3c5eb58ffcc53adb4e8b86bf53b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:14:13 +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/astral-sh/ruff-pre-commit: v0.8.4 → v0.9.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.4...v0.9.1) - [github.com/pre-commit/mirrors-mypy: v1.14.0 → v1.14.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.14.0...v1.14.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 81cf594..a26afc2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: 'v0.8.4' + rev: 'v0.9.1' hooks: # Run the linter. - id: ruff @@ -27,7 +27,7 @@ repos: - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.14.0 + rev: v1.14.1 hooks: - id: mypy From 7e398aafee787ca80ad04f274c487bd69d5bd5dc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:14:31 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/mps_motion/cli.py | 2 +- src/mps_motion/motion_tracking.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mps_motion/cli.py b/src/mps_motion/cli.py index 93b60d4..1e1cd29 100644 --- a/src/mps_motion/cli.py +++ b/src/mps_motion/cli.py @@ -347,7 +347,7 @@ def find_time_index(t_star, default): ) reference_frame = data.time_stamps[reference_frame_index] logger.info( - f"Found reference frame at index {reference_frame_index} " f"and time {reference_frame:.2f}", + f"Found reference frame at index {reference_frame_index} and time {reference_frame:.2f}", ) u = opt_flow.get_displacements(reference_frame=reference_frame) diff --git a/src/mps_motion/motion_tracking.py b/src/mps_motion/motion_tracking.py index b3a2625..9241f47 100644 --- a/src/mps_motion/motion_tracking.py +++ b/src/mps_motion/motion_tracking.py @@ -62,8 +62,7 @@ def estimate_referece_image_from_velocity( inds = np.isclose(v, background, atol=np.abs(v.max() - v.min()) * rel_tol) msg = ( - "Unable to find any values at the baseline. " - "Please try a smaller tolerance when estimating the reference image" + "Unable to find any values at the baseline. Please try a smaller tolerance when estimating the reference image" ) if not inds.any(): # No values are this close to the baseline @@ -132,7 +131,7 @@ def get_reference_image( except ValueError: refs = RefFrames._member_names_ - msg = "Expected reference frame to be an integer or one of " f"{refs}, got {reference_frame}" + msg = f"Expected reference frame to be an integer or one of {refs}, got {reference_frame}" if str(reference_frame) not in refs: raise ValueError(msg) reference_image = getattr(np, str(reference_frame))(frames, axis=2) @@ -335,4 +334,4 @@ def get_velocities( return self._velocity def __repr__(self): - return f"{self.__class__.__name__}(" f"data={self.data}, flow_algorithm={self.flow_algorithm})" + return f"{self.__class__.__name__}(data={self.data}, flow_algorithm={self.flow_algorithm})"