Skip to content

Commit f3b77a1

Browse files
ShaharNavehproost
authored andcommitted
STY: fstrings doc/source/conf.py (pandas-dev#30071)
1 parent 1d86090 commit f3b77a1

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

doc/source/conf.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -296,20 +296,15 @@
296296

297297
for method in methods:
298298
# ... and each of its public methods
299-
moved_api_pages.append(
300-
(
301-
"{old}.{method}".format(old=old, method=method),
302-
"{new}.{method}".format(new=new, method=method),
303-
)
304-
)
299+
moved_api_pages.append((f"{old}.{method}", f"{new}.{method}",))
305300

306301
if pattern is None:
307302
html_additional_pages = {
308303
"generated/" + page[0]: "api_redirect.html" for page in moved_api_pages
309304
}
310305

311306

312-
header = """\
307+
header = f"""\
313308
.. currentmodule:: pandas
314309
315310
.. ipython:: python
@@ -323,10 +318,8 @@
323318
pd.options.display.max_rows = 15
324319
325320
import os
326-
os.chdir(r'{}')
327-
""".format(
328-
os.path.dirname(os.path.dirname(__file__))
329-
)
321+
os.chdir(r'{os.path.dirname(os.path.dirname(__file__))}')
322+
"""
330323

331324

332325
html_context = {
@@ -620,19 +613,18 @@ def linkcode_resolve(domain, info):
620613
lineno = None
621614

622615
if lineno:
623-
linespec = "#L{:d}-L{:d}".format(lineno, lineno + len(source) - 1)
616+
linespec = f"#L{lineno}-L{lineno + len(source) - 1}"
624617
else:
625618
linespec = ""
626619

627620
fn = os.path.relpath(fn, start=os.path.dirname(pandas.__file__))
628621

629622
if "+" in pandas.__version__:
630-
return "http://github.com/pandas-dev/pandas/blob/master/pandas/{}{}".format(
631-
fn, linespec
632-
)
623+
return f"http://github.com/pandas-dev/pandas/blob/master/pandas/{fn}{linespec}"
633624
else:
634-
return "http://github.com/pandas-dev/pandas/blob/v{}/pandas/{}{}".format(
635-
pandas.__version__, fn, linespec
625+
return (
626+
f"http://github.com/pandas-dev/pandas/blob/"
627+
f"v{pandas.__version__}/pandas/{fn}{linespec}"
636628
)
637629

638630

0 commit comments

Comments
 (0)