Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/astral-sh/ruff-pre-commit
rev: v0.12.9
rev: v0.14.9
hooks:
- id: ruff-check
args: [--fix]
Expand Down
2 changes: 1 addition & 1 deletion examples/working with Signal class.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
R = 1 - np.sqrt(X**2 + Y**2)
samples = np.cos(2 * np.pi * X + phi) * R

timestamps = np.arange(0, 2, 0.02)
timestamps = np.arange(0, 2, 0.02, dtype=np.float32)

s_map = Signal(samples=samples, timestamps=timestamps, name="Variable Map Signal", unit="dB")
s_map.plot()
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ module = [
"cchardet.*",
"cmerg.*",
"fsspec.*",
"h5py.*",
"hdf5storage.*",
"isal.*",
"lz4.*",
"mdfreader.*",
Expand Down Expand Up @@ -159,7 +157,6 @@ ignore = [
"PLW2901", # redefined-loop-name
"RUF012", # mutable-class-default
"RUF015", # unnecessary-iterable-allocation-for-first-element
"UP038", # non-pep604-isinstance
]

[tool.ruff.lint.isort]
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
build
mypy~=1.14
pre-commit
ruff~=0.12.0 # Aligned with .pre-commit-config.yaml
ruff~=0.14.0 # Aligned with .pre-commit-config.yaml
tox

2 changes: 1 addition & 1 deletion run_ruff.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pip install --upgrade ruff~=0.12.0 && ^
pip install --upgrade ruff~=0.14.0 && ^
ruff check --fix && ^
ruff format
3 changes: 2 additions & 1 deletion src/asammdf/blocks/bus_logging_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@

def defined_j1939_bit_count(signal: Signal) -> int:
size = typing.cast(int, signal.size)
for defined_size in (4, 8, 10, 12, 16, 20, 24, 28, 32, 64): # 2 removed (see https://github.com/danielhrisca/asammdf/issues/1237)
# 2 removed (see https://github.com/danielhrisca/asammdf/issues/1237)
for defined_size in (4, 8, 10, 12, 16, 20, 24, 28, 32, 64):
if size <= defined_size:
return defined_size
return size
Expand Down
13 changes: 7 additions & 6 deletions src/asammdf/blocks/mdf_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
from .mdf_common import MDF_Common, MdfCommonKwargs
from .options import GLOBAL_OPTIONS
from .source_utils import Source
from .types import ChannelsType, CompressionType, RasterType, StrPath
from .types import ChannelsType, CompressionType, StrPath
from .utils import (
as_non_byte_sized_signed_int,
CHANNEL_COUNT,
Expand Down Expand Up @@ -766,6 +766,7 @@ def _read(
if filter_channels:
display_names = {}
if mapped:
stream = typing.cast(mmap.mmap, stream)
(
id_,
block_len,
Expand Down Expand Up @@ -2701,7 +2702,7 @@ def get(
name: str | None = ...,
group: int | None = ...,
index: int | None = ...,
raster: RasterType | None = ...,
raster: float | None = ...,
samples_only: Literal[False] = ...,
data: tuple[bytes, int, int | None] | None = ...,
raw: bool = ...,
Expand All @@ -2717,7 +2718,7 @@ def get(
name: str | None = ...,
group: int | None = ...,
index: int | None = ...,
raster: RasterType | None = ...,
raster: float | None = ...,
*,
samples_only: Literal[True],
data: tuple[bytes, int, int | None] | None = ...,
Expand All @@ -2734,7 +2735,7 @@ def get(
name: str | None = ...,
group: int | None = ...,
index: int | None = ...,
raster: RasterType | None = ...,
raster: float | None = ...,
samples_only: bool = ...,
data: tuple[bytes, int, int | None] | None = ...,
raw: bool = ...,
Expand All @@ -2749,7 +2750,7 @@ def get(
name: str | None = None,
group: int | None = None,
index: int | None = None,
raster: RasterType | None = None,
raster: float | None = None,
samples_only: bool = False,
data: tuple[bytes, int, int | None] | None = None,
raw: bool = False,
Expand Down Expand Up @@ -3241,7 +3242,7 @@ def get_master(
time_values: list[NDArray[Any]] = []
count = 0
for fragment in data_:
data_bytes, offset, _count = fragment
data_bytes, _offset, _count = fragment
dtype_, byte_size, byte_offset, bit_offset = record

buffer = get_channel_raw_bytes(
Expand Down
Loading
Loading