diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml new file mode 100644 index 0000000..91975cc --- /dev/null +++ b/.github/workflows/checks.yaml @@ -0,0 +1,23 @@ +name: Checks + +on: + push: + branches: + - main + pull_request: {} + +jobs: + checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.11 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --progress-bar off -U .[checking] + pre-commit install + - name: Run checks + run: pre-commit run --all-files diff --git a/ifbo/bar_distribution.py b/ifbo/bar_distribution.py index 91702e3..76f5482 100755 --- a/ifbo/bar_distribution.py +++ b/ifbo/bar_distribution.py @@ -1,10 +1,9 @@ +import logging from typing import Any import torch from torch import nn -import logging - class BarDistribution(nn.Module): def __init__( diff --git a/ifbo/decoders.py b/ifbo/decoders.py index cec66ab..85ddaf2 100755 --- a/ifbo/decoders.py +++ b/ifbo/decoders.py @@ -1,5 +1,3 @@ -import random - import torch from torch import nn diff --git a/ifbo/priors/ftpfn_prior.py b/ifbo/priors/ftpfn_prior.py index fa52ae1..62c7882 100644 --- a/ifbo/priors/ftpfn_prior.py +++ b/ifbo/priors/ftpfn_prior.py @@ -496,7 +496,7 @@ def __init__(self, in_dim: int, out_dim: int) -> None: in_dim - 2, out_dim ) - def forward(self, *x, **kwargs) -> torch.Tensor: + def forward(self, x: torch.Tensor, **kwargs: Any) -> torch.Tensor: x = torch.cat(x, dim=-1) out = ( self.epoch_enc(self.normalizer(x[..., 1:2]))