Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 4, 2024
1 parent 5212c06 commit 6b7dc5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/anndata/_io/specs/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,14 @@ def write_hdf5_scalar(
):
# Can’t compress scalars, error is thrown
dataset_kwargs = dict(dataset_kwargs)
for arg in ("compression", "compression_opts", "chunks", "shuffle", "fletcher32", "scaleoffset"):
for arg in (
"compression",
"compression_opts",
"chunks",
"shuffle",
"fletcher32",
"scaleoffset",
):
dataset_kwargs.pop(arg, None)
f.create_dataset(key, data=np.array(value), **dataset_kwargs)

Expand Down
4 changes: 3 additions & 1 deletion src/anndata/_io/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from functools import wraps, WRAPPER_ASSIGNMENTS
from functools import WRAPPER_ASSIGNMENTS, wraps
from itertools import pairwise
from typing import TYPE_CHECKING, cast
from warnings import warn
Expand Down Expand Up @@ -286,10 +286,12 @@ def _read_legacy_raw(
raw["varm"] = read_attr(f["raw.varm"])
return raw


def zero_dim_array(func):
"""\
A decorator for write_elem implementations of arrays where zero-dimensional arrays need special handling.
"""

@wraps(func, assigned=WRAPPER_ASSIGNMENTS + ("__defaults__", "__kwdefaults__"))
def func_wrapper(f, k, elem, *, _writer, dataset_kwargs):
if elem.shape == ():
Expand Down

0 comments on commit 6b7dc5d

Please sign in to comment.