diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ef4e368..2a3fa89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: - id: python-check-blanket-noqa # Check for # noqa: all - id: python-no-log-warn # Check for log.warn - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.12.0 + rev: 26.1.0 hooks: - id: black args: [--line-length=120] @@ -41,7 +41,7 @@ repos: - --profile black - --project anemoi - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.10 + rev: v0.14.14 hooks: - id: ruff args: @@ -59,12 +59,12 @@ repos: - id: docconvert args: ["numpy"] - repo: https://github.com/tox-dev/pyproject-fmt - rev: "v2.11.1" + rev: "v2.12.1" hooks: - id: pyproject-fmt args: ["--max-supported-python", "3.12"] - repo: https://github.com/jshwi/docsig # Check docstrings against function sig - rev: v0.74.0 + rev: v0.77.0 hooks: - id: docsig args: diff --git a/src/anemoi/utils/provenance.py b/src/anemoi/utils/provenance.py index 9fcc0a7..5552cef 100644 --- a/src/anemoi/utils/provenance.py +++ b/src/anemoi/utils/provenance.py @@ -415,7 +415,7 @@ def assets_info(paths: list[str]) -> dict[str, Any]: for path in paths: try: - (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime) = os.stat(path) # noqa: F841 + mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime = os.stat(path) # noqa: F841 md5 = path_md5(path) except Exception as e: result[path] = str(e) diff --git a/tests/test_dates.py b/tests/test_dates.py index 26eb970..6d428d5 100644 --- a/tests/test_dates.py +++ b/tests/test_dates.py @@ -36,41 +36,35 @@ def _(txt: str) -> datetimes_factory: def test_date_1() -> None: """Test datetimes_factory with a list of dates.""" - d = _( - """ + d = _(""" - 2023-01-01 - 2023-01-02 - 2023-01-03 - """ - ) + """) assert len(list(d)) == 3 def test_date_2() -> None: """Test datetimes_factory with a date range and frequency.""" - d = _( - """ + d = _(""" start: 2023-01-01 end: 2023-01-07 frequency: 12 day_of_week: [monday, friday] - """ - ) + """) assert len(list(d)) == 4 def test_date_3() -> None: """Test datetimes_factory with multiple date ranges and frequencies.""" - d = _( - """ + d = _(""" - start: 2023-01-01 end: 2023-01-03 frequency: 24 - start: 2024-01-01T06:00:00 end: 2024-01-02T18:00:00 frequency: 6h - """ - ) + """) assert datetime.datetime(2023, 1, 1, 0) in d assert datetime.datetime(2023, 1, 2, 0) in d assert datetime.datetime(2023, 1, 3, 0) in d @@ -86,16 +80,14 @@ def test_date_3() -> None: def test_date_hindcast_1() -> None: """Test datetimes_factory with hindcast configuration.""" - d = _( - """ + d = _(""" - name: hindcast reference_dates: start: 2023-01-01 end: 2023-01-03 frequency: 24 years: 20 - """ - ) + """) assert len(list(d)) == 60