Skip to content

Commit 56fa3dd

Browse files
committed
Fix: Apply isort autofix for import sorting and formatting
1 parent 586c8d4 commit 56fa3dd

File tree

2 files changed

+37
-34
lines changed

2 files changed

+37
-34
lines changed

monai/inferers/merger.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121
import numpy as np
2222
import torch
2323

24-
from monai.utils import ensure_tuple_size, get_package_version, optional_import, require_pkg, version_geq, deprecated_arg
24+
from monai.utils import (
25+
deprecated_arg,
26+
ensure_tuple_size,
27+
get_package_version,
28+
optional_import,
29+
require_pkg,
30+
version_geq,
31+
)
2532

2633
if TYPE_CHECKING:
2734
import zarr
@@ -237,25 +244,21 @@ class ZarrAvgMerger(Merger):
237244
"""
238245

239246
@deprecated_arg(
240-
name="compressor",
241-
since="1.5.0",
242-
removed="1.7.0",
243-
new_name="codecs",
244-
msg_suffix="Please use 'codecs' instead."
247+
name="compressor", since="1.5.0", removed="1.7.0", new_name="codecs", msg_suffix="Please use 'codecs' instead."
245248
)
246249
@deprecated_arg(
247250
name="value_compressor",
248251
since="1.5.0",
249252
removed="1.7.0",
250253
new_name="value_codecs",
251-
msg_suffix="Please use 'value_codecs' instead."
254+
msg_suffix="Please use 'value_codecs' instead.",
252255
)
253256
@deprecated_arg(
254257
name="count_compressor",
255258
since="1.5.0",
256259
removed="1.7.0",
257260
new_name="count_codecs",
258-
msg_suffix="Please use 'count_codecs' instead."
261+
msg_suffix="Please use 'count_codecs' instead.",
259262
)
260263
def __init__(
261264
self,

tests/inferers/test_zarr_avg_merger.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -202,25 +202,19 @@
202202
]
203203

204204
# Define zarr v3 codec configurations with proper bytes codec
205-
ZARR_V3_LZ4_CODECS = [
206-
{"name": "bytes", "configuration": {}},
207-
{"name": "blosc", "configuration": {"cname": "lz4"}}
208-
]
205+
ZARR_V3_LZ4_CODECS = [{"name": "bytes", "configuration": {}}, {"name": "blosc", "configuration": {"cname": "lz4"}}]
209206

210-
ZARR_V3_PICKLE_CODECS = [
211-
{"name": "bytes", "configuration": {}},
212-
{"name": "pickle", "configuration": {}}
213-
]
207+
ZARR_V3_PICKLE_CODECS = [{"name": "bytes", "configuration": {}}, {"name": "pickle", "configuration": {}}]
214208

215-
ZARR_V3_LZMA_CODECS = [
216-
{"name": "bytes", "configuration": {}},
217-
{"name": "lzma", "configuration": {}}
218-
]
209+
ZARR_V3_LZMA_CODECS = [{"name": "bytes", "configuration": {}}, {"name": "lzma", "configuration": {}}]
219210

220211
# test for LZ4 compressor (zarr v2) or codecs (zarr v3)
221212
TEST_CASE_13_COMPRESSOR_LZ4 = [
222-
dict(merged_shape=TENSOR_4x4.shape, compressor="LZ4") if not version_geq(get_package_version("zarr"), "3.0.0")
223-
else dict(merged_shape=TENSOR_4x4.shape, codecs=ZARR_V3_LZ4_CODECS),
213+
(
214+
dict(merged_shape=TENSOR_4x4.shape, compressor="LZ4")
215+
if not version_geq(get_package_version("zarr"), "3.0.0")
216+
else dict(merged_shape=TENSOR_4x4.shape, codecs=ZARR_V3_LZ4_CODECS)
217+
),
224218
[
225219
(TENSOR_4x4[..., :2, :2], (0, 0)),
226220
(TENSOR_4x4[..., :2, 2:], (0, 2)),
@@ -232,8 +226,11 @@
232226

233227
# test for pickle compressor (zarr v2) or codecs (zarr v3)
234228
TEST_CASE_14_COMPRESSOR_PICKLE = [
235-
dict(merged_shape=TENSOR_4x4.shape, compressor="Pickle") if not version_geq(get_package_version("zarr"), "3.0.0")
236-
else dict(merged_shape=TENSOR_4x4.shape, codecs=ZARR_V3_PICKLE_CODECS),
229+
(
230+
dict(merged_shape=TENSOR_4x4.shape, compressor="Pickle")
231+
if not version_geq(get_package_version("zarr"), "3.0.0")
232+
else dict(merged_shape=TENSOR_4x4.shape, codecs=ZARR_V3_PICKLE_CODECS)
233+
),
237234
[
238235
(TENSOR_4x4[..., :2, :2], (0, 0)),
239236
(TENSOR_4x4[..., :2, 2:], (0, 2)),
@@ -245,8 +242,11 @@
245242

246243
# test for LZMA compressor (zarr v2) or codecs (zarr v3)
247244
TEST_CASE_15_COMPRESSOR_LZMA = [
248-
dict(merged_shape=TENSOR_4x4.shape, compressor="LZMA") if not version_geq(get_package_version("zarr"), "3.0.0")
249-
else dict(merged_shape=TENSOR_4x4.shape, codecs=ZARR_V3_LZMA_CODECS),
245+
(
246+
dict(merged_shape=TENSOR_4x4.shape, compressor="LZMA")
247+
if not version_geq(get_package_version("zarr"), "3.0.0")
248+
else dict(merged_shape=TENSOR_4x4.shape, codecs=ZARR_V3_LZMA_CODECS)
249+
),
250250
[
251251
(TENSOR_4x4[..., :2, :2], (0, 0)),
252252
(TENSOR_4x4[..., :2, 2:], (0, 2)),
@@ -294,10 +294,10 @@
294294

295295
# test with value_codecs for zarr v3
296296
TEST_CASE_19_VALUE_CODECS = [
297-
dict(merged_shape=TENSOR_4x4.shape, value_codecs=[
298-
{"name": "bytes", "configuration": {}},
299-
{"name": "blosc", "configuration": {"cname": "zstd"}}
300-
]),
297+
dict(
298+
merged_shape=TENSOR_4x4.shape,
299+
value_codecs=[{"name": "bytes", "configuration": {}}, {"name": "blosc", "configuration": {"cname": "zstd"}}],
300+
),
301301
[
302302
(TENSOR_4x4[..., :2, :2], (0, 0)),
303303
(TENSOR_4x4[..., :2, 2:], (0, 2)),
@@ -309,10 +309,10 @@
309309

310310
# test with count_codecs for zarr v3
311311
TEST_CASE_20_COUNT_CODECS = [
312-
dict(merged_shape=TENSOR_4x4.shape, count_codecs=[
313-
{"name": "bytes", "configuration": {}},
314-
{"name": "blosc", "configuration": {"cname": "zlib"}}
315-
]),
312+
dict(
313+
merged_shape=TENSOR_4x4.shape,
314+
count_codecs=[{"name": "bytes", "configuration": {}}, {"name": "blosc", "configuration": {"cname": "zlib"}}],
315+
),
316316
[
317317
(TENSOR_4x4[..., :2, :2], (0, 0)),
318318
(TENSOR_4x4[..., :2, 2:], (0, 2)),

0 commit comments

Comments
 (0)