diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index efda701..fc7e478 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.17.1 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 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.