Skip to content

Commit 0c6c54c

Browse files
Apply ruff/refurb rule FURB171
FURB171 Membership test against single-item container
1 parent a104994 commit 0c6c54c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/zarr/v2/meta.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def decode_fill_value(cls, v: Any, dtype: np.dtype, object_codec: Any = None) ->
222222
return -np.inf
223223
else:
224224
return np.array(v, dtype=dtype)[()]
225-
elif dtype.kind in "c":
225+
elif dtype.kind == "c":
226226
v = (
227227
cls.decode_fill_value(v[0], dtype.type().real.dtype),
228228
cls.decode_fill_value(v[1], dtype.type().imag.dtype),
@@ -269,23 +269,23 @@ def encode_fill_value(cls, v: Any, dtype: np.dtype, object_codec: Any = None) ->
269269
return "-Infinity"
270270
else:
271271
return float(v)
272-
elif dtype.kind in "ui":
272+
elif dtype.kind in ("u", "i"):
273273
return int(v)
274274
elif dtype.kind == "b":
275275
return bool(v)
276-
elif dtype.kind in "c":
276+
elif dtype.kind == "c":
277277
c = cast(np.complex128, np.dtype(complex).type())
278278
v = (
279279
cls.encode_fill_value(v.real, c.real.dtype, object_codec),
280280
cls.encode_fill_value(v.imag, c.imag.dtype, object_codec),
281281
)
282282
return v
283-
elif dtype.kind in "SV":
283+
elif dtype.kind in ("S", "V"):
284284
v = str(base64.standard_b64encode(v), "ascii")
285285
return v
286286
elif dtype.kind == "U":
287287
return v
288-
elif dtype.kind in "mM":
288+
elif dtype.kind in ("m", "M"):
289289
return int(v.view("i8"))
290290
else:
291291
return v

0 commit comments

Comments
 (0)