Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 23, 2024
1 parent 9c28777 commit 1c7a99c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/anemoi/models/layers/bounding.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:


class ReluBounding(BaseBounding):
"""Initializes the bounding with a ReLU activation / zero clamping.
"""
"""Initializes the bounding with a ReLU activation / zero clamping."""

def forward(self, x: torch.Tensor) -> torch.Tensor:
x[..., self.data_index] = torch.nn.functional.relu(x[..., self.data_index])
return x
Expand Down Expand Up @@ -101,7 +101,9 @@ class FractionBounding(HardtanhBounding):
example, in the case of convective precipitation (Cp), total_var = Tp (total precipitation).
"""

def __init__(self, *, variables: list[str], name_to_index: dict, min_val: float, max_val: float, total_var: str) -> None:
def __init__(
self, *, variables: list[str], name_to_index: dict, min_val: float, max_val: float, total_var: str
) -> None:
super().__init__(variables=variables, name_to_index=name_to_index, min_val=min_val, max_val=max_val)
self.total_variable = self._create_index(variables=[total_var])

Expand Down

0 comments on commit 1c7a99c

Please sign in to comment.