|
29 | 29 | from mne.tests.test_docstring_parameters import error_ignores |
30 | 30 | from mne.utils import ( |
31 | 31 | _assert_no_instances, |
32 | | - linkcode_resolve, # noqa, analysis:ignore |
| 32 | + linkcode_resolve, |
33 | 33 | run_subprocess, |
34 | 34 | sizeof_fmt, |
35 | 35 | ) |
36 | 36 | from mne.viz import Brain # noqa |
37 | 37 |
|
| 38 | +assert linkcode_resolve is not None # avoid flake warnings, used by numpydoc |
38 | 39 | matplotlib.use("agg") |
39 | 40 | faulthandler.enable() |
40 | 41 | os.environ["_MNE_BROWSER_NO_BLOCK"] = "true" |
|
62 | 63 |
|
63 | 64 | # We need to triage which date type we use so that incremental builds work |
64 | 65 | # (Sphinx looks at variable changes and rewrites all files if some change) |
65 | | -copyright = ( |
| 66 | +copyright = ( # noqa: A001 |
66 | 67 | f'2012–{td.year}, MNE Developers. Last updated <time datetime="{td.isoformat()}" class="localized">{td.strftime("%Y-%m-%d %H:%M %Z")}</time>\n' # noqa: E501 |
67 | 68 | '<script type="text/javascript">$(function () { $("time.localized").each(function () { var el = $(this); el.text(new Date(el.attr("datetime")).toLocaleString([], {dateStyle: "medium", timeStyle: "long"})); }); } )</script>' # noqa: E501 |
68 | 69 | ) |
69 | 70 | if os.getenv("MNE_FULL_DATE", "false").lower() != "true": |
70 | | - copyright = f"2012–{td.year}, MNE Developers. Last updated locally." |
| 71 | + copyright = f"2012–{td.year}, MNE Developers. Last updated locally." # noqa: A001 |
71 | 72 |
|
72 | 73 | # The version info for the project you're documenting, acts as replacement for |
73 | 74 | # |version| and |release|, also used in various other places throughout the |
|
293 | 294 | "RawNIRX": "mne.io.Raw", |
294 | 295 | "RawPersyst": "mne.io.Raw", |
295 | 296 | "RawSNIRF": "mne.io.Raw", |
| 297 | + "Calibration": "mne.preprocessing.eyetracking.Calibration", |
296 | 298 | # dipy |
297 | 299 | "dipy.align.AffineMap": "dipy.align.imaffine.AffineMap", |
298 | 300 | "dipy.align.DiffeomorphicMap": "dipy.align.imwarp.DiffeomorphicMap", |
|
445 | 447 | # -- Sphinx-gallery configuration -------------------------------------------- |
446 | 448 |
|
447 | 449 |
|
448 | | -class Resetter(object): |
| 450 | +class Resetter: |
449 | 451 | """Simple class to make the str(obj) static for Sphinx build env hash.""" |
450 | 452 |
|
451 | 453 | def __init__(self): |
452 | 454 | self.t0 = time.time() |
453 | 455 |
|
454 | 456 | def __repr__(self): |
| 457 | + """Make a stable repr.""" |
455 | 458 | return f"<{self.__class__.__name__}>" |
456 | 459 |
|
457 | 460 | def __call__(self, gallery_conf, fname, when): |
| 461 | + """Do the reset.""" |
458 | 462 | import matplotlib.pyplot as plt |
459 | 463 |
|
460 | 464 | try: |
@@ -1753,7 +1757,7 @@ def reset_warnings(gallery_conf, fname): |
1753 | 1757 | def check_existing_redirect(path): |
1754 | 1758 | """Make sure existing HTML files are redirects, before overwriting.""" |
1755 | 1759 | if path.is_file(): |
1756 | | - with open(path, "r") as fid: |
| 1760 | + with open(path) as fid: |
1757 | 1761 | for _ in range(8): |
1758 | 1762 | next(fid) |
1759 | 1763 | line = fid.readline() |
|
0 commit comments