Skip to content

Commit 6a6a08e

Browse files
authored
Merge pull request numpy#27298 from DimitriPapadopoulos/FLY
MAINT: Apply ruff/flynt rules (FLY)
2 parents f3d48d0 + cdd6c09 commit 6a6a08e

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

numpy/_core/code_generators/ufunc_docstrings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def add_newdoc(place, name, doc):
5959
for k, v in subst.items():
6060
doc = doc.replace('$' + k, v)
6161

62-
docdict['.'.join((place, name))] = doc
62+
docdict[f'{place}.{name}'] = doc
6363

6464

6565
add_newdoc('numpy._core.umath', 'absolute',

numpy/lib/_utils_impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def newfunc(*args, **kwds):
178178
skip += len(line) + 1
179179
doc = doc[skip:]
180180
depdoc = textwrap.indent(depdoc, ' ' * indent)
181-
doc = '\n\n'.join([depdoc, doc])
181+
doc = f'{depdoc}\n\n{doc}'
182182
newfunc.__doc__ = doc
183183

184184
return newfunc

numpy/linalg/_linalg.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,9 +1071,10 @@ def qr(a, mode='reduced'):
10711071
if mode not in ('reduced', 'complete', 'r', 'raw'):
10721072
if mode in ('f', 'full'):
10731073
# 2013-04-01, 1.8
1074-
msg = "".join((
1075-
"The 'full' option is deprecated in favor of 'reduced'.\n",
1076-
"For backward compatibility let mode default."))
1074+
msg = (
1075+
"The 'full' option is deprecated in favor of 'reduced'.\n"
1076+
"For backward compatibility let mode default."
1077+
)
10771078
warnings.warn(msg, DeprecationWarning, stacklevel=2)
10781079
mode = 'reduced'
10791080
elif mode in ('e', 'economic'):

tools/refguide_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def find_names(module, names_dict):
186186
res = re.match(pattern, line)
187187
if res is not None:
188188
name = res.group(1)
189-
entry = '.'.join([module_name, name])
189+
entry = f'{module_name}.{name}'
190190
names_dict.setdefault(module_name, set()).add(name)
191191
break
192192

0 commit comments

Comments
 (0)