Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/anemoi/utils/provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 8 additions & 16 deletions tests/test_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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


Expand Down
Loading