From 388f45e39352470fac68658c06b9f9bee280b313 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 20:15:59 +0000 Subject: [PATCH 1/2] autoupdate pre-commit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/codespell-project/codespell: v2.4.2 → v2.4.3](https://github.com/codespell-project/codespell/compare/v2.4.2...v2.4.3) - [github.com/astral-sh/ruff-pre-commit: v0.15.21 → v0.16.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.21...v0.16.10) - [github.com/editorconfig-checker/editorconfig-checker.python: 3.6.1 → 3.11.1](https://github.com/editorconfig-checker/editorconfig-checker.python/compare/3.6.1...3.11.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index efda701..50a230e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: hooks: - id: reuse - repo: https://github.com/codespell-project/codespell - rev: v2.4.2 + rev: v2.4.3 hooks: - id: codespell - repo: https://github.com/adamchainz/blacken-docs @@ -28,7 +28,7 @@ repos: - id: blacken-docs args: [-l 100] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.21 + rev: v0.16.10 hooks: - id: ruff args: [--fix, --show-fixes] @@ -76,7 +76,7 @@ repos: - id: trailing-whitespace exclude: \.svg$ - repo: https://github.com/editorconfig-checker/editorconfig-checker.python - rev: "3.6.1" + rev: "3.11.1" hooks: - id: editorconfig-checker alias: ec From bd5c8218733441dcb0197c28b83e73a4671cc7ea Mon Sep 17 00:00:00 2001 From: Kevin Meagher <11620178+kjmeagher@users.noreply.github.com> Date: Thu, 15 Oct 2026 15:19:14 -0500 Subject: [PATCH 2/2] ignore CPY001 --- .pre-commit-config.yaml | 2 +- pyproject.toml | 5 +++-- src/simweights/_weighter.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 50a230e..fc7e478 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: blacken-docs args: [-l 100] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.10 + rev: v0.17.1 hooks: - id: ruff args: [--fix, --show-fixes] diff --git a/pyproject.toml b/pyproject.toml index 20222da..ad02f66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "flit_core.buildapi" requires = ["flit_core >=3.2,<5"] [project] -authors = [{name = "Kevin Meagher"}] +authors = [{ name = "Kevin Meagher" }] classifiers = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Science/Research', @@ -26,7 +26,7 @@ classifiers = [ dependencies = ["numpy>=2", "scipy"] dynamic = ["version", "description"] keywords = ["python", "science", "astronomy", "astrophysics", "IceCube", "neutrino", "simulation"] -license = {file = "LICENSES/BSD-2-Clause.txt"} +license = { file = "LICENSES/BSD-2-Clause.txt" } name = "simweights" readme = "README.rst" requires-python = "~=3.10" @@ -83,6 +83,7 @@ namespace-packages = ["examples", "contrib", "docs"] fixable = ["I", "Q"] ignore = [ "ANN401", # any-type + "CPY001", # Missing copyright notice at top of file "S101", # assert-used "COM812", # conflicts with ruff formatter "PLR0911", # Too many return statement diff --git a/src/simweights/_weighter.py b/src/simweights/_weighter.py index 7e8c843..f5e5c21 100644 --- a/src/simweights/_weighter.py +++ b/src/simweights/_weighter.py @@ -263,7 +263,7 @@ def __add__(self: Weighter, other: Weighter | int) -> Weighter: def __radd__(self: Weighter, other: Weighter | int) -> Weighter: return self + other - def tostring(self: Weighter, flux: None | object | Callable[[Any], ArrayLike] | ArrayLike = None) -> str: + def tostring(self: Weighter, flux: object | Callable[[Any], ArrayLike] | ArrayLike | None = None) -> str: """Creates a string with important information about this weighting object. Generation surface, event map, number of events, and effective area.