Skip to content

Commit 9267f70

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d1be12b commit 9267f70

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/test_io_elementwise.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,7 @@ def test_write_auto_sharded_default_warns(tmp_path: Path):
947947
):
948948
adata.write_zarr(path)
949949

950+
950951
@pytest.mark.zarr_io
951952
@pytest.mark.skipif(
952953
Version(version("zarr")) < Version("3.1.4"),
@@ -955,12 +956,17 @@ def test_write_auto_sharded_default_warns(tmp_path: Path):
955956
def test_write_auto_sharded_size_sparse(tmp_path: Path):
956957
path = "memory://check_shards.zarr"
957958
z = zarr.open(path)
958-
mat = sparse.random(1000, 1000, density=.5, format="csr", random_state=np.random.default_rng(42))
959+
mat = sparse.random(
960+
1000, 1000, density=0.5, format="csr", random_state=np.random.default_rng(42)
961+
)
959962
ad.io.write_elem(z, "two_shards_per_sub_element", mat)
960963
# i.e., there are at most two shards since one shard will contain two chunks,
961964
# and the other the last elements, since the target size is 1GB uncompressed.
962965
for sub_element in ["indices", "data", "indptr"]:
963-
assert (z["two_shards_per_sub_element"][sub_element].shape[0] / z["two_shards_per_sub_element"][sub_element].shards[0]) < 2, sub_element
966+
assert (
967+
z["two_shards_per_sub_element"][sub_element].shape[0]
968+
/ z["two_shards_per_sub_element"][sub_element].shards[0]
969+
) < 2, sub_element
964970

965971

966972
@pytest.mark.zarr_io

0 commit comments

Comments
 (0)