From 4d1076956b961c3682955f4345235da357fca228 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:07:51 +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.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/psf/black: 23.3.0 → 24.1.1](https://github.com/psf/black/compare/23.3.0...24.1.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 9f1111c..a656f4d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -14,6 +14,6 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 24.1.1 hooks: - id: black From ee70a2b0bf3797843d299307fddf3142e6edbc34 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:07:59 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/lecroyscope/reading/file.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lecroyscope/reading/file.py b/src/lecroyscope/reading/file.py index 520c10c..2737342 100644 --- a/src/lecroyscope/reading/file.py +++ b/src/lecroyscope/reading/file.py @@ -13,9 +13,11 @@ def read( filename_or_bytes: str | PathLike[str] | bytes, header_only: bool = False ) -> tuple[dict[str, str | int | float], numpy.ndarray, numpy.ndarray]: - with open(filename_or_bytes, "r+b") if not isinstance( - filename_or_bytes, bytes - ) else BytesIO(filename_or_bytes) as f: + with ( + open(filename_or_bytes, "r+b") + if not isinstance(filename_or_bytes, bytes) + else BytesIO(filename_or_bytes) + ) as f: wavedesc_bytes = b"WAVEDESC" # find "WAVEDESC" and skip those bytes if isinstance(filename_or_bytes, bytes):