Skip to content

Commit

Permalink
pre-commit auto updates (#26)
Browse files Browse the repository at this point in the history
* pre-commit auto updates

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.7 → v0.6.3](astral-sh/ruff-pre-commit@v0.5.7...v0.6.3)
- [github.com/quintenroets/package-dev-tools: v0.6.3 → v0.6.8](quintenroets/package-dev-tools@v0.6.3...v0.6.8)
- [github.com/quintenroets/package-dev-tools: v0.6.3 → v0.6.8](quintenroets/package-dev-tools@v0.6.3...v0.6.8)

* auto fixes from pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Sep 3, 2024
1 parent 8cb99fc commit 53576bc
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: docformatter
args: [--in-place, --make-summary-multi-line, --close-quotes-on-newline, --wrap-summaries, "88"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.6.3
hooks:
- id: ruff
- id: ruff-format
Expand All @@ -19,7 +19,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/quintenroets/package-dev-tools
rev: v0.6.3
rev: v0.6.8
hooks:
- id: infer-missing-annotations
- repo: local
Expand All @@ -39,7 +39,7 @@ repos:
always_run: true
fail_fast: true
- repo: https://github.com/quintenroets/package-dev-tools
rev: v0.6.3
rev: v0.6.8
hooks:
- id: check-coverage
- id: check-shields
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest.mock import PropertyMock, patch

import pytest

from revnets.context import context as context_
from revnets.context.context import Context
from revnets.models import Config, Evaluation, HyperParameters, Path
Expand All @@ -22,7 +23,7 @@ def _mocked_assets_path() -> Iterator[None]:
yield


@pytest.fixture()
@pytest.fixture
def test_context(
context: Context,
_mocked_assets_path: None, # noqa: PT019
Expand Down
6 changes: 3 additions & 3 deletions tests/evaluations/test_evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
from typing import cast

import pytest
from torch.nn import Sequential

from revnets import evaluations, pipelines, reconstructions
from revnets.context import Context
from revnets.evaluations import analysis, attack, outputs, weights
from revnets.evaluations.evaluate import format_percentage
from revnets.networks import mininet
from revnets.pipelines import Pipeline
from torch.nn import Sequential

from tests.evaluations import verifier
from tests.evaluations.verifier import Standardization

Expand Down Expand Up @@ -40,7 +40,7 @@
)


@pytest.fixture()
@pytest.fixture
def pipeline() -> Pipeline:
return pipelines.mininet.Pipeline()

Expand Down
2 changes: 1 addition & 1 deletion tests/evaluations/test_standardize.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from types import ModuleType

import pytest

from revnets import networks
from revnets.models import Activation

from tests.evaluations.verifier import Standardization, Verifier

standardizations = (
Expand Down
3 changes: 2 additions & 1 deletion tests/evaluations/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from typing import cast

from hypothesis import given, strategies
from torch import nn

from revnets.standardization.utils import (
extract_layer,
extract_rnn_layers,
extract_scale_isomorphism_after_max_pool,
)
from revnets.standardization.weights import rnn
from torch import nn


@given(
Expand Down
3 changes: 2 additions & 1 deletion tests/evaluations/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from typing import cast

import torch
from torch.nn import Module, Sequential

from revnets import standardization
from revnets.context import context
from revnets.models import Activation
Expand All @@ -18,7 +20,6 @@
extract_internal_layers,
)
from revnets.standardization.weights import feedforward
from torch.nn import Module, Sequential


class Standardization(Enum):
Expand Down
1 change: 1 addition & 0 deletions tests/test_cli_entry_points.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest.mock import MagicMock, patch

from package_dev_utils.tests.args import no_cli_args

from revnets.cli import entry_point, launch


Expand Down
1 change: 1 addition & 0 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import TYPE_CHECKING

import pytest

from revnets import data

if TYPE_CHECKING:
Expand Down
1 change: 1 addition & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
import torch

from revnets.main.main import Experiment

gpu_available = torch.cuda.is_available()
Expand Down
1 change: 1 addition & 0 deletions tests/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import TYPE_CHECKING

import pytest

from revnets import pipelines

if TYPE_CHECKING:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_reconstructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import pytest
from pytorch_lightning.core.optimizer import LightningOptimizer
from torch import nn

from revnets import reconstructions
from revnets.pipelines.mininet import Pipeline
from revnets.reconstructions import Reconstructor, queries
from revnets.training.reconstructions import Network
from revnets.training.reconstructions.callbacks import LearningRateScheduler
from torch import nn

reconstruction_modules = (
reconstructions.empty,
Expand Down

0 comments on commit 53576bc

Please sign in to comment.