diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 228a9e4..ddd423e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/commitizen-tools/commitizen - rev: v3.21.3 + rev: v4.1.1 hooks: - id: commitizen # - id: commitizen-branch @@ -15,12 +15,12 @@ repos: - id: check-useless-excludes - repo: https://github.com/scientific-python/cookie - rev: 2024.03.10 + rev: 2025.01.22 hooks: - id: sp-repo-review - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -48,7 +48,7 @@ repos: - id: text-unicode-replacement-char - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.3.5" + rev: "v0.9.4" hooks: # Run the linter - id: ruff @@ -59,7 +59,7 @@ repos: types_or: [python, pyi, jupyter] - repo: https://github.com/adamchainz/blacken-docs - rev: "1.16.0" + rev: "1.19.1" hooks: - id: blacken-docs additional_dependencies: [black==23.*] @@ -72,7 +72,7 @@ repos: args: [--prose-wrap=always] - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.9.0" + rev: "v1.14.1" hooks: - id: mypy files: src @@ -80,11 +80,11 @@ repos: - pytest - repo: https://github.com/codespell-project/codespell - rev: "v2.2.6" + rev: "v2.4.1" hooks: - id: codespell - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.16 + rev: v0.23 hooks: - id: validate-pyproject diff --git a/src/interpolated_coordinates/conftest.py b/src/interpolated_coordinates/conftest.py index 67c6204..ba8082f 100644 --- a/src/interpolated_coordinates/conftest.py +++ b/src/interpolated_coordinates/conftest.py @@ -46,8 +46,8 @@ def pytest_report_header(config: Any) -> str: # noqa: ARG001 """Add extra info to the :mod:`pytest` header.""" # This gets added after the pytest-astropy-header output. return ( - f'ARCH_ON_CI: {os.environ.get("ARCH_ON_CI", "undefined")}\n' - f'IS_CRON: {os.environ.get("IS_CRON", "undefined")}\n' + f"ARCH_ON_CI: {os.environ.get('ARCH_ON_CI', 'undefined')}\n" + f"IS_CRON: {os.environ.get('IS_CRON', 'undefined')}\n" ) diff --git a/src/interpolated_coordinates/frame.py b/src/interpolated_coordinates/frame.py index e6ac07b..4b805f3 100644 --- a/src/interpolated_coordinates/frame.py +++ b/src/interpolated_coordinates/frame.py @@ -409,8 +409,7 @@ def _data_repr(self) -> str: # noqa: C901 "s", ).items(): diffrepr[0] = diffrepr[0].replace(rep_nm, frm_nm) - if diffrepr[-1].endswith(">"): - diffrepr[-1] = diffrepr[-1][:-1] + diffrepr[-1] = diffrepr[-1].removesuffix(">") data_repr_spl[-1] = "\n".join(diffrepr) data_repr = "\n".join(data_repr_spl) diff --git a/src/interpolated_coordinates/representation.py b/src/interpolated_coordinates/representation.py index ce960c7..c875f60 100644 --- a/src/interpolated_coordinates/representation.py +++ b/src/interpolated_coordinates/representation.py @@ -4,9 +4,9 @@ __all__ = [ "InterpolatedBaseRepresentationOrDifferential", - "InterpolatedRepresentation", "InterpolatedCartesianRepresentation", "InterpolatedDifferential", + "InterpolatedRepresentation", ] import abc diff --git a/src/interpolated_coordinates/utils/generic_representation.py b/src/interpolated_coordinates/utils/generic_representation.py index 0ea0fd0..c139be8 100644 --- a/src/interpolated_coordinates/utils/generic_representation.py +++ b/src/interpolated_coordinates/utils/generic_representation.py @@ -50,8 +50,8 @@ from astropy.coordinates.representation import DIFFERENTIAL_CLASSES __all__ = [ - "GenericRepresentation", "GenericDifferential", + "GenericRepresentation", ] ############################################################################## diff --git a/src/interpolated_coordinates/utils/spline.py b/src/interpolated_coordinates/utils/spline.py index 740df57..4d5ed33 100644 --- a/src/interpolated_coordinates/utils/spline.py +++ b/src/interpolated_coordinates/utils/spline.py @@ -81,9 +81,9 @@ from __future__ import annotations __all__ = [ - "UnivariateSplinewithUnits", "InterpolatedUnivariateSplinewithUnits", "LSQUnivariateSplinewithUnits", + "UnivariateSplinewithUnits", ] import warnings @@ -335,7 +335,7 @@ def validate_input( # then validate with UnivariateSpline method, which works with units! out: tuple[ndarray, ndarray, ndarray, list[Quantity], int | str] out = super().validate_input(x, y, w, bbox, k, s, ext, check_finite) - return out # noqa: RET504 + return out @classmethod def _from_tck( diff --git a/tests/test_representation.py b/tests/test_representation.py index 3f8d48e..e18a9b3 100644 --- a/tests/test_representation.py +++ b/tests/test_representation.py @@ -2,9 +2,9 @@ __all__ = [ "Test_InterpolatedBaseRepresentationOrDifferential", - "Test_InterpolatedRepresentation", "Test_InterpolatedCartesianRepresentation", "Test_InterpolatedDifferential", + "Test_InterpolatedRepresentation", ] @@ -625,8 +625,6 @@ def test___truediv__(self, irep, affine) -> None: for c in expected.components: assert all(getattr(got, c) == getattr(expected, c)) - # - ##################################################################### diff --git a/tests/test_utils/test_generic_representation.py b/tests/test_utils/test_generic_representation.py index c870eeb..75e95e8 100644 --- a/tests/test_utils/test_generic_representation.py +++ b/tests/test_utils/test_generic_representation.py @@ -1,8 +1,8 @@ """Testing :mod:`~interpolated_coordinates.utils.generic_representation`.""" __all__ = [ - "test_GENERIC_REGISTRY", "Test_GenericRepresentation", + "test_GENERIC_REGISTRY", ] diff --git a/tests/test_utils/test_spline.py b/tests/test_utils/test_spline.py index aca71dc..3154827 100644 --- a/tests/test_utils/test_spline.py +++ b/tests/test_utils/test_spline.py @@ -1,9 +1,9 @@ """Testing :mod:`~interpolated_coordinates.utils.splines`.""" __all__ = [ - "Test_UnivariateSplinewithUnits", "Test_InterpolatedUnivariateSplinewithUnits", "Test_LSQUnivariateSplinewithUnits", + "Test_UnivariateSplinewithUnits", ] import astropy.units as u