Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ef245a

Browse files
MAINT: apply ruff/Pycodestyle rule F541
F541 f-string without any placeholders
1 parent c0e9b53 commit 5ef245a

7 files changed

Lines changed: 17 additions & 17 deletions

File tree

.spin/cmds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ def notes(ctx, version_override):
774774
# Check if `towncrier` is installed
775775
if not shutil.which("towncrier"):
776776
raise click.ClickException(
777-
f"please install `towncrier` to use this command"
777+
"please install `towncrier` to use this command"
778778
)
779779

780780
click.secho(

numpy/_core/tests/test_cython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def install_temp(tmpdir_factory):
7070
print("----------------")
7171
print("meson build failed when doing")
7272
print(f"'meson setup --native-file {native_file} {srcdir}'")
73-
print(f"'meson compile -vv'")
73+
print("'meson compile -vv'")
7474
print(f"in {build_dir}")
7575
print("----------------")
7676
raise

numpy/f2py/crackfortran.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3029,8 +3029,8 @@ def param_eval(v, g_params, params, dimspec=None):
30293029
ubound = param_parse(dimrange[1], params)
30303030
dimrange = range(int(lbound), int(ubound)+1)
30313031
else:
3032-
raise ValueError(f'param_eval: multidimensional array parameters '
3033-
'{dimspec} not supported')
3032+
raise ValueError('param_eval: multidimensional array parameters '
3033+
f'{dimspec} not supported')
30343034

30353035
# Parse parameter value
30363036
v = (v[2:-2] if v.startswith('(/') else v).split(',')

numpy/f2py/tests/test_f2py2e.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def test_no_py312_distutils_fcompiler(capfd, hello_world_f90, monkeypatch):
244244
out, _ = capfd.readouterr()
245245
assert "--fcompiler cannot be used with meson" in out
246246
monkeypatch.setattr(
247-
sys, "argv", f"f2py --help-link".split()
247+
sys, "argv", "f2py --help-link".split()
248248
)
249249
with util.switchdir(ipath.parent):
250250
f2pycli()

numpy/lib/tests/test_format.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,8 @@ def test_version_2_0_memmap(tmpdir):
685685
# requires more than 2 byte for header
686686
dt = [(("%d" % i) * 100, float) for i in range(500)]
687687
d = np.ones(1000, dtype=dt)
688-
tf1 = os.path.join(tmpdir, f'version2_01.npy')
689-
tf2 = os.path.join(tmpdir, f'version2_02.npy')
688+
tf1 = os.path.join(tmpdir, 'version2_01.npy')
689+
tf2 = os.path.join(tmpdir, 'version2_02.npy')
690690

691691
# 1.0 requested but data cannot be saved this way
692692
assert_raises(ValueError, format.open_memmap, tf1, mode='w+', dtype=d.dtype,
@@ -713,7 +713,7 @@ def test_version_2_0_memmap(tmpdir):
713713

714714
@pytest.mark.parametrize("mmap_mode", ["r", None])
715715
def test_huge_header(tmpdir, mmap_mode):
716-
f = os.path.join(tmpdir, f'large_header.npy')
716+
f = os.path.join(tmpdir, 'large_header.npy')
717717
arr = np.array(1, dtype="i,"*10000+"i")
718718

719719
with pytest.warns(UserWarning, match=".*format 2.0"):
@@ -732,7 +732,7 @@ def test_huge_header(tmpdir, mmap_mode):
732732
assert_array_equal(res, arr)
733733

734734
def test_huge_header_npz(tmpdir):
735-
f = os.path.join(tmpdir, f'large_header.npz')
735+
f = os.path.join(tmpdir, 'large_header.npz')
736736
arr = np.array(1, dtype="i,"*10000+"i")
737737

738738
with pytest.warns(UserWarning, match=".*format 2.0"):

numpy/lib/tests/test_nanfunctions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_result_values(self):
142142
], ids=["0d", "2d"])
143143
def test_allnans(self, axis, dtype, array):
144144
if axis is not None and array.ndim == 0:
145-
pytest.skip(f"`axis != None` not supported for 0d arrays")
145+
pytest.skip("`axis != None` not supported for 0d arrays")
146146

147147
array = array.astype(dtype)
148148
match = "All-NaN slice encountered"
@@ -294,7 +294,7 @@ def test_result_values(self):
294294
], ids=["0d", "2d"])
295295
def test_allnans(self, axis, dtype, array):
296296
if axis is not None and array.ndim == 0:
297-
pytest.skip(f"`axis != None` not supported for 0d arrays")
297+
pytest.skip("`axis != None` not supported for 0d arrays")
298298

299299
array = array.astype(dtype)
300300
for func in self.nanfuncs:
@@ -575,7 +575,7 @@ class TestNanFunctions_SumProd(SharedNanFunctionsTestsMixin):
575575
], ids=["0d", "2d"])
576576
def test_allnans(self, axis, dtype, array):
577577
if axis is not None and array.ndim == 0:
578-
pytest.skip(f"`axis != None` not supported for 0d arrays")
578+
pytest.skip("`axis != None` not supported for 0d arrays")
579579

580580
array = array.astype(dtype)
581581
for func, identity in zip(self.nanfuncs, [0, 1]):
@@ -634,7 +634,7 @@ class TestNanFunctions_CumSumProd(SharedNanFunctionsTestsMixin):
634634
], ids=["0d", "2d"])
635635
def test_allnans(self, axis, dtype, array):
636636
if axis is not None and array.ndim == 0:
637-
pytest.skip(f"`axis != None` not supported for 0d arrays")
637+
pytest.skip("`axis != None` not supported for 0d arrays")
638638

639639
array = array.astype(dtype)
640640
for func, identity in zip(self.nanfuncs, [0, 1]):
@@ -744,7 +744,7 @@ def test_ddof_too_big(self):
744744
], ids=["0d", "2d"])
745745
def test_allnans(self, axis, dtype, array):
746746
if axis is not None and array.ndim == 0:
747-
pytest.skip(f"`axis != None` not supported for 0d arrays")
747+
pytest.skip("`axis != None` not supported for 0d arrays")
748748

749749
array = array.astype(dtype)
750750
match = "(Degrees of freedom <= 0 for slice.)|(Mean of empty slice)"
@@ -1181,7 +1181,7 @@ def gen_weights(d):
11811181
], ids=["0d", "2d"])
11821182
def test_allnans(self, axis, dtype, array):
11831183
if axis is not None and array.ndim == 0:
1184-
pytest.skip(f"`axis != None` not supported for 0d arrays")
1184+
pytest.skip("`axis != None` not supported for 0d arrays")
11851185

11861186
array = array.astype(dtype)
11871187
with pytest.warns(RuntimeWarning, match="All-NaN slice encountered"):
@@ -1356,7 +1356,7 @@ def test_no_p_overwrite(self):
13561356
], ids=["0d", "2d"])
13571357
def test_allnans(self, axis, dtype, array):
13581358
if axis is not None and array.ndim == 0:
1359-
pytest.skip(f"`axis != None` not supported for 0d arrays")
1359+
pytest.skip("`axis != None` not supported for 0d arrays")
13601360

13611361
array = array.astype(dtype)
13621362
with pytest.warns(RuntimeWarning, match="All-NaN slice encountered"):

numpy/random/tests/test_direct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def test_legacy_pickle(self):
538538
)
539539

540540
base_path = os.path.split(os.path.abspath(__file__))[0]
541-
pkl_file = os.path.join(base_path, "data", f"sfc64_np126.pkl.gz")
541+
pkl_file = os.path.join(base_path, "data", "sfc64_np126.pkl.gz")
542542
with gzip.open(pkl_file) as gz:
543543
sfc = pickle.load(gz)
544544

0 commit comments

Comments
 (0)