|
296 | 296 |
|
297 | 297 | for method in methods:
|
298 | 298 | # ... 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}",)) |
305 | 300 |
|
306 | 301 | if pattern is None:
|
307 | 302 | html_additional_pages = {
|
308 | 303 | "generated/" + page[0]: "api_redirect.html" for page in moved_api_pages
|
309 | 304 | }
|
310 | 305 |
|
311 | 306 |
|
312 |
| -header = """\ |
| 307 | +header = f"""\ |
313 | 308 | .. currentmodule:: pandas
|
314 | 309 |
|
315 | 310 | .. ipython:: python
|
|
323 | 318 | pd.options.display.max_rows = 15
|
324 | 319 |
|
325 | 320 | 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 | +""" |
330 | 323 |
|
331 | 324 |
|
332 | 325 | html_context = {
|
@@ -620,19 +613,18 @@ def linkcode_resolve(domain, info):
|
620 | 613 | lineno = None
|
621 | 614 |
|
622 | 615 | if lineno:
|
623 |
| - linespec = "#L{:d}-L{:d}".format(lineno, lineno + len(source) - 1) |
| 616 | + linespec = f"#L{lineno}-L{lineno + len(source) - 1}" |
624 | 617 | else:
|
625 | 618 | linespec = ""
|
626 | 619 |
|
627 | 620 | fn = os.path.relpath(fn, start=os.path.dirname(pandas.__file__))
|
628 | 621 |
|
629 | 622 | 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}" |
633 | 624 | 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}" |
636 | 628 | )
|
637 | 629 |
|
638 | 630 |
|
|
0 commit comments