From 7839e180135a711f660c4a7d95ad4247eb52b08d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 19:20:53 +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/pre-commit/pre-commit-hooks: v4.5.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v6.0.0) - https://github.com/charliermarsh/ruff-pre-commit → https://github.com/astral-sh/ruff-pre-commit - [github.com/astral-sh/ruff-pre-commit: v0.3.0 → v0.14.14](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.0...v0.14.14) - https://github.com/psf/black → https://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 24.2.0 → 26.1.0](https://github.com/psf/black-pre-commit-mirror/compare/24.2.0...26.1.0) - [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.19.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.19.1) - [github.com/mgedmin/check-manifest: 0.49 → 0.51](https://github.com/mgedmin/check-manifest/compare/0.49...0.51) - [github.com/codespell-project/codespell: v2.2.6 → v2.4.1](https://github.com/codespell-project/codespell/compare/v2.2.6...v2.4.1) --- .pre-commit-config.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eb400523f..2493e97e5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v6.0.0 hooks: - id: check-docstring-first - id: check-executables-have-shebangs @@ -17,23 +17,23 @@ repos: args: [--fix=lf] - id: requirements-txt-fixer - id: trailing-whitespace - - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.3.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.14.14 hooks: - id: ruff - - repo: https://github.com/psf/black - rev: 24.2.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.1.0 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.19.1 hooks: - id: mypy exclude: "village/pybpodapi/.*" additional_dependencies: - types-setuptools - repo: https://github.com/mgedmin/check-manifest - rev: "0.49" + rev: "0.51" hooks: - id: check-manifest args: [--no-build-isolation] @@ -42,7 +42,7 @@ repos: - wheel - repo: https://github.com/codespell-project/codespell # Configuration for codespell is in pyproject.toml - rev: v2.2.6 + rev: v2.4.1 hooks: - id: codespell additional_dependencies: From c3aee5e4da66124fce211f4c2f760be9c5dde20e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 19:21:16 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../custom_classes/training_protocol_base.py | 6 ++--- village/pybpodapi/bpod/bpod_base.py | 24 +++++++------------ .../state_machine/state_machine_builder.py | 10 ++++---- village/scripts/parse_bpod_messages.py | 2 +- 4 files changed, 16 insertions(+), 26 deletions(-) diff --git a/village/custom_classes/training_protocol_base.py b/village/custom_classes/training_protocol_base.py index 5dcdd9c98..867612f20 100644 --- a/village/custom_classes/training_protocol_base.py +++ b/village/custom_classes/training_protocol_base.py @@ -52,11 +52,9 @@ def check_variables(self) -> None: if self.settings.next_task == "-1": raise TrainingError("The variable next_task is required (must be a string)") if self.settings.refractory_period < 0: - raise TrainingError( - """ + raise TrainingError(""" The variable refractory_period is required (must be a positive integer) - """ - ) + """) if self.settings.minimum_duration < 0: raise TrainingError( "The variable minimum_duration is required (must be a positive float)" diff --git a/village/pybpodapi/bpod/bpod_base.py b/village/pybpodapi/bpod/bpod_base.py index f0feccf73..4f3b849ba 100644 --- a/village/pybpodapi/bpod/bpod_base.py +++ b/village/pybpodapi/bpod/bpod_base.py @@ -131,32 +131,24 @@ def open(self): try: val = self._bpodcom_handshake() except Exception: - raise BpodErrorException( - """Error: Bpod failed to confirm connectivity. - Please reset Bpod and try again.""" - ) + raise BpodErrorException("""Error: Bpod failed to confirm connectivity. + Please reset Bpod and try again.""") if not val: - raise BpodErrorException( - """Error: Bpod failed to confirm connectivity. - Please reset Bpod and try again.""" - ) + raise BpodErrorException("""Error: Bpod failed to confirm connectivity. + Please reset Bpod and try again.""") # check the firmware version firmware_version, machine_type = self._bpodcom_firmware_version() if firmware_version < settings.get("BPOD_TARGET_FIRMWARE"): - raise BpodErrorException( - """Error: Old firmware detected. - Please update Bpod firmware to version 22 and try again.""" - ) + raise BpodErrorException("""Error: Old firmware detected. + Please update Bpod firmware to version 22 and try again.""") if firmware_version > settings.get("BPOD_TARGET_FIRMWARE"): print("Firmware version is new: ", firmware_version) - raise BpodErrorException( - """Error: Future firmware detected. - Please change Bpod firmware to version 22 and try again.""" - ) + raise BpodErrorException("""Error: Future firmware detected. + Please change Bpod firmware to version 22 and try again.""") self._hardware.firmware_version = firmware_version self._hardware.machine_type = machine_type diff --git a/village/pybpodapi/state_machine/state_machine_builder.py b/village/pybpodapi/state_machine/state_machine_builder.py index 702e52479..f7c2a68bf 100644 --- a/village/pybpodapi/state_machine/state_machine_builder.py +++ b/village/pybpodapi/state_machine/state_machine_builder.py @@ -165,7 +165,7 @@ def build_message(self): tmp += [transition[0]] dest_state = transition[1] tmp += [ - (self.total_states_added if math.isnan(dest_state) else dest_state) + self.total_states_added if math.isnan(dest_state) else dest_state ] message += tmp logger.debug("INPUT MATRIX: %s", tmp) @@ -202,7 +202,7 @@ def build_message(self): - self.hardware.channels.events_positions.globalTimerStart ] tmp += [ - (self.total_states_added if math.isnan(dest_state) else dest_state) + self.total_states_added if math.isnan(dest_state) else dest_state ] message += tmp logger.debug("GLOBAL_TIMER_START_MATRIX: %s", tmp) @@ -222,7 +222,7 @@ def build_message(self): - self.hardware.channels.events_positions.globalTimerEnd ] tmp += [ - (self.total_states_added if math.isnan(dest_state) else dest_state) + self.total_states_added if math.isnan(dest_state) else dest_state ] message += tmp logger.debug("GLOBAL_TIMER_END_MATRIX: %s", tmp) @@ -242,7 +242,7 @@ def build_message(self): - self.hardware.channels.events_positions.globalCounter ] tmp += [ - (self.total_states_added if math.isnan(dest_state) else dest_state) + self.total_states_added if math.isnan(dest_state) else dest_state ] message += tmp logger.debug("GLOBAL_COUNTER_MATRIX: %s", tmp) @@ -261,7 +261,7 @@ def build_message(self): transition[0] - self.hardware.channels.events_positions.condition ] tmp += [ - (self.total_states_added if math.isnan(dest_state) else dest_state) + self.total_states_added if math.isnan(dest_state) else dest_state ] message += tmp diff --git a/village/scripts/parse_bpod_messages.py b/village/scripts/parse_bpod_messages.py index 66fd586dd..77fec406e 100644 --- a/village/scripts/parse_bpod_messages.py +++ b/village/scripts/parse_bpod_messages.py @@ -51,7 +51,7 @@ def parse_input_to_tuple_override(msg: str) -> tuple[str, int, int]: def parse_output_to_tuple_override( - message: str | tuple[str, int] + message: str | tuple[str, int], ) -> tuple[str, Any, int]: """Parses a Bpod output message into a structured tuple.