From b36aa034a6d94b957212fe727bf92b555933fc41 Mon Sep 17 00:00:00 2001 From: Tim Galvin Date: Mon, 17 Aug 2026 15:33:51 +0800 Subject: [PATCH 1/9] addded logger, and to --- .pre-commit-config.yaml | 47 ++++++++++++++++++++--------------------- eye_patch/logging.py | 45 +++++++++++++++++++++++++++++++++++++++ eye_patch/masking.py | 6 ++---- 3 files changed, 70 insertions(+), 28 deletions(-) create mode 100644 eye_patch/logging.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1871e17..c8ebce6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,13 @@ ci: - autoupdate_commit_msg: "chore(deps): update pre-commit hooks" + autoupdate_commit_msg: "chore: update pre-commit hooks" autofix_commit_msg: "style: pre-commit fixes" - autoupdate_schedule: "monthly" - -exclude: ^.cruft.json|.copier-answers.yml$ repos: - repo: https://github.com/adamchainz/blacken-docs rev: "1.20.0" hooks: - id: blacken-docs - additional_dependencies: [black==25.*] + additional_dependencies: [black==24.*] - repo: https://github.com/pre-commit/pre-commit-hooks rev: "v6.0.0" @@ -28,24 +25,24 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - - repo: https://github.com/pre-commit/pygrep-hooks - rev: "v1.10.0" - hooks: - - id: rst-backticks - - id: rst-directive-colons - - id: rst-inline-touching-normal + # - repo: https://github.com/pre-commit/pygrep-hooks + # rev: "v1.10.0" + # hooks: + # - id: rst-backticks + # - id: rst-directive-colons + # - id: rst-inline-touching-normal - - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.8.3" - hooks: - - id: prettier - types_or: [yaml, markdown, html, css, scss, javascript, json] - args: [--prose-wrap=always] + # - repo: https://github.com/pre-commit/mirrors-prettier + # rev: "v4.0.0-alpha.8" + # hooks: + # - id: prettier + # types_or: [yaml, markdown, html, css, scss, javascript, json] + # args: [--prose-wrap=always] - repo: https://github.com/astral-sh/ruff-pre-commit rev: "v0.15.12" hooks: - - id: ruff-check + - id: ruff args: ["--fix", "--show-fixes"] - id: ruff-format @@ -53,19 +50,21 @@ repos: rev: "v2.0.0" hooks: - id: mypy - files: eye_patch|tests + files: flint|tests args: ["--ignore-missing-imports"] additional_dependencies: - - numpy - - capn-crunch - - pytest-stub + - pytest + - types-PyYAML + + - repo: https://github.com/crate-ci/typos + rev: "v1.46.0" + hooks: + - id: typos - repo: https://github.com/codespell-project/codespell rev: "v2.4.2" hooks: - id: codespell - additional_dependencies: - - tomli; python_version<'3.11' - repo: https://github.com/shellcheck-py/shellcheck-py rev: "v0.11.0.1" diff --git a/eye_patch/logging.py b/eye_patch/logging.py new file mode 100644 index 0000000..36885f5 --- /dev/null +++ b/eye_patch/logging.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +import logging + +# Create logger +logging.captureWarnings(True) +logger = logging.getLogger("eye-patch") +logger.setLevel(logging.INFO) + +# Create console handler and set level to debug +ch = logging.StreamHandler() +ch.setLevel(logging.INFO) + + +class CustomFormatter(logging.Formatter): + """A custom logger formatter""" + + grey = "\x1b[38;20m" + blue = "\x1b[34;20m" + green = "\x1b[32;20m" + yellow = "\x1b[33;20m" + red = "\x1b[31;20m" + bold_red = "\x1b[31;1m" + reset = "\x1b[0m" + format_str = "%(asctime)s.%(msecs)03d %(module)s - %(funcName)s: %(message)s" + + FORMATS = { # noqa: RUF012 + logging.DEBUG: f"{blue}%(levelname)s{reset} {format_str}", + logging.INFO: f"{green}%(levelname)s{reset} {format_str}", + logging.WARNING: f"{yellow}%(levelname)s{reset} {format_str}", + logging.ERROR: f"{red}%(levelname)s{reset} {format_str}", + logging.CRITICAL: f"{bold_red}%(levelname)s{reset} {format_str}", + } + + def format(self, record): + log_fmt = self.FORMATS.get(record.levelno) + formatter = logging.Formatter(log_fmt, "%Y-%m-%d %H:%M:%S") + return formatter.format(record) + + +# Add formatter to ch +ch.setFormatter(CustomFormatter()) + +# Add ch to logger +logger.addHandler(ch) diff --git a/eye_patch/masking.py b/eye_patch/masking.py index 536246b..d453c85 100644 --- a/eye_patch/masking.py +++ b/eye_patch/masking.py @@ -4,7 +4,6 @@ from __future__ import annotations -import logging from argparse import ArgumentParser from pathlib import Path from typing import NamedTuple, TypeAlias @@ -26,6 +25,7 @@ from scipy.ndimage import binary_fill_holes, label, maximum_filter, minimum_filter from scipy.signal import fftconvolve +from eye_patch.logging import logger from eye_patch.naming import FITSMaskNames, create_fits_mask_names # Add explicit export so mypy on tests is ok @@ -37,8 +37,6 @@ # during fits file creation. MaskLike: TypeAlias = NDArray[np.floating] -logger = logging.getLogger("__name__") - class MaskingOptions(BaseOptions): """Contains options for the creation of clean masks from some subject @@ -916,7 +914,7 @@ def create_snr_mask_from_fits( logger.info(f"Writing {mask_names.mask_fits}") fits.writeto( filename=mask_names.mask_fits, - data=mask_data, + data=mask_data.astype(np.float32), header=fits_header, overwrite=overwrite, ) From f43f1955bae8c25b4f097ecd92542761a2bf4003 Mon Sep 17 00:00:00 2001 From: Tim Galvin Date: Mon, 17 Aug 2026 15:50:52 +0800 Subject: [PATCH 2/9] added a warning --- eye_patch/masking.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eye_patch/masking.py b/eye_patch/masking.py index d453c85..cec57f1 100644 --- a/eye_patch/masking.py +++ b/eye_patch/masking.py @@ -963,6 +963,11 @@ def convolve_image_by_scale( logger.info(f"Generating gaussian kernel for {scale=} {fwhm=:.3f} {sigma=:.3f}") pix_sigma = int(sigma * 5) + if pix_sigma < 1: + logger.warning( + f"{scale=} is too small to form a appropriately sized gaussian kernel. Setting its {pix_sigma=} to 1." + ) + pix_sigma = 1 x = np.linspace(0, pix_sigma, pix_sigma) y = np.linspace(0, pix_sigma, pix_sigma) From 90382f7eae5f5b668fd8e6e352b47d7c1ee97a0a Mon Sep 17 00:00:00 2001 From: Tim Galvin Date: Mon, 17 Aug 2026 16:24:07 +0800 Subject: [PATCH 3/9] raise error, not warning --- eye_patch/masking.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eye_patch/masking.py b/eye_patch/masking.py index cec57f1..257d637 100644 --- a/eye_patch/masking.py +++ b/eye_patch/masking.py @@ -964,10 +964,11 @@ def convolve_image_by_scale( pix_sigma = int(sigma * 5) if pix_sigma < 1: - logger.warning( - f"{scale=} is too small to form a appropriately sized gaussian kernel. Setting its {pix_sigma=} to 1." - ) - pix_sigma = 1 + # linspace can only take integer inputs, and if sigma is too small then this array comes + # out as length zero. + msg = f"{scale=} is too small and an appropriately sized kernel can not be formed. Consider removing it. " + raise ValueError(msg) + x = np.linspace(0, pix_sigma, pix_sigma) y = np.linspace(0, pix_sigma, pix_sigma) From beb26273f8a82a8d62bc9425bb8d6059b36970b5 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 21 Sep 2026 10:05:01 +0000 Subject: [PATCH 4/9] Fix CI and CD: twine metadata, mypy/numpy/python version clash Three related failures were making CI and CD red on main and on every open PR. CD: the "Distribution build" job failed on `twine check --strict` with "Invalid distribution metadata: '2.5' is not a valid metadata version". hatchling emits Metadata-Version 2.5, which only Twine 7 understands. build-and-inspect-python-package gained Twine 7 in v3.0.0, but v3 also stopped force-tagging minor releases, so the floating `@v2` tag could never pick the fix up. Pin to v3.0.1. CI: the "Format" job failed in mypy while parsing numpy's own stubs: "Type statement is only supported in Python 3.12 and greater". The Format job runs on Python 3.14, where numpy resolves to 2.5.x, whose stubs use PEP 695 `type` statements. mypy was targeting 3.10, so it refused to parse them. numpy 2.5 itself requires Python >=3.12, so the target has to be at least 3.12 for its stubs to parse. Align the stale 3.10 references, which sat below the project's own `requires-python = ">=3.11"`: - mypy python_version 3.10 -> 3.12 - test matrix 3.10 -> 3.11, so the minimum supported version is actually exercised (it previously was not tested at all) - drop the 3.10 classifier Raising the mypy target uncovered a real bug that the 3.10 target had been masking: `reverse_negative_flood_fill` returns a bool array, which was passed to `beam_shape_erode` (which expects floats) and then handed to `fits.writeto`, where astropy rejects it. This is the same failure Beth reported via #14. Cast the flood-fill mask to float32 at the point it is created, so both the erosion step and the FITS write get a float array, and drop the now-redundant `type: ignore[assignment]`. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01GTPJweMZavwh86CQ7qH7rb --- .github/workflows/cd.yml | 2 +- .github/workflows/ci.yml | 2 +- eye_patch/masking.py | 4 ++-- pyproject.toml | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8c7f2bf..4e9c19e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -29,7 +29,7 @@ jobs: with: fetch-depth: 0 - - uses: hynek/build-and-inspect-python-package@v2 + - uses: hynek/build-and-inspect-python-package@v3.0.1 publish: needs: [dist] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eca34c1..18cf087 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.12", "3.13", "3.14"] + python-version: ["3.11", "3.12", "3.13", "3.14"] runs-on: [ubuntu-latest] steps: diff --git a/eye_patch/masking.py b/eye_patch/masking.py index 536246b..5a2cc69 100644 --- a/eye_patch/masking.py +++ b/eye_patch/masking.py @@ -899,14 +899,14 @@ def create_snr_mask_from_fits( mask_data = reverse_negative_flood_fill( base_image=np.squeeze(signal_data), masking_options=masking_options, - ) + ).astype(np.float32) mask_data = mask_data.reshape(signal_data.shape) else: logger.info(f"Clipping using a {masking_options.base_snr_clip=}") mask_data = (signal_data > masking_options.base_snr_clip).astype(float) if masking_options.beam_shape_erode: - mask_data = beam_shape_erode( # type: ignore[assignment] + mask_data = beam_shape_erode( mask=mask_data, fits_header=fits_header, minimum_response=masking_options.beam_shape_erode_minimum_response, diff --git a/pyproject.toml b/pyproject.toml index 1131f81..4be17f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,6 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -98,7 +97,7 @@ report.exclude_also = ['\.\.\.', 'if typing.TYPE_CHECKING:'] [tool.mypy] files = ["eye_patch", "tests"] -python_version = "3.10" +python_version = "3.12" warn_unused_configs = true strict = true enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] From 5df81c9aa6fbf02ffe1b711e7a93476d0cfabbce Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 21 Sep 2026 12:11:47 +0000 Subject: [PATCH 5/9] Pin the mypy pre-commit hook to Python 3.11 Target mypy at the project's actual minimum (3.11) rather than 3.12. numpy 2.5 requires Python >=3.12 and its stubs use PEP 695 `type` statements, which mypy refuses to parse while targeting anything below 3.12. Pinning the hook's environment to 3.11 resolves numpy to the 2.4.x line, whose stubs parse cleanly at that target, so the type check now matches `requires-python = ">=3.11"` instead of silently skipping over it. The Format job installs 3.11 alongside 3.x so the hook can find it; 3.x stays last and remains the interpreter pre-commit itself runs on. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01GTPJweMZavwh86CQ7qH7rb --- .github/workflows/ci.yml | 7 ++++++- .pre-commit-config.yaml | 5 +++++ pyproject.toml | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18cf087..ce91f7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,9 +25,14 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 + # 3.11 is installed alongside so the mypy hook can pin itself to it + # (see language_version in .pre-commit-config.yaml). The last entry + # stays the default interpreter that pre-commit itself runs on. - uses: actions/setup-python@v6 with: - python-version: "3.x" + python-version: | + 3.11 + 3.x - uses: astral-sh/setup-uv@v7 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1871e17..878f0a2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,6 +55,11 @@ repos: - id: mypy files: eye_patch|tests args: ["--ignore-missing-imports"] + # Pinned to the project's minimum supported Python. numpy 2.5 requires + # >=3.12 and its stubs use PEP 695 `type` statements, which mypy will + # not parse while targeting 3.11. Resolving numpy on 3.11 keeps us on + # the 2.4.x stubs, which do parse. + language_version: python3.11 additional_dependencies: - numpy - capn-crunch diff --git a/pyproject.toml b/pyproject.toml index 4be17f8..483ef05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,7 +97,7 @@ report.exclude_also = ['\.\.\.', 'if typing.TYPE_CHECKING:'] [tool.mypy] files = ["eye_patch", "tests"] -python_version = "3.12" +python_version = "3.11" warn_unused_configs = true strict = true enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] From 23eaa969b57190278c6654503fd25663e25d5283 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 21 Sep 2026 12:17:00 +0000 Subject: [PATCH 6/9] Revert pre-commit config, annotate logger, pick up CI fixes Per review on #14: Revert .pre-commit-config.yaml to the version on main. The copied flint config regressed several things here: it pointed mypy at `files: flint|tests` (the wrong package for this repo, so mypy checked nothing), dropped the `exclude` for the copier answers file, downgraded blacken-docs to black 24, commented out the prettier and pygrep hooks, renamed `ruff-check` to the deprecated `ruff` alias, and dropped the numpy/capn-crunch/pytest-stub dependencies that mypy needs to resolve this package's own types. The underlying numpy / mypy / python version clash is addressed explicitly instead, via the CI fixes merged in from #15: mypy targets 3.11 (the project's real minimum) with the hook pinned to a 3.11 environment, so numpy resolves to the 2.4.x stubs that parse at that target. Annotate CustomFormatter.format, which mypy requires now that it actually checks this package (`disallow_untyped_defs` is on for eye_patch.*). The bool mask fix is now applied at the point the flood-fill mask is created rather than only at `fits.writeto`, which also fixes the type error passing it into `beam_shape_erode`. The `.astype(np.float32)` at the write is kept: it is no longer load-bearing for the bool bug, but `beam_shape_erode` still returns float64 on the multi-scale path, so the cast keeps the mask on disk at float32. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01GTPJweMZavwh86CQ7qH7rb --- .pre-commit-config.yaml | 47 +++++++++++++++++++++-------------------- eye_patch/logging.py | 2 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb17ff4..878f0a2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,16 @@ ci: - autoupdate_commit_msg: "chore: update pre-commit hooks" + autoupdate_commit_msg: "chore(deps): update pre-commit hooks" autofix_commit_msg: "style: pre-commit fixes" + autoupdate_schedule: "monthly" + +exclude: ^.cruft.json|.copier-answers.yml$ repos: - repo: https://github.com/adamchainz/blacken-docs rev: "1.20.0" hooks: - id: blacken-docs - additional_dependencies: [black==24.*] + additional_dependencies: [black==25.*] - repo: https://github.com/pre-commit/pre-commit-hooks rev: "v6.0.0" @@ -25,24 +28,24 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - # - repo: https://github.com/pre-commit/pygrep-hooks - # rev: "v1.10.0" - # hooks: - # - id: rst-backticks - # - id: rst-directive-colons - # - id: rst-inline-touching-normal + - repo: https://github.com/pre-commit/pygrep-hooks + rev: "v1.10.0" + hooks: + - id: rst-backticks + - id: rst-directive-colons + - id: rst-inline-touching-normal - # - repo: https://github.com/pre-commit/mirrors-prettier - # rev: "v4.0.0-alpha.8" - # hooks: - # - id: prettier - # types_or: [yaml, markdown, html, css, scss, javascript, json] - # args: [--prose-wrap=always] + - repo: https://github.com/rbubley/mirrors-prettier + rev: "v3.8.3" + hooks: + - id: prettier + types_or: [yaml, markdown, html, css, scss, javascript, json] + args: [--prose-wrap=always] - repo: https://github.com/astral-sh/ruff-pre-commit rev: "v0.15.12" hooks: - - id: ruff + - id: ruff-check args: ["--fix", "--show-fixes"] - id: ruff-format @@ -50,7 +53,7 @@ repos: rev: "v2.0.0" hooks: - id: mypy - files: flint|tests + files: eye_patch|tests args: ["--ignore-missing-imports"] # Pinned to the project's minimum supported Python. numpy 2.5 requires # >=3.12 and its stubs use PEP 695 `type` statements, which mypy will @@ -58,18 +61,16 @@ repos: # the 2.4.x stubs, which do parse. language_version: python3.11 additional_dependencies: - - pytest - - types-PyYAML - - - repo: https://github.com/crate-ci/typos - rev: "v1.46.0" - hooks: - - id: typos + - numpy + - capn-crunch + - pytest-stub - repo: https://github.com/codespell-project/codespell rev: "v2.4.2" hooks: - id: codespell + additional_dependencies: + - tomli; python_version<'3.11' - repo: https://github.com/shellcheck-py/shellcheck-py rev: "v0.11.0.1" diff --git a/eye_patch/logging.py b/eye_patch/logging.py index 36885f5..661fe6f 100644 --- a/eye_patch/logging.py +++ b/eye_patch/logging.py @@ -32,7 +32,7 @@ class CustomFormatter(logging.Formatter): logging.CRITICAL: f"{bold_red}%(levelname)s{reset} {format_str}", } - def format(self, record): + def format(self, record: logging.LogRecord) -> str: log_fmt = self.FORMATS.get(record.levelno) formatter = logging.Formatter(log_fmt, "%Y-%m-%d %H:%M:%S") return formatter.format(record) From 9658e7506e3921d9d549e6c38fdb1440618021d0 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 21 Sep 2026 12:17:58 +0000 Subject: [PATCH 7/9] Correct beam_shape_erode return-dtype docstring The docstring claimed a bool return for no/single scale and int32 otherwise. Neither held: the single-scale path casts to the input dtype, and the multi-scale path returns the float64 array it accumulates into. Now that the mask is float from the point it is created, the bool return is gone entirely. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01GTPJweMZavwh86CQ7qH7rb --- eye_patch/masking.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eye_patch/masking.py b/eye_patch/masking.py index 5a2cc69..7da19f8 100644 --- a/eye_patch/masking.py +++ b/eye_patch/masking.py @@ -301,7 +301,9 @@ def beam_shape_erode( scales (list[int] | tuple[int, ...] | None, optional): Defines the scales that are being used during multi-scale clean. Perform the beam erosion at each of these scales. Defaults to None. Returns: - MaskLike: The eroded beam shape. If a no/single scale provide it is a bool return, otherwise int32. + MaskLike: The eroded beam shape. For no/single scale the dtype of ``mask`` is + preserved; for multiple scales a float64 bitmask is returned, where the + n'th scale is stored as the n'th bit. """ if not all(key in fits_header for key in ["BMAJ", "BMIN", "BPA"]): From 787faf5426b091e383b9e03d9852c277309efc40 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 21 Sep 2026 12:21:42 +0000 Subject: [PATCH 8/9] Add regression test for the flood-fill mask dtype codecov flagged 0% patch coverage, which turned out to be pointing at a real gap rather than a threshold quirk: every existing mask test runs with `flood_fill=False`, so nothing exercised the branch that produced the bool array. That is why this shipped. Covers the path end to end and asserts the written mask is floating point. Verified it fails without the fix, raising the same KeyError from astropy's image HDU while writing the mask that Beth hit. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01GTPJweMZavwh86CQ7qH7rb --- tests/test_masking.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_masking.py b/tests/test_masking.py index e74bf99..bacf429 100644 --- a/tests/test_masking.py +++ b/tests/test_masking.py @@ -491,6 +491,26 @@ def test_fits_masking(fits_dir): assert valid == np.prod(SHAPE) +def test_fits_masking_flood_fill_writes_float_mask(fits_dir): + """The flood fill path builds its mask as a bool array, which ``fits.writeto`` + rejects. Reported by Beth via #14, and not caught earlier because every other + mask test runs with ``flood_fill=False``.""" + masking_options = MaskingOptions(flood_fill=True) + names = create_snr_mask_from_fits( + fits_image_path=fits_dir / "image.fits", + fits_rms_path=fits_dir / "rms.fits", + fits_bkg_path=fits_dir / "bkg.fits", + masking_options=masking_options, + ) + + assert isinstance(names, FITSMaskNames) + assert names.mask_fits.exists() + + mask_data = fits.getdata(names.mask_fits) + assert mask_data.dtype.kind == "f", "A bool mask cannot be written to FITS" + assert np.sum(mask_data) == np.prod(SHAPE) + + def test_fits_masking_with_signal(fits_dir): masking_options = MaskingOptions(flood_fill=False) names = create_snr_mask_from_fits( From b530ca57457f9e44c8e4d5336b1ce18be745554c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 21 Sep 2026 12:22:43 +0000 Subject: [PATCH 9/9] Drop explanatory comments from CI and pre-commit config Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01GTPJweMZavwh86CQ7qH7rb --- .github/workflows/ci.yml | 3 --- .pre-commit-config.yaml | 4 ---- 2 files changed, 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce91f7f..855c910 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,9 +25,6 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - # 3.11 is installed alongside so the mypy hook can pin itself to it - # (see language_version in .pre-commit-config.yaml). The last entry - # stays the default interpreter that pre-commit itself runs on. - uses: actions/setup-python@v6 with: python-version: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 878f0a2..06a9e5d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,10 +55,6 @@ repos: - id: mypy files: eye_patch|tests args: ["--ignore-missing-imports"] - # Pinned to the project's minimum supported Python. numpy 2.5 requires - # >=3.12 and its stubs use PEP 695 `type` statements, which mypy will - # not parse while targeting 3.11. Resolving numpy on 3.11 keeps us on - # the 2.4.x stubs, which do parse. language_version: python3.11 additional_dependencies: - numpy