Skip to content

Commit 98ceaa6

Browse files
Apply ruff/flake8-simplify rule SIM905
SIM905 Consider using a list literal instead of `str.split`
1 parent d32cc00 commit 98ceaa6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

xarray/tests/test_coding.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def test_coder_roundtrip() -> None:
9494
assert_identical(original, roundtripped)
9595

9696

97-
@pytest.mark.parametrize("dtype", "u1 u2 i1 i2 f2 f4".split())
98-
@pytest.mark.parametrize("dtype2", "f4 f8".split())
97+
@pytest.mark.parametrize("dtype", ["u1", "u2", "i1", "i2", "f2", "f4"])
98+
@pytest.mark.parametrize("dtype2", ["f4", "f8"])
9999
def test_scaling_converts_to_float(dtype: str, dtype2: str) -> None:
100100
dt = np.dtype(dtype2)
101101
original = xr.Variable(

xarray/tests/test_groupby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3235,7 +3235,7 @@ def test_shuffle_simple() -> None:
32353235
da = xr.DataArray(
32363236
dims="x",
32373237
data=dask.array.from_array([1, 2, 3, 4, 5, 6], chunks=2),
3238-
coords={"label": ("x", "a b c a b c".split(" "))},
3238+
coords={"label": ("x", ["a", "b", "c", "a", "b", "c"])},
32393239
)
32403240
actual = da.groupby(label=UniqueGrouper()).shuffle_to_chunks()
32413241
expected = da.isel(x=[0, 3, 1, 4, 2, 5])

xarray/util/print_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def get_sys_info():
2020
if os.path.isdir(".git") and os.path.isdir("xarray"):
2121
try:
2222
pipe = subprocess.Popen(
23-
'git log --format="%H" -n 1'.split(" "),
23+
("git", "log", '--format="%H"', "-n", "1"),
2424
stdout=subprocess.PIPE,
2525
stderr=subprocess.PIPE,
2626
)

0 commit comments

Comments
 (0)