Skip to content

Commit 8fc5bde

Browse files
Apply ruff/flake8-simplify rule SIM114
SIM114 Combine `if` branches using logical `or` operator
1 parent ae4e573 commit 8fc5bde

File tree

1 file changed

+3
-3
lines changed
  • src/zarr/core/metadata

1 file changed

+3
-3
lines changed

src/zarr/core/metadata/v3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,9 @@ def parse_fill_value(
481481
except (ValueError, OverflowError, TypeError) as e:
482482
raise ValueError(f"fill value {fill_value!r} is not valid for dtype {data_type}") from e
483483
# Check if the value is still representable by the dtype
484-
if fill_value == "NaN" and np.isnan(casted_value):
485-
pass
486-
elif fill_value in ["Infinity", "-Infinity"] and not np.isfinite(casted_value):
484+
if (fill_value == "NaN" and np.isnan(casted_value)) or (
485+
fill_value in ["Infinity", "-Infinity"] and not np.isfinite(casted_value)
486+
):
487487
pass
488488
elif np_dtype.kind == "f":
489489
# float comparison is not exact, especially when dtype <float64

0 commit comments

Comments
 (0)