Skip to content

Commit

Permalink
style: upgrade black to version 25
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienGrv committed Feb 4, 2025
1 parent 1132530 commit 7af5c4d
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ wheel.py-api = "cp39"

[tool.black]
line-length = 120
required-version = "24"
required-version = "25"
target-version = ['py39']
force-exclude = '''
(.*/src/asammdf/gui/ui)|(.*/ext)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
--requirement doc/requirements.txt
--requirement test/requirements.txt
--requirement types-requirements.txt
black~=24.1 # Aligned with .pre-commit-config.yaml
black~=25.1 # Aligned with .pre-commit-config.yaml
build
mypy~=1.14
pre-commit
Expand Down
2 changes: 1 addition & 1 deletion run_black_and_ruff.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pip install --upgrade black~=24.1 ruff~=0.8.0 && ^
pip install --upgrade black~=25.1 ruff~=0.8.0 && ^
black --config pyproject.toml . asammdf.spec && ^
ruff check --fix
2 changes: 1 addition & 1 deletion src/asammdf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" asammdf is a parser and editor for ASAM MDF files """
"""asammdf is a parser and editor for ASAM MDF files"""

import logging

Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/blocks/mdf_v2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" ASAM MDF version 2 file format module """
"""ASAM MDF version 2 file format module"""

from os import PathLike
from typing import Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/blocks/mdf_v3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" ASAM MDF version 3 file format module """
"""ASAM MDF version 3 file format module"""

from collections import defaultdict
from collections.abc import Callable, Iterable, Iterator, Sequence
Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/blocks/v2_v3_blocks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" classes that implement the blocks for MDF versions 2 and 3 """
"""classes that implement the blocks for MDF versions 2 and 3"""

from collections.abc import Iterator, Sequence
from datetime import datetime, timedelta, timezone
Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/blocks/v2_v3_constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" MDF v2 and v3 constants """
"""MDF v2 and v3 constants"""

from collections.abc import Callable
import struct
Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/blocks/v4_constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" MDF v4 constants """
"""MDF v4 constants"""

import re
import struct
Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/gui/widgets/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def __init__(

self.setHeaderHidden(False)
self.setColumnCount(5)
self.setHeaderLabels(["Name", "Value", "Unit", "\u290a", "\u21A8"])
self.setHeaderLabels(["Name", "Value", "Unit", "\u290a", "\u21a8"])
self.setDragEnabled(True)
self.setExpandsOnDoubleClick(False)

Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/mdf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" common MDF file format module """
"""common MDF file format module"""

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/signal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" asammdf *Signal* class module for time correct signal processing """
"""asammdf *Signal* class module for time correct signal processing"""

from collections.abc import Iterator
import logging
Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/tool.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" asammdf tool module """
"""asammdf tool module"""

from .version import __version__ as v__

Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
""" asammdf version module """
"""asammdf version module"""

__version__ = "8.1.0.dev6"
4 changes: 2 additions & 2 deletions test/test_cantp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class TestCANTP(unittest.TestCase):

payload = np.vstack(
[
np.frombuffer(b"\x10\x0B\x52\x49\x47\x20\x20\x39", dtype="uint8"), # Initial part
np.frombuffer(b"\x10\x0b\x52\x49\x47\x20\x20\x39", dtype="uint8"), # Initial part
np.frombuffer(b"\x30\xff\x00\x4c\x40\x00\xd5\x54", dtype="uint8"), # Flow control
np.frombuffer(b"\x21\x30\x30\x30\x38\x33\x00\x00", dtype="uint8"), # Final (second) part
np.frombuffer(b"\x10\x0B\x52\x49\x47\x20\x20\x39", dtype="uint8"), # Initial part of next frame...
np.frombuffer(b"\x10\x0b\x52\x49\x47\x20\x20\x39", dtype="uint8"), # Initial part of next frame...
]
)
ts = np.array([0.112, 0.113, 0.116, 0.201])
Expand Down
24 changes: 12 additions & 12 deletions test/test_endianess.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ def test_mixed(self):
def test_not_aligned_mdf_v3(self):
t = np.arange(15, dtype="<f8")

s1 = Signal(np.frombuffer(b"\x00\x00\x3F\x02" * 15, dtype=">u4"), t, name="Motorola")
s1 = Signal(np.frombuffer(b"\x00\x00\x3f\x02" * 15, dtype=">u4"), t, name="Motorola")

s2 = Signal(np.frombuffer(b"\x04\xF8\x00\x00" * 15, dtype="<u4"), t, name="Intel")
s2 = Signal(np.frombuffer(b"\x04\xf8\x00\x00" * 15, dtype="<u4"), t, name="Intel")

s3 = Signal(
np.frombuffer(b"\xBB\x55" * 2 * 15, dtype="<u4"),
np.frombuffer(b"\xbb\x55" * 2 * 15, dtype="<u4"),
t,
name="NotAlignedMotorola",
)

s4 = Signal(np.frombuffer(b"\xBB\x55" * 2 * 15, dtype="<u4"), t, name="NotAlignedIntel")
s4 = Signal(np.frombuffer(b"\xbb\x55" * 2 * 15, dtype="<u4"), t, name="NotAlignedIntel")

with MDF(version="3.30") as mdf_source:
mdf_source.append([s1, s2, s3, s4], common_timebase=True)
Expand Down Expand Up @@ -121,17 +121,17 @@ def test_not_aligned_mdf_v3(self):
def test_not_aligned_mdf_v4(self):
t = np.arange(15, dtype="<f8")

s1 = Signal(np.frombuffer(b"\x00\x00\x3F\x02" * 15, dtype=">u4"), t, name="Motorola")
s1 = Signal(np.frombuffer(b"\x00\x00\x3f\x02" * 15, dtype=">u4"), t, name="Motorola")

s2 = Signal(np.frombuffer(b"\x04\xF8\x00\x00" * 15, dtype="<u4"), t, name="Intel")
s2 = Signal(np.frombuffer(b"\x04\xf8\x00\x00" * 15, dtype="<u4"), t, name="Intel")

s3 = Signal(
np.frombuffer(b"\xBB\x55" * 2 * 15, dtype="<u4"),
np.frombuffer(b"\xbb\x55" * 2 * 15, dtype="<u4"),
t,
name="NotAlignedMotorola",
)

s4 = Signal(np.frombuffer(b"\xBB\x55" * 2 * 15, dtype="<u4"), t, name="NotAlignedIntel")
s4 = Signal(np.frombuffer(b"\xbb\x55" * 2 * 15, dtype="<u4"), t, name="NotAlignedIntel")

with MDF(version="4.11") as mdf_source:
mdf_source.append([s1, s2, s3, s4], common_timebase=True)
Expand Down Expand Up @@ -199,13 +199,13 @@ def test_overlapping_channels_mdf_v3(self):
t = np.arange(15, dtype="<f8")

s1 = Signal(
np.frombuffer(b"\x00\x00\x3F\x02\x04\xF8\x00\x00" * 15, dtype="<u8"),
np.frombuffer(b"\x00\x00\x3f\x02\x04\xf8\x00\x00" * 15, dtype="<u8"),
t,
name="Parent",
)

s2 = Signal(
np.frombuffer(b"\x04\xF8\x00\x00" * 15, dtype="<u4"),
np.frombuffer(b"\x04\xf8\x00\x00" * 15, dtype="<u4"),
t,
name="OverlappingMotorola",
)
Expand Down Expand Up @@ -291,13 +291,13 @@ def test_overlapping_channels_mdf_v4(self):
t = np.arange(15, dtype="<f8")

s1 = Signal(
np.frombuffer(b"\x00\x00\x3F\x02\x04\xF8\x00\x00" * 15, dtype="<u8"),
np.frombuffer(b"\x00\x00\x3f\x02\x04\xf8\x00\x00" * 15, dtype="<u8"),
t,
name="Parent",
)

s2 = Signal(
np.frombuffer(b"\x04\xF8\x00\x00" * 15, dtype="<u4"),
np.frombuffer(b"\x04\xf8\x00\x00" * 15, dtype="<u4"),
t,
name="OverlappingMotorola",
)
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ commands =

[testenv:black]
deps =
black~=24.1 # Aligned with .pre-commit-config.yaml
black~=25.1 # Aligned with .pre-commit-config.yaml
skip_install = true
commands =
black --config pyproject.toml --check . asammdf.spec
Expand Down

0 comments on commit 7af5c4d

Please sign in to comment.