Skip to content
Open
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
6 changes: 2 additions & 4 deletions src/anemoi/inference/inputs/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ def __init__(
if grid_indices is None and "grid_indices" in context.checkpoint._supporting_arrays:
grid_indices = context.checkpoint.load_supporting_array("grid_indices")
if context.verbosity > 0:
LOG.info(
"Loading supporting array `grid_indices` from checkpoint, \
the input grid will be reduced accordingly."
)
LOG.info("Loading supporting array `grid_indices` from checkpoint, \
the input grid will be reduced accordingly.")

self.grid_indices = slice(None) if grid_indices is None else grid_indices

Expand Down
6 changes: 2 additions & 4 deletions src/anemoi/inference/outputs/grib.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,9 @@ def write_step(self, state: State) -> None:
_log = f"{encoded_date} < {reference_date}"
match self.negative_step_mode:
case "error":
raise ValueError(
f"""Variable {name} has base time before forecast base time: {_log}.
raise ValueError(f"""Variable {name} has base time before forecast base time: {_log}.
To write or skip such variables, set `negative_step_mode` to `write` or `skip`.
Alternatively, try `write_initial_state=False` if this is the initial time step."""
)
Alternatively, try `write_initial_state=False` if this is the initial time step.""")
case "skip":
LOG.warning(f"Skipping variable {name} with base time before forecast base time: {_log}")
continue
Expand Down
1 change: 0 additions & 1 deletion src/anemoi/inference/precisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

"""List of precisions supported by the inference runner."""


from functools import cached_property


Expand Down
6 changes: 2 additions & 4 deletions src/anemoi/inference/runners/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,11 @@ def execute(self) -> None:
output.close()

if "accumulate_from_start_of_forecast" not in self.config.post_processors:
LOG.warning(
"""
LOG.warning("""
🚧 The default accumulation behaviour has changed. 🚧
🚧 Accumulation fields have NOT been accumulated from the beginning of the forecast. 🚧
🚧 To accumulate from the beginning, set `post_processors: [accumulate_from_start_of_forecast]` 🚧
""" # ecmwf/anemoi-inference#131
)
""") # ecmwf/anemoi-inference#131

def create_output(self) -> Output:
"""Create the output.
Expand Down
2 changes: 1 addition & 1 deletion src/anemoi/inference/transports/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def start(self) -> None:
def wait(self) -> None:
"""Wait for all child processes to complete and handle any errors."""
while self.children:
(pid, status) = os.wait()
pid, status = os.wait()
LOG.info(f"Child process {pid} ({self.children[pid]}) exited with status {status}")
del self.children[pid]

Expand Down
2 changes: 1 addition & 1 deletion src/anemoi/inference/transports/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def receive(self, receiver: Task, source: Task, tag: int) -> State:
return self.backlogs[receiver.name].pop((source.name, tag))

while True:
(sender, tag, state) = self.wrapped_tasks[receiver.name].queue.get()
sender, tag, state = self.wrapped_tasks[receiver.name].queue.get()
if sender != source.name or tag != tag:
with self.lock:
self.backlogs[receiver.name][(sender, tag)] = state
Expand Down
Loading