Skip to content

Commit

Permalink
Apply preview rules
Browse files Browse the repository at this point in the history
Prepare for future versions by applying `ruff check --preview`.
  • Loading branch information
DimitriPapadopoulos committed Sep 27, 2024
1 parent 8fd2faa commit 8a5fef6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/getting_started/tutorials/04.reductions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"outputs": [],
"source": [
"def plot_meas(meas_np, meas, chunks):\n",
" fig, ax = plt.subplots()\n",
" _fig, ax = plt.subplots()\n",
"\n",
" # Define the groups and bar width\n",
" groups = meas_np[\"time\"].keys()\n",
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,6 @@ ignore = [
"RET508",
"SIM108",
]

[tool.ruff.lint.extend-per-file-ignores]
"tests/**" = ["F841"]
2 changes: 1 addition & 1 deletion src/blosc2/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ def print_versions():
for clib in sorted(clib_versions.keys()):
print(f" {clib}: {clib_versions[clib]}")
print(f"Python version: {sys.version}")
(sysname, nodename, release, version, machine, processor) = platform.uname()
(sysname, _nodename, release, version, machine, processor) = platform.uname()
print(f"Platform: {sysname}-{release}-{machine} ({version})")
if sysname == "Linux":
distro = os_release_pretty_name()
Expand Down
6 changes: 3 additions & 3 deletions src/blosc2/lazyexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def fill_chunk_operands(
if nchunk == 0:
# Initialize the iterator for reading the chunks
arr = operands["o0"]
chunks_idx, nchunks = get_chunks_idx(arr.shape, arr.chunks)
chunks_idx, _ = get_chunks_idx(arr.shape, arr.chunks)
info = (reduc, aligned, low_mem, chunks_idx)
iter_chunks = read_nchunk(list(operands.values()), info)
# Run the asynchronous file reading function from a synchronous context
Expand Down Expand Up @@ -1162,7 +1162,7 @@ def chunked_eval(expression: str | Callable[[tuple, np.ndarray, tuple[int]], Non
if where:
# Make the where arguments part of the operands
operands = {**operands, **where}
shape, _, _, fast_path = validate_inputs(operands, out)
_, _, _, fast_path = validate_inputs(operands, out)

# Activate last read cache for NDField instances
for op in operands:
Expand Down Expand Up @@ -1364,7 +1364,7 @@ def get_chunk(self, nchunk):
shape = out.shape
chunks = out.chunks
# Calculate the shape of the (chunk) slice_ (specially at the end of the array)
chunks_idx, nchunks = get_chunks_idx(shape, chunks)
chunks_idx, _ = get_chunks_idx(shape, chunks)
coords = tuple(np.unravel_index(nchunk, chunks_idx))
slice_ = tuple(
slice(c * s, min((c + 1) * s, shape[i]))
Expand Down

0 comments on commit 8a5fef6

Please sign in to comment.